Skip to content
Snippets Groups Projects
Commit c96d3286 authored by Yannick Lecoeuche's avatar Yannick Lecoeuche Committed by Jameson Rollins
Browse files

Correctly scaling ETMX L3 suspension channels

This makes a simple change on line 45 from an if to an elif. The saturation followup was ignoring the ETMX L3 channel check because the else statement only applied if the channel was not one of the 16-bit channels (introduced in a recent merge).

I also took the opportunity to make some changes consistent with PEP-8 styling.

Closes #109
parent ca228a17
No related branches found
No related tags found
No related merge requests found
......@@ -15,8 +15,10 @@ from .. import data
def find_saturations(event):
"""
Plots saturating suspension channels before lockloss.
Create plot/list of saturating suspension channels before lockloss
time (with corresponding gps times for saturations).
time (and returns corresponding gps times for saturations).
"""
saturation_threshold = config.SATURATION_THRESHOLD
......@@ -40,7 +42,7 @@ def find_saturations(event):
channel_name = str(buf.channel)
if gps > config.ETMX_L3_CHANGE_DATE and channel_name in high_thresh_channels:
reduced_data = buf.data/(4*saturation_threshold)
if channel_name in low_thresh_channels:
elif channel_name in low_thresh_channels:
reduced_data = (4*buf.data)/saturation_threshold
else:
reduced_data = buf.data/(saturation_threshold)
......@@ -99,7 +101,6 @@ def find_saturations(event):
wide_window = [first_sat - 40, segment[1] - gps]
else:
wide_window = [segment[0] - gps, segment[1] - gps]
#scaling_times = np.where(t < gps-5)[0]
windows = [wide_window, zoomed_window]
zoom_levels = ['WIDE', 'ZOOM']
xmaxs = [gps, first_sat+gps]
......@@ -140,7 +141,7 @@ def find_saturations(event):
horizontalalignment='center',
verticalalignment='bottom',
bbox=dict(boxstyle="round", fc="w", ec="black", alpha=0.95),
)
)
# draw lines on plot for saturation thresholds, lock loss time
ax.axhline(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment