diff --git a/README.md b/README.md index ae66777491e2b87bd7e2fc57d859b8d37238adf2..068d9f219ff29d1a7f83e87f6c0f9c095aa575e1 100644 --- a/README.md +++ b/README.md @@ -16,9 +16,13 @@ Install it executing `pip install -e .` in this folder or via `pip install git+h ## Usage -Import `snlohelper.snlo` as a starting point. -If your screen resolution differs from HD, you have to set screenfactors with `utils.set_screenfactors`. -That will rescale all positions to your current screen resolution. +### Quick Start + +1. Start SNLO on your computer +2. Import `snlohelper.snlo` as a starting point. +3. If your screen resolution differs from HD, you have to set screenfactors with `utils.set_screenfactors`. + That will rescale all positions to your current screen resolution. +4. Open the desired method and execute it. Here is a small snippet how to do a 2D mix of long pulses: ``` @@ -36,6 +40,18 @@ print(result) For more examples see the `examples` folder. +### General usage + +* The `main_window.open_function` method allows to open any SNLO function of the main window. +* For several functions exists a module containing a class, which in turn allows to configure the function, to run the calculation, and to extract the result. + 1. You start that class, for example `mix = two_d_mix_lp.TwoDMixLp()`. + 2. You can configure it giving a configuration dictionary (the keys correspond to the names) with `mix.configure({"Wavelengths": [1064, None, None]})` + 3. You can run it with `mix.run()` + 4. With `results = mix.read_results()` you can extract the resulting text. + 5. With `result_dict = mix.interpret_results(results)` you get a dictionary of the data + 6. There are convenience methods like `mix.run_and_read` which runs and returns the dictionary, or even `mix.configure_run_read`, which does all of above steps in one. + + ## Contribution You are welcome to contribute to this library. Just open an issue for suggestions or bug reports and open a pull request for code contributions. diff --git a/snlohelper/main_window.py b/snlohelper/main_window.py index b2a6bfa4f588cd4d4576b48abdb3e42f0ca7fae5..3eda17cab1636f55204b1d54f65937ebcf31d75a 100644 --- a/snlohelper/main_window.py +++ b/snlohelper/main_window.py @@ -55,3 +55,7 @@ class Functions(StrEnum): def open_function(key: str | Functions) -> None: """opens function according to key""" gui.click(*scale(*_functions_coord[key])) + + +def close_snlo() -> None: + gui.click(*scale(95, 14)) diff --git a/snlohelper/snlo.py b/snlohelper/snlo.py index b95561278b14454b0aa27711b61adf035b226f50..47f7ae3c5a2bc9842cca7d123c1ed911cab299fa 100644 --- a/snlohelper/snlo.py +++ b/snlohelper/snlo.py @@ -3,6 +3,7 @@ import logging from . import utils from .main_window import open_function, Functions # noqa: F401 +from .ref_index import RefractiveIndex # noqa: F401 from .two_d_mix_lp import TwoDMixLP # noqa: F401 from .two_d_mix_sp import TwoDMixSP # noqa: F401 from .focus import focus # noqa: F401