Commit e43d7ceb authored by Daniel Brown's avatar Daniel Brown

knm calcluation now takes in direction argument. parakat returns exception...

knm calcluation now takes in direction argument. parakat returns exception rather than failing the whole job now
parent 53a60241
......@@ -578,7 +578,7 @@ def square_aperture_HG_knm(mode_in, mode_out, q, R):
def knmHG(couplings, q1, q2, surface_map=None, q1y=None, q2y=None, method="riemann",
def knmHG(couplings, q1, q2, surface_map=None, q1y=None, q2y=None, direction='reflection_front', method="riemann",
verbose=False, profile=False, gamma=(0,0), delta=(0,0), cache=True, **kwargs):
"""
Computes a mode scattering matrix for various defects:
......@@ -675,7 +675,7 @@ def knmHG(couplings, q1, q2, surface_map=None, q1y=None, q2y=None, method="riema
__fac_cache.append(math.factorial(n))
if surface_map is not None:
Axy = surface_map.z_xy(wavelength=q1.wavelength)
Axy = surface_map.z_xy(wavelength=q1.wavelength, direction=direction)
x = surface_map.x
y = surface_map.y
......
......@@ -44,10 +44,12 @@ def _run(commands, pwd, **kwargs):
import pykat
kat = pykat.finesse.kat()
kat.parseCommands(commands)
out = kat.run(rethrowExceptions=True, **kwargs)
kat.parse(commands)
return out
try:
return kat.run(rethrowExceptions=True, **kwargs)
except Exception as ex:
return ex
class parakat(object):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment