Commit 67a8ac8f authored by augustin_s's avatar augustin_s 🐍
Browse files

added undulator no. 6; added a missing self; commented warning print; adjusted accuracy

parent cc625b35
......@@ -9,7 +9,7 @@ from slic.core.scanner.scanbackend import wait_for_all #, stop_all
# 14 is the CHIC
n_unds = [
7, 8, 9, 10, 11, 12, 13,
6, 7, 8, 9, 10, 11, 12, 13,
15, 16, 17, 18, 19, 20, 21, 22
]
......@@ -21,7 +21,7 @@ und_name_cal = "SATUN12-UIND030"
class Undulators(Adjustable):
def __init__(self, scaled=True):
super().__init__(name="Athos Undulators", units="eV")
super().__init__(name="z Athos Undulators", units="eV")
self.adjs = {name: Undulator(name) for name in und_names}
self.scaled = scaled
......@@ -41,7 +41,7 @@ class Undulators(Adjustable):
ks_current = [a.get_current_value(readback=False) for a in self.adjs.values()]
if scaled:
if self.scaled:
header = "scaled: "
ks_target = self.scale.K(value, ks_current)
else:
......@@ -74,11 +74,11 @@ class Undulators(Adjustable):
all_ks = [a.get_current_value() for a in self.adjs.values()]
checks = np.isclose(all_ks, k, rtol=0, atol=0.001)
if not all(checks):
print(f"Warning: Ks are not all close to {k}:")
for name, k, chk in zip(self.adjs.keys(), all_ks, checks):
if not chk:
print(name, k)
# if not all(checks):
# print(f"Warning: Ks are not all close to {k}:")
# for name, k, chk in zip(self.adjs.keys(), all_ks, checks):
# if not chk:
# print(name, k)
return energy
......@@ -90,7 +90,7 @@ class Undulators(Adjustable):
class Undulator(PVAdjustable):
def __init__(self, name, accuracy=0.00001):
def __init__(self, name, accuracy=0.0001):
pvname_setvalue = name + ":K_SET"
pvname_readback = name + ":K_READ"
super().__init__(pvname_setvalue, pvname_readback=pvname_readback, accuracy=accuracy, active_move=True, name=name)
......
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