Commit 356992aa authored by Yannick Lecoeuche's avatar Yannick Lecoeuche
Browse files

Finalizing err_tran merge

parent 141fea6b
......@@ -69,7 +69,7 @@ def find_saturations(event):
newtime_idx = max(np.nonzero(t <= refined_gps)[0])
sat_idxs = np.nonzero(abs(buf.data[:newtime_idx]) >= saturation_threshold)[0]
if len(sat_idxs) > 0:
saturations.append([channel_name, t[min(sat_idxs)], t, reduced_dataset])
saturations.append([channel_name, t[min(sat_idxs)], t, buf.data])
if not saturations:
logging.info("No saturated suspension channels.")
......@@ -183,7 +183,7 @@ def set_ylims(refined_gps, saturations):
ymins = []
for sat in saturations:
t, y = sat[2], sat[3]
scaling_times = np.where(t < refined_gps-5)[0]
scaling_times = np.where(t < refined_gps-5)[0]
scaling_vals = y[scaling_times]
ymins.append(min(scaling_vals))
ymaxs.append(max(scaling_vals))
......@@ -198,9 +198,9 @@ def set_ylims(refined_gps, saturations):
ymin = 0.9*min(ymins)
if ymin > -config.SATURATION_THRESHOLD:
ymin = -config.SATURATION_THRESHOLD - 10000
if ymax < config.SATURATION_THRESHOLD:
ymax = config.SATURATION_THRESHOLD + 10000
ymin = -config.SATURATION_THRESHOLD - 10000
if ymax < config.SATURATION_THRESHOLD:
ymax = config.SATURATION_THRESHOLD + 10000
ymin = float(ymin)/config.SATURATION_THRESHOLD
ymax = float(ymax)/config.SATURATION_THRESHOLD
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment