Skip to content
Snippets Groups Projects
Commit a60cba9d authored by Anna Green's avatar Anna Green
Browse files

adding relative (xaxis*) option to scan_optics

parent 4824a81c
No related branches found
No related tags found
No related merge requests found
Pipeline #
...@@ -264,7 +264,7 @@ def BS_optical_path(thickness, n=nsilica, angle=45.0): ...@@ -264,7 +264,7 @@ def BS_optical_path(thickness, n=nsilica, angle=45.0):
return math.degrees(angle_subst), L return math.degrees(angle_subst), L
def scan_optics(_kat, _optics, _factors, xlimits=[-100, 100], steps=200): def scan_optics(_kat, _optics, _factors, xlimits=[-100, 100], steps=200,relative=False):
""" """
Scans one or more optics (by changing its tuning). Scans one or more optics (by changing its tuning).
Parameters: Parameters:
...@@ -285,9 +285,14 @@ def scan_optics(_kat, _optics, _factors, xlimits=[-100, 100], steps=200): ...@@ -285,9 +285,14 @@ def scan_optics(_kat, _optics, _factors, xlimits=[-100, 100], steps=200):
if factors[0]!=1.0: if factors[0]!=1.0:
raise pkex.BasePyKatException("First element in `factors' must be 1.0") raise pkex.BasePyKatException("First element in `factors' must be 1.0")
if relative == False:
kat.parseCommands(""" kat.parseCommands("""
xaxis {0} phi lin {1} {2} {3} xaxis {0} phi lin {1} {2} {3}
""".format(optics[0], xlimits[0], xlimits[1], steps)) """.format(optics[0], xlimits[0], xlimits[1], steps))
elif relative == True:
kat.parseCommands("""
xaxis* {0} phi lin {1} {2} {3}
""".format(optics[0], xlimits[0], xlimits[1], steps))
idx=1 idx=1
for o in optics[1:]: for o in optics[1:]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment