diff --git a/devices/undulator.py b/devices/undulator.py index c44ba45..c85a655 100644 --- a/devices/undulator.py +++ b/devices/undulator.py @@ -15,7 +15,7 @@ N_UND_CHIC = 14 class Undulators(Adjustable): - def __init__(self, n_unds, n_und_ref, 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, adjust_chic=True, 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) @@ -34,6 +34,7 @@ class Undulators(Adjustable): self.adjs = {name: Undulator(name) for name in und_names} self.chic = CHIC(chic_fudge_offset, name, units) + self.adjust_chic = adjust_chic self.scaled = scaled self.convert = ConverterEK() @@ -73,9 +74,10 @@ class Undulators(Adjustable): t = a.set_target_value(k_new, hold=False) tasks.append(t) wait_for_all(tasks) - print("CHIC adjustment follows") - self.chic.set_target_value(value, hold=False).wait() #TODO: test whether an additional sleep is needed - print("CHIC adjustment done") + if self.adjust_chic: + print("CHIC adjustment follows") + self.chic.set_target_value(value, hold=False).wait() #TODO: test whether an additional sleep is needed + print("CHIC adjustment done") return self._as_task(change, hold=hold)