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
@@ -67,11 +67,11 @@ def plot_indicators(event, channel, refined_gps, threshold):
)
ax1.annotate(
"threshold",
xy=(ax1.get_xlim()[0], threshold),
xy=(ax1.get_xlim()[-1], threshold),
xycoords='data',
xytext=(8, -15),
xytext=(8, -10),
textcoords='offset points',
horizontalalignment='left',
horizontalalignment='right',
verticalalignment='top',
bbox=dict(
boxstyle="round", fc="w", ec="green", alpha=0.95),
@@ -153,6 +153,7 @@ def find_transition(channel, segment, std_threshold, minimum=None):
returns `threshold`, `refined_gps` tuple
"""
threshold = None
refined_gps = None
buf = data.fetch(channel, segment)[0]
@@ -190,9 +191,10 @@ 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 for graphs if no crossing found
threshold = lower_threshold if threshold is None else threshold
return threshold, refined_gps
Loading