[bugfix] too many under 1V warnings appearing, moved them to "other"

This commit is contained in:
Marcel Paffrath 2022-11-09 09:49:27 +01:00
parent 6791a729ed
commit 18dac062ef

View File

@ -589,13 +589,12 @@ class StationQC(object):
if len(under) > 0:
# try calculate number of occurences from gaps between indices
n_occurrences = len(np.where(np.diff(under) > 1)[0]) + 1
for key in warn_keys:
self.warn(key=key,
self.warn(key='other',
detailed_message=f'Trace {trace.get_id()}: '
f'Voltage below {pb_ok}V in {len(under)} samples, {n_occurrences} time(s). '
f'Mean voltage: {np.mean(voltage):.2}'
+ self.get_last_occurrence_timestring(trace, under),
status_message='WARN ({})'.format(n_occurrences))
status_message='under 1V ({})'.format(n_occurrences))
# Get voltage levels for classification
voltage_dict = {}