Skip to content
Snippets Groups Projects
Commit 2a7be5c3 authored by Alex Diebold's avatar Alex Diebold
Browse files

Improved tests

parent 4031cb5e
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,10 @@ def abb_temp_outlier_check(frame, parameters):
def bst_temp_outlier_check(frame, parameters):
return find_bb_outliers(frame, parameters, 'BST')
@checklist.add_check(depends=['datetime', 'airNearInterferometerTemp'], affects_calibration=True, hides=['missing_data_flag_check'], description='outlier in the air near the interferometer discovered')
def air_interferometer_outlier_check(frame, parameters):
return find_bb_outliers(frame, parameters, 'inter')
###### UTILTIY #############
......@@ -31,11 +35,16 @@ def find_bb_outliers(frame, parameters, bb):
elif bb == 'ABB':
delta_thresh = .01
elif bb == 'BST':
delta_thresh = .01
delta_thresh = 1
elif bb == 'inter':
delta_thresh = .5
if bb == 'BST':
bbs_outliers = np.array(list(_scan_for_outliers(frame, 'BBsupportStructureTemp', delta_thresh)))
return ( bbs_outliers)
elif bb == 'inter':
inter_outliers = np.array(list(_scan_for_outliers(frame, 'airNearInterferometerTemp', delta_thresh)))
return ( inter_outliers)
else:
bbb_outliers = np.array(list(_scan_for_outliers(frame, '{}bottomTemp'.format(bb), delta_thresh)))
bba_outliers = np.array(list(_scan_for_outliers(frame, '{}apexTemp'.format(bb), delta_thresh)))
......
......@@ -19,7 +19,7 @@ def hbb_covariance_check(frame, parameters):
distances = envelope.mahalanobis(frame[['HBBbottomTemp','HBBtopTemp','HBBapexTemp']]) ** .5
return (distances > 10) * 1
@checklist.add_check(depends=['SCEtemp', 'Time', 'airNearBBsTemp', 'BBsupportStructureTemp'], affects_calibration=True, description='absolute deviation of temperature too high')
@checklist.add_check(depends=['SCEtemp', 'Time', 'dateYYMMDD', 'airNearBBsTemp', 'BBsupportStructureTemp'], affects_calibration=True, description='absolute deviation of temperature too high')
def sce_temp_deviation_check(frame, parameters):
temps = frame['SCEtemp'].copy()
temps_to_avg = []
......@@ -30,7 +30,10 @@ def sce_temp_deviation_check(frame, parameters):
upper_bound -= 1
while(np.isnan(frame['Time'][lower_bound])):
lower_bound += 1
rolling_number = int(len(frame['Time'])/(frame['Time'][upper_bound] - frame['Time'][lower_bound]))
time_difference = frame['Time'][upper_bound] - frame['Time'][lower_bound]
if frame['dateYYMMDD'][upper_bound] != frame['dateYYMMDD'][lower_bound]:
time_difference += 24
rolling_number = int(len(frame['Time'])/time_difference)
for x, temp in temps.iteritems():
if len(temps_to_avg) < rolling_number:
temps_to_avg.append(temp)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment