renamed n_und_cal -> n_und_ref
This commit is contained in:
@ -15,21 +15,21 @@ N_UND_CHIC = 14
|
||||
|
||||
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)
|
||||
|
||||
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:
|
||||
raise ValueError(f"the reference undulator ({n_und_cal}) is not in the list of active undulators: {n_unds}")
|
||||
if n_und_ref not in 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:
|
||||
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)
|
||||
|
||||
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.chic = CHIC(chic_fudge_offset, name, units)
|
||||
|
Reference in New Issue
Block a user