Skip to content
Snippets Groups Projects

Draft: WIP Positive/negative standard deviation refinement

Open Camilla Compton requested to merge camilla.compton/locklost:pos_neg_std into master
1 unresolved thread
import logging
import numpy as np
import matplotlib.pyplot as plt
from collections import defaultdict
from gwpy.segments import Segment
@@ -27,6 +28,11 @@ def plot_indicators(event, channel, refined_gps, threshold):
y_grd, t_grd = bufs[0].yt()
y_ind, t_ind = bufs[1].yt()
# calculate mean using first 5 seconds of y_ind data
samples = int(bufs[1].sample_rate * 5)
locked_sample = y_ind[:samples]
locked_mean = np.mean(locked_sample)
plt.rcParams['text.usetex'] = False
isc_loss_time = event.transition_gps - t0
@@ -65,7 +71,7 @@ def plot_indicators(event, channel, refined_gps, threshold):
linestyle='--',
linewidth=2,
)
if y_ind[0] < threshold:
if locked_mean < threshold:
xyoffset = (8, 10)
valign = 'bottom'
else:
Loading