Commit cc625b35 authored by augustin_s's avatar augustin_s 🐍
Browse files

added switch between scaled Ks and same K for all

parent dca76822
......@@ -20,10 +20,12 @@ und_name_cal = "SATUN12-UIND030"
class Undulators(Adjustable):
def __init__(self):
def __init__(self, scaled=True):
super().__init__(name="Athos Undulators", units="eV")
self.adjs = {name: Undulator(name) for name in und_names}
self.scaled = scaled
self.convert = ConverterEK()
a = self.adjs[und_name_cal]
......@@ -39,13 +41,15 @@ class Undulators(Adjustable):
ks_current = [a.get_current_value(readback=False) for a in self.adjs.values()]
ks_target = self.scale.K(value, ks_current)
print("scaled: ", ks_target)
print()
if scaled:
header = "scaled: "
ks_target = self.scale.K(value, ks_current)
else:
header = "all equal:"
ks_target = k * np.ones_like(ks_current)
# ks_target = k * np.ones_like(ks_current)
# print("all equal:", ks_target)
# print()
print(header, ks_target)
print()
def change():
#TODO: replace by set_all_target_values_and_wait when print not needed anymore
......
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