An autoclicker to automatically configure and read SNLO.
Project description
SNLO-Helper
SNLO-Helper helps to use SNLO software for simulation of nonlinear optical processes in crystals.
An autoclicker clicks different buttons and fills fields in order to automate SNLO simulations. Afterwards, it can retrieve the results and return them as a dictionary.
Attention:
- The script does use your mouse and keyboard, so you should not interact with the computer at the same time.
- The script uses predefined positions of the windows, so do not move the windows.
- The autoclicker can be interrupted by moving the mouse into the top left corner of the screen.
Currently it supports the following functions (feel free to add more):
- Ref. Ind.
- Qmix
- 2D-mix-LP
- 2D-mix-SP
- PW-OPO-BB
- 2D-cav-LP
- Focus
Installation
Install it executing pip install -e .
in this folder or via pip install snlo-helper
to download it in the background and install it.
Usage
Quick Start
- Start SNLO on your computer
- Import
snlohelper.main_window.MainWindow
as a starting point. - Create an instande
mw = MainWindow
- Open the desired function:
ri = mw.open_function(Functions.REF_INDEX)
- Execute it
no, ne = ri.refractive_indices(Wavelength=1234)
Here is a small snippet how to do a 2D mix of long pulses:
from snlohelper.main_window import MainWindow
mw = MainWindow()
mix = mw.open_two_d_mix_lp()
mix.configure({"Wavelengths (nm)": [1064.5, None, None]})
result = mix.run_and_read()
print(result)
For more examples see the examples
folder.
General usage
- The
main_window.MainWindow
class manages 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.
- You start that class, for example
mix = two_d_mix_lp.TwoDMixLp()
ormix = MainWindow().open_function("2D-Mix-LP")
. - You can configure it giving a configuration dictionary (the keys correspond to the names) with
mix.configure({"Wavelengths": [1064, None, None]})
. If a value isNone
, it won't be changed. - You can run it with
mix.run()
- With
results = mix.read_results()
you can extract the resulting text. - With
result_dict = mix.interpret_results(results)
you get a dictionary of the result data - There are convenience methods like
mix.run_and_read
which runs and returns the dictionary, or evenmix.configure_run_read
, which does all of above steps in one.
- You start that class, for example
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file snlo_helper-0.4.0.tar.gz
.
File metadata
- Download URL: snlo_helper-0.4.0.tar.gz
- Upload date:
- Size: 20.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b39a28817eff8d090f6fce4e5686d535742d8de5500287350f3d7a7383b4216 |
|
MD5 | f5196bcd087a38fea1c3c608067336b6 |
|
BLAKE2b-256 | dfe58aac090a3c3e59d2c1fa6f78f8ae1d64c8b6ea83b156890173e3d28abdac |
Provenance
File details
Details for the file snlo_helper-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: snlo_helper-0.4.0-py3-none-any.whl
- Upload date:
- Size: 26.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df6e3ff1907b5fe4606919c044176755ef798b1c854a6d3c4464915a886dd2ea |
|
MD5 | 7372832898ce6418ceb0f0ba248a4078 |
|
BLAKE2b-256 | ab9841fef70fbf0d8eaddd87c2c5f466207f5f719957ff35bd55817d3d906c8d |