Newer
Older
@checklist.add_check(depends=['detectorTemp'], affects_calibration=True, hides=['missing_data_flag_check'], description='detector temperature too high')
return f(x) = { 0 x < 80
exp(x-90) 80<x<90
1 x > 90
}
softmax = np.exp((frame['detectorTemp'] - 90)/5)
return (((frame['detectorTemp'] > 80) & (frame['detectorTemp'] <= 90)) * softmax + (frame['detectorTemp'] > 90)*1).fillna(1.0)
@checklist.add_check(depends=['HBBapexTemp','HBBbottomTemp','HBBtopTemp'], affects_calibration=True, description='HBB thermistors outside range')
def hbb_thermistor_check(frame, parameters):
@checklist.add_check(depends=['ABBapexTemp','ABBbottomTemp','ABBtopTemp'], affects_calibration=True, description='ABB thermistors outside range')
def abb_thermistor_check(frame, parameters):
return thermistor_check(frame, 'ABB', 150, 335)
@checklist.add_check(depends=['datetime', 'HBBbottomTemp','HBBtopTemp','HBBapexTemp'], affects_calibration=True, description='HBB temperature is changing too quickly')
def hbb_stable_check(frame, parameters):
interval_seconds = frame['datetime'].diff().astype(np.int64) / 1e9
hbbb_diff = frame['HBBbottomTemp'].diff() / interval_seconds
hbba_diff = frame['HBBapexTemp'].diff() / interval_seconds
hbbt_diff = frame['HBBtopTemp'].diff() / interval_seconds
hsr = parameters.get('hbb_stable_rate', .002)
hbbb_diff_problem = abs(hbbb_diff.fillna(0)) > hsr
hbba_diff_problem = abs(hbba_diff.fillna(0)) > hsr
hbbt_diff_problem = abs(hbbt_diff.fillna(0)) > hsr
return (hbbb_diff_problem | hbbt_diff_problem | hbbt_diff_problem)
bbb_too_low = frame['{}bottomTemp'.format(bb)] < low
bba_too_low = frame['{}apexTemp'.format(bb)] < low
bbt_too_low = frame['{}topTemp'.format(bb)] < low
bbb_too_high = frame['{}bottomTemp'.format(bb)] > high
bba_too_high = frame['{}apexTemp'.format(bb)] > high
bbt_too_high = frame['{}topTemp'.format(bb)] > high
bbb_problem = bbb_too_low | bbb_too_high
bba_problem = bba_too_low | bba_too_high
bbt_problem = bbt_too_low | bbt_too_high