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
+ 13
4
@@ -65,14 +65,20 @@ def plot_indicators(event, channel, refined_gps, threshold):
linestyle='--',
linewidth=2,
)
if y_ind[0] < threshold:
xyoffset = (8, 10)
valign = 'bottom'
else:
xyoffset = (8, -10)
valign = 'top'
ax1.annotate(
"threshold",
xy=(ax1.get_xlim()[0], threshold),
xycoords='data',
xytext=(8, -15),
xytext=xyoffset,
textcoords='offset points',
horizontalalignment='left',
verticalalignment='top',
verticalalignment=valign,
bbox=dict(
boxstyle="round", fc="w", ec="green", alpha=0.95),
)
@@ -153,8 +159,8 @@ def find_transition(channel, segment, std_threshold, minimum=None):
returns `threshold`, `refined_gps` tuple
"""
refined_gps = None
threshold = None
refined_gps = None
buf = data.fetch(channel, segment)[0]
# calculate mean and std using first 5 seconds of window
@@ -191,9 +197,12 @@ def find_transition(channel, segment, std_threshold, minimum=None):
logging.info("threshold: {}".format(threshold))
logging.info("refined time: {}".format(refined_gps))
else:
threshold = lower_threshold # to be shown on graphs
logging.info("no threshold crossings, unable to resolve time")
# add a threshold to be diplayed on graphs if refinement failed
if threshold is None:
threshold = lower_threshold
return threshold, refined_gps
Loading