renamed n_und_cal -> n_und_ref
This commit is contained in:
@ -15,21 +15,21 @@ N_UND_CHIC = 14
|
|||||||
|
|
||||||
class Undulators(Adjustable):
|
class Undulators(Adjustable):
|
||||||
|
|
||||||
def __init__(self, n_unds, n_und_cal, chic_fudge_offset=0, scaled=True, ID="ATHOS_UNDULATORS", name="Athos Undulators", units="eV"):
|
def __init__(self, n_unds, n_und_ref, chic_fudge_offset=0, scaled=True, ID="ATHOS_UNDULATORS", name="Athos Undulators", units="eV"):
|
||||||
super().__init__(ID, name=name, units=units)
|
super().__init__(ID, name=name, units=units)
|
||||||
|
|
||||||
self.n_unds = n_unds = list(n_unds)
|
self.n_unds = n_unds = list(n_unds)
|
||||||
self.n_und_cal = n_und_cal
|
self.n_und_ref = n_und_ref
|
||||||
|
|
||||||
if n_und_cal not in n_unds:
|
if n_und_ref not in n_unds:
|
||||||
raise ValueError(f"the reference undulator ({n_und_cal}) is not in the list of active undulators: {n_unds}")
|
raise ValueError(f"the reference undulator ({n_und_ref}) is not in the list of active undulators: {n_unds}")
|
||||||
|
|
||||||
if N_UND_CHIC in n_unds:
|
if N_UND_CHIC in n_unds:
|
||||||
log.warning(f"the CHIC ({N_UND_CHIC}) is in the list of active undulators: {n_unds}, and will be ignored/removed")
|
log.warning(f"the CHIC ({N_UND_CHIC}) is in the list of active undulators: {n_unds}, and will be ignored/removed")
|
||||||
n_unds.remove(N_UND_CHIC)
|
n_unds.remove(N_UND_CHIC)
|
||||||
|
|
||||||
self.und_names = und_names = [UND_NAME_FMT.format(n) for n in n_unds]
|
self.und_names = und_names = [UND_NAME_FMT.format(n) for n in n_unds]
|
||||||
self.und_name_cal = und_name_cal = UND_NAME_FMT.format(n_und_cal)
|
self.und_name_cal = und_name_cal = UND_NAME_FMT.format(n_und_ref)
|
||||||
|
|
||||||
self.adjs = {name: Undulator(name) for name in und_names}
|
self.adjs = {name: Undulator(name) for name in und_names}
|
||||||
self.chic = CHIC(chic_fudge_offset, name, units)
|
self.chic = CHIC(chic_fudge_offset, name, units)
|
||||||
|
@ -33,13 +33,13 @@ source_x = Motor("SATES20-MANIP1:MOTOR_2", name="Source manipulator x")
|
|||||||
|
|
||||||
att = Attenuator("SATFE10-OATT064")
|
att = Attenuator("SATFE10-OATT064")
|
||||||
|
|
||||||
n_und_cal = 6
|
n_und_ref = 6
|
||||||
n_unds = [
|
n_unds = [
|
||||||
6, 7, 8, 9, 10, 11, 12, 13, # 14 is the CHIC
|
6, 7, 8, 9, 10, 11, 12, 13, # 14 is the CHIC
|
||||||
15, 16, 17, 18, 19, 20, 21, 22
|
15, 16, 17, 18, 19, 20, 21, 22
|
||||||
]
|
]
|
||||||
chic_fudge_offset = 0
|
chic_fudge_offset = 0
|
||||||
und = Undulators(n_unds, n_und_cal, chic_fudge_offset, name="z Athos Undulators")
|
und = Undulators(n_unds, n_und_ref, chic_fudge_offset, name="z Athos Undulators")
|
||||||
|
|
||||||
xota_z_trans = Motor("SATES21-XOTA166:W_Z", name="Table 1: Z coordinated")
|
xota_z_trans = Motor("SATES21-XOTA166:W_Z", name="Table 1: Z coordinated")
|
||||||
#xota_hori_z = Motor("SATES21-XOTA166:MOTOR_Z", name="Table 1: Z raw")
|
#xota_hori_z = Motor("SATES21-XOTA166:MOTOR_Z", name="Table 1: Z raw")
|
||||||
|
Reference in New Issue
Block a user