3 from DCSCalculator2.lib
import DCSC_Subdetector, DCSC_Defect_Global_Variable
4 from DCSCalculator2.variable
import DefectIOV
5 from DQUtils
import process_iovs
6 from DQUtils.sugar
import IOVSet
13 Overloads calculate_good_iovs
20 return IOVSet(
list(atlsol_iovs) +
list(atltor_iovs))
23 measured_channel, desired_channel, tolerance):
25 measured_iovs = iovs.select_channels(measured_channel)
26 desired_iovs = iovs.select_channels(desired_channel)
30 for since, until, (measured, desired)
in events:
38 if measured
is not None:
40 if measured.value
is None:
42 elif measured.value <= tolerance:
44 defect = system +
'_OFF'
54 elif ((system ==
'GLOBAL_SOLENOID' and abs(measured.value - 7730.) < tolerance)
55 or (system ==
'GLOBAL_TOROID' and abs(measured.value - 20400.) < tolerance)):
60 defect = system +
'_RAMPING'
65 mcurrent =
'%.1f' % measured.value
if measured.value
is not None else 'None'
66 scurrent =
'%.1f' % desired.value
if desired.value
is not None else 'None'
67 yield DefectIOV(since, until, defect,
True,
68 comment=
'Measured current: %s, Set current: %s' % (mcurrent, scurrent))
73 folder_base =
'/EXT/DCS/MAGNETS'
82 def run(self, lbtime, run_iovs=None):
84 The magnets are very different to all other systems. There is no need
85 to run the usual processing, since the variables spit out iovs in one
88 self.evaluate_inputs(lbtime)
89 return self.variables[0].iovs