added warning if Ks are not all close to each other
This commit is contained in:
@ -147,6 +147,15 @@ class Undulators(Adjustable):
|
||||
a = self.adjs[und_name_cal]
|
||||
k = a.get_current_value()
|
||||
energy = self.K_to_eV(k)
|
||||
|
||||
all_ks = [a.get_current_value() for a in self.adjs.values()]
|
||||
checks = np.isclose(all_ks, k, rtol=0, atol=0.001)
|
||||
if not all(checks):
|
||||
print("Warning: Ks are not all close:")
|
||||
for name, k, chk in zip(self.adjs.keys(), all_ks, checks):
|
||||
if not chk:
|
||||
print(name, k)
|
||||
|
||||
return float(energy) * 1000 # keV -> eV
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user