From 35f4b9acad7e6c9f1dc08400d7ce4a0f392f590d Mon Sep 17 00:00:00 2001
From: Camilla Compton <camilla.compton@ligo.org>
Date: Tue, 19 May 2020 16:31:13 -0700
Subject: [PATCH] add thresh=lower_t if no threshold crossings found for
 clearer graphs

---
 locklost/plugins/refine.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/locklost/plugins/refine.py b/locklost/plugins/refine.py
index cdf9263d..e3dc46c7 100644
--- a/locklost/plugins/refine.py
+++ b/locklost/plugins/refine.py
@@ -69,7 +69,7 @@ def plot_indicators(event, channel, refined_gps, threshold):
                 "threshold",
                 xy=(ax1.get_xlim()[0], threshold),
                 xycoords='data',
-                xytext=(8, -10),
+                xytext=(8, -15),
                 textcoords='offset points',
                 horizontalalignment='left',
                 verticalalignment='top',
@@ -154,7 +154,6 @@ def find_transition(channel, segment, std_threshold, minimum=None):
 
     """
     refined_gps = None
-    threshold = None
     buf = data.fetch(channel, segment)[0]
 
     # calculate mean and std using first 5 seconds of window
@@ -191,6 +190,7 @@ 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")
 
     return threshold, refined_gps
-- 
GitLab