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