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

Analog board saturations tag/plot

Checks set of analog board monitors for voltages exceeding +/-9.5 V
around the time of lockloss, and creates a tag/plot if it
does. Similar to the BRS plot, this one (by commissioner suggestion)
does not show up on the website if there is no tag. Channels names
have been verified at LLO, they should also have a 10V limit on their
boards.

Closes #59
parent b7faf06f
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,7 @@ TAG_COLORS = {
'OBSERVE': ('black', 'lime'),
'REFINED': ('white', 'grey'),
'BRS_GLITCH': ('rebeccapurple', 'lavender'),
'BOARD_SAT': ('navy', 'cornflowerblue'),
'WINDY': ('springgreen', 'mediumblue'),
'SEISMIC': ('orange', 'black'),
}
......@@ -192,6 +193,22 @@ BRS_THRESH = 15
BRS_SEARCH_WINDOW = [-30, 5]
ANALOG_BOARD_CHANNELS = [
'IMC-REFL_SERVO_SPLITMON',
'IMC-REFL_SERVO_FASTMON',
'IMC-REFL_SERVO_SUMMON',
'LSC-REFL_SERVO_SUMMON',
'LSC-REFL_SERVO_SPLITMON',
'LSC-REFL_SERVO_FASTMON',
'LSC-REFL_SERVO_SLOWFBMON',
'LSC-REFL_SERVO_SLOWMON',
]
ANALOG_BOARD_CHANNELS = ['%s:%s' % (IFO, chan) for chan in ANALOG_BOARD_CHANNELS]
BOARD_SEARCH_WINDOW = [-30, 5]
BOARD_SAT_THRESH = 9.5
# This corresponds to a change from 18 to 20-bit DAC for ETMX L3 channels.
# ETMX L3 channels after this date have counts that are four times higher
ETMX_L3_CHANGE_DATE = 1224961218
......@@ -204,6 +221,7 @@ LPY_CHANNELS = [
]
LPY_CHANNELS = ['%s:%s' % (IFO, chan) for chan in LPY_CHANNELS]
BOARD_SAT_CM = ['mediumseagreen', 'cornflowerblue', 'mediumvioletred', 'orangered', 'darkolivegreen', 'goldenrod', 'teal', 'lightcoral']
SATURATION_CM = ['#332288', '#88CCEE', '#117733', '#999933', '#DDCC77', '#CC6677', '#882255', '#AA4499']
SC_CM = ['#e6194b', '#3cb44b', '#4363d8', '#f58231', '#911eb4', '#46f0f0', '#f032e6', '#bcf60c', '#008080']
......
......@@ -40,6 +40,9 @@ add_follow(find_overflows)
from .brs import check_brs
add_follow(check_brs)
from .board_sat import check_boards
add_follow(check_boards)
from .wind import check_wind
add_follow(check_wind)
......
import os
import logging
import numpy as np
import matplotlib.pyplot as plt
from gwpy.segments import Segment
from ..event import LocklossEvent
from .. import config
from .. import data
##############################################
def check_boards(event):
""" Checks for analog board saturations.
Checks analog board channels for voltages above threshold and creates a
tag/table if above a certain threshold.
"""
# set plot metaparams
plt.rcParams['font.size'] = 30.0
plt.rcParams['axes.titlesize'] = 30.0
plt.rcParams['xtick.labelsize'] = 30.0
plt.rcParams['ytick.labelsize'] = 30.0
plt.rcParams['legend.fontsize'] = 30.0
plt.rcParams['agg.path.chunksize'] = 1000
mod_window = [config.BOARD_SEARCH_WINDOW[0], config.BOARD_SEARCH_WINDOW[1]]
segment = Segment(mod_window).shift(int(event.gps))
board_channels = data.fetch(config.ANALOG_BOARD_CHANNELS, segment)
saturating = False
sat_channels = []
for buf in board_channels:
srate = buf.sample_rate
t = np.arange(segment[0], segment[1], 1/srate)
before_loss = buf.data[np.where(t<event.gps)]
if any(abs(before_loss) >= config.BOARD_SAT_THRESH):
saturating = True
sat_channels.append(buf)
if not saturating:
logging.info("no saturating analog boards")
return
event.add_tag('BOARD_SAT')
fig, ax = plt.subplots(1, figsize=(22,16))
for idx, buf in enumerate(sat_channels):
srate = buf.sample_rate
t = np.arange(segment[0], segment[1], 1/srate)
ax.plot(
t-event.gps,
buf.data,
label=buf.channel,
alpha=0.8,
lw=2,
color=config.BOARD_SAT_CM[idx],
)
ax.axhline(
config.BOARD_SAT_THRESH,
linestyle='--',
color='black',
label='Board saturation threshold',
lw=5,
)
ax.axhline(
-config.BOARD_SAT_THRESH,
linestyle='--',
color='black',
lw=5,
)
ax.grid()
ax.set_xlabel('Time [s] since lock loss at {}'.format(event.gps), labelpad=10)
ax.set_ylabel('Voltage [V]')
ax.set_ylim(-config.BOARD_SAT_THRESH-1, config.BOARD_SAT_THRESH+1)
ax.set_xlim(t[0]-event.gps, t[-1]-event.gps)
ax.legend(loc='best')
ax.set_title('Analog board monitors')
fig.tight_layout(pad=0.05)
outfile_plot = 'board_sat.png'
outpath_plot = os.path.join(event.path, outfile_plot)
fig.savefig(outpath_plot, bbox_inches='tight')
......@@ -108,6 +108,18 @@
</div>
% end
<!-- analog board saturation plot -->
% if event.has_tag('BOARD_SAT'):
<hr />
<div class="container">
<br />
<div class="row">
% board_plot = [event.gen_url('board_sat.png')]
% include('collapsed_plots.tpl', title ='Analog board saturation plots', id='board_sat', plots=board_plot, size=5)
</div>
</div>
% end
<!-- environment plot -->
<hr />
<div class="container">
......
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