Script execution

This commit is contained in:
x10daop
2017-02-07 16:31:31 +01:00
parent 2cf9048a35
commit 344fb964fb

View File

@@ -14,14 +14,12 @@ ref = CrlogicSensor("ScalerRef", "SCALER15", True)
class AbsCalc(Readable):
def read(self):
d = math.fabs(i1.take())
return float('NaN') if (d==0) else math.log(math.fabs(i0.take()) /d)
return math.log(math.fabs(i0.take()) / math.fabs(i1.take()))
abs_calc = AbsCalc()
class ECalc(Readable):
def read(self):
d = crystal.take() * math.sin( math.radians(bragg.readback.take()))
return float('NaN') if (d==0) else (12.39842 / d)
return 12.39842 / (crystal.take() * math.sin( math.radians(bragg.readback.take())))
e_calc = ECalc()
sensors = [RegisterCache(crystal), i0, i1, i2, ref, abs_calc, e_calc]