Skip to content
Snippets Groups Projects
Unverified Commit c2dc33c5 authored by Benedikt Burger's avatar Benedikt Burger Committed by GitHub
Browse files

Merge pull request #4 from NoahDornhecker/main

Added support for 2D-cav-LP
parents bb5ecd5f cdf79d64
No related branches found
No related tags found
No related merge requests found
......@@ -21,6 +21,7 @@ Currently it supports the following functions (feel free to add more):
- 2D-mix-LP
- 2D-mix-SP
- PW-OPO-BB
- 2D-cav-LP
- Focus
......
......@@ -35,6 +35,7 @@ from .two_d_mix_lp import TwoDMixLP
from .two_d_mix_sp import TwoDMixSP
from .q_mix import QMix
from .pw_opo_bb import PW_OPO_BB
from .two_d_cav_lp import TwoDCavLP
function_classes = {
......@@ -43,6 +44,7 @@ function_classes = {
Functions.TWOD_MIX_LP: TwoDMixLP,
Functions.TWOD_MIX_SP: TwoDMixSP,
Functions.PW_OPO_BB: PW_OPO_BB,
Functions.TWOD_CAV_LP: TwoDCavLP,
Functions.FOCUS: Focus,
}
......@@ -73,7 +75,7 @@ class MainWindow:
def open_refractive_index(self) -> RefractiveIndex:
return self._open_function(RefractiveIndex)
def open_q_mix(self) -> QMix:
return self._open_function(QMix)
......@@ -82,9 +84,12 @@ class MainWindow:
def open_two_d_mix_sp(self) -> TwoDMixSP:
return self._open_function(TwoDMixSP)
def open_pw_opo_bb(self) -> PW_OPO_BB:
return self._open_function(PW_OPO_BB)
def open_two_d_cav_lp(self) -> TwoDCavLP:
return self._open_function(TwoDCavLP)
def open_focus(self) -> Focus:
return self._open_function(Focus)
# MIT License
# Copyright (c) 2024 Benedikt Burger
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
from .main_window import Functions
from .mix_methods import MixMethods
class TwoDCavLP(MixMethods):
"""The '2D-cav-LP' method."""
_function = Functions.TWOD_CAV_LP
_accept_pos = (480, 537)
_run_pos = (148, 275)
_result_pos = (148, 357)
_change_inputs_pos = (157, 310)
_close_pos = (480, 135)
_configuration_pos = {"Wavelengths (nm)": [(330, 151), (397, 151), (464, 151)],
"Indexes of refraction": [(330, 167), (397, 167), (464, 167)],
"Crystal left reflectivity": [(330, 183), (397, 183), (464, 183)],
"Crystal right reflectivity": [(330, 199), (397, 199), (464, 199)],
"Crystal loss (per mm)": [(330, 215), (397, 215), (464, 215)],
"Enrgy/Pwr left (J/W)": [(330, 231), (397, 231), (464, 231)],
"Enrgy/Pwr right (J/W)": [(330, 247), (397, 247)],
"Pulse duration (FWHM ns)": [(330, 263), (397, 263), (464, 263)],
"Pulse delay (ns)": [(330, 279), (397, 279)],
"Beam diameter (FWHM mm)": [(330, 295), (397, 295), (464, 295)],
"Supergaussian coefficient": [(330, 311), (397, 311), (464, 311)],
"Walk off angle (mard)": [(330, 327), (397, 327), (464, 327)],
"Beam offset (mm)": [(397, 343), (464, 343)],
"Beam radius of curv. (mm)": [(330, 359), (397, 359), (464, 359)],
"Left mirror reflectivity": [(330, 375), (397, 375), (464, 375)],
"Right mirror reflectivity": [(330, 391), (397, 391), (464, 391)],
"Phase L-C (radians)": [(330, 407), (397, 407), (464, 407)],
"Phase C-R (radians)": [(330, 423), (397, 423), (464, 423)],
"Phase R-L (radians)": [(330, 439), (397, 439), (464, 439)],
"Mirror roc L R (mm)": [(330, 463), (397, 463)],
"Dist. L-C C-R R-L (mm)": [(330, 479), (397, 479), (464, 479)],
"Grid numbers z x y": [(330, 495), (397, 495), (464, 495)],
"Crystal/grid sizes (mm)": [(330, 511), (397, 511), (464, 511)],
"Cavity type/inversion": [(330, 527), (397, 527)],
"Deff (pm/V)/delta k (1/mm)": [(330, 543), (397, 543)]}
def interpret_results(self, rows: list[str]) -> dict[str, float | list[float]]:
"""Interpret the results."""
return {
"Right input (W W -)": [float(i) for i in rows[0].split()[6:]],
"Left input (W W J)": [float(i) for i in rows[1].split()[6:]],
"Left output energy (J)": [float(i) for i in rows[2].split()[5:]],
"Right output energy (J)": [float(i) for i in rows[3].split()[5:]],
"So (W/sq cm)": float(rows[4].split()[4]),
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment