Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SNLO helper
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
NLOQO
SNLO helper
Commits
ddffa5d7
Commit
ddffa5d7
authored
1 year ago
by
Benedikt Burger
Browse files
Options
Downloads
Patches
Plain Diff
SNLO helper improved with documentation and better extendability.
parent
b69d0f7f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+15
-0
15 additions, 0 deletions
README.md
snlo-helper/lnbVsAgs-example.py
+14
-44
14 additions, 44 deletions
snlo-helper/lnbVsAgs-example.py
snlo-helper/snlohelper.py
+217
-200
217 additions, 200 deletions
snlo-helper/snlohelper.py
with
246 additions
and
244 deletions
README.md
+
15
−
0
View file @
ddffa5d7
...
...
@@ -4,3 +4,18 @@ Utilises SNLO software for simulation of nonlinear processes in crystals.
An autoclicker clicks different buttons/fills fields in order to automate SNLO simulations.
Beware, that the script does its work with your mouse and keyboard, so you should not interact with the computer in the meanwhile.
The autoclicker can be interrupted by moving the mouse into the top right corner of the screen.
## Installation
Install all the requirements in requirements.txt, for example with pip via
`pip install -r requirements.txt`
(in this folder).
## Usage
-
You can execute
`snlohelper.py`
in a console, which imports all the methods and sets the screen resolution factor.
-
Alternatively, you can import methods from
`snlohelper`
. In this case you have to set the screen resolution with
`set_screenfactors()`
yourself.
Use the methods as conventient.
This diff is collapsed.
Click to expand it.
snlo-helper/lnbVsAgs.py
→
snlo-helper/lnbVsAgs
-example
.py
+
14
−
44
View file @
ddffa5d7
...
...
@@ -5,25 +5,29 @@ Created on Thu May 25 13:01:56 2023
@author: moneke
"""
# %% imports
from
time
import
perf_counter
# %% import modules
import
numpy
as
np
import
matplotlib
as
plt
from
snlohelper
import
*
from
snlohelper
import
*
# noqa
from
snlohelper
import
set_screenfactors
,
TwoDMixLP
# %% Setup
# %% Setup
screenfactor and simulation model
set_screenfactors
()
sim
=
TwoDMixLP
()
sim
.
open
()
start
=
sim
.
get_configuration
()
start
=
sim
.
get_configuration
()
# store the start configuration
# %% runt the simulation
"""
Calculate the output pulse energy for different crystal loss values.
"""
# %%%
# Parameters
absorption
=
np
.
linspace
(
0
,
41e-1
,
30
)
...
...
@@ -35,47 +39,13 @@ for a in absorption:
results
.
append
(
r
[
'
Output pulse energy (mJ)
'
][
0
])
print
(
a
,
results
[
-
1
])
# %% Test
interval
=
0
#.5
s0
=
perf_counter
()
gui
.
click
(
*
scale
(
133
,
293
))
gui
.
hotkey
(
"
ctrl
"
,
"
home
"
)
gui
.
hotkey
(
"
ctrl
"
,
"
shiftleft
"
,
"
shiftright
"
,
"
end
"
)
# gui.hotkey('ctrl', 'c')
print
(
perf_counter
()
-
s0
)
s0
=
perf_counter
()
gui
.
rightClick
(
*
scale
(
133
,
293
))
gui
.
press
(
6
*
[
'
down
'
])
gui
.
press
(
'
enter
'
)
# gui.hotkey('ctrl', 'c')
print
(
perf_counter
()
-
s0
)
# %%
with
gui
.
hold
(
"
shift
"
,
interval
=
interval
):
with
gui
.
hold
(
"
ctrl
"
,
interval
=
interval
):
gui
.
press
(
"
end
"
,
interval
=
interval
)
#
#%%
gui
.
hotkey
(
"
shift
"
,
"
a
"
)
print
(
results
)
# %%
results
=
[]
#%%
sim
.
open
()
...
...
@@ -92,7 +62,7 @@ for v in pe:
results
.
append
(
sim
.
configure_run_read
({
'
Energy/power (J or W)
'
:
[
None
,
None
,
v
]})[
'
Output pulse energy (mJ)
'
])
# %%
# %%
Plot
plt
.
figure
()
ax
=
plt
.
gca
()
...
...
This diff is collapsed.
Click to expand it.
snlo-helper/snlohelper.py
+
217
−
200
View file @
ddffa5d7
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment