Skip to content
Snippets Groups Projects
Commit d93b7d46 authored by Timothy O'Hanlon's avatar Timothy O'Hanlon
Browse files

Merge branch '198_pi_blrms' into 'master'

Added alternate PI channels for LHO, and added ifo conditionals into config.py for PIs

See merge request jameson.rollins/locklost!145
parents 3d2a1ef0 cea3c2a2
No related branches found
No related tags found
No related merge requests found
Pipeline #694043 passed
......@@ -789,29 +789,34 @@ for key in LSC_ASC_CHANNELS:
##################################################
PI_CHANNELS = [
'OMC-BLRMS_32_BAND1_LOG10_OUTMON',
'OMC-BLRMS_32_BAND2_LOG10_OUTMON',
'OMC-BLRMS_32_BAND3_LOG10_OUTMON',
'OMC-BLRMS_32_BAND4_LOG10_OUTMON',
'OMC-BLRMS_32_BAND5_LOG10_OUTMON',
'OMC-BLRMS_32_BAND6_LOG10_OUTMON',
'OMC-BLRMS_32_BAND7_LOG10_OUTMON',
]
if IFO == 'H1':
PI_DICT = {
f'{IFO}:OMC-PI_DOWNCONV_DC2_SIG_OUT_DQ': '80.0 kHz (PI28, PI29)',
f'{IFO}:OMC-PI_DOWNCONV_DC6_SIG_OUT_DQ': '14.5 kHz (PI15, PI16)',
f'{IFO}:OMC-PI_DOWNCONV_DC7_SIG_OUT_DQ': '10.0 kHz (PI24, PI31)',
}
PI_SAT_THRESH = 5e-3
PI_YLABEL = 'Downconverted Signal [mA]' # BP, shift down, then LP
PI_YLIMS = [-1.5e-2, 1.5e-2]
PI_DICT = {
'{}:OMC-BLRMS_32_BAND1_LOG10_OUTMON'.format(IFO): '2.5 - 8 kHZ',
'{}:OMC-BLRMS_32_BAND2_LOG10_OUTMON'.format(IFO): '8 - 12 kHZ',
'{}:OMC-BLRMS_32_BAND3_LOG10_OUTMON'.format(IFO): '12 - 16 kHZ',
'{}:OMC-BLRMS_32_BAND4_LOG10_OUTMON'.format(IFO): '16 - 20 kHZ',
'{}:OMC-BLRMS_32_BAND5_LOG10_OUTMON'.format(IFO): '20 - 24 kHZ',
'{}:OMC-BLRMS_32_BAND6_LOG10_OUTMON'.format(IFO): '24 - 28 kHZ',
'{}:OMC-BLRMS_32_BAND7_LOG10_OUTMON'.format(IFO): '28 - 32 kHZ',
}
if IFO == 'L1':
PI_DICT = {
f'{IFO}:OMC-BLRMS_32_BAND1_LOG10_OUTMON': '2.5 - 8 kHz',
f'{IFO}:OMC-BLRMS_32_BAND2_LOG10_OUTMON': '8 - 12 kHz',
f'{IFO}:OMC-BLRMS_32_BAND3_LOG10_OUTMON': '12 - 16 kHz',
f'{IFO}:OMC-BLRMS_32_BAND4_LOG10_OUTMON': '16 - 20 kHz',
f'{IFO}:OMC-BLRMS_32_BAND5_LOG10_OUTMON': '20 - 24 kHz',
f'{IFO}:OMC-BLRMS_32_BAND6_LOG10_OUTMON': '24 - 28 kHz',
f'{IFO}:OMC-BLRMS_32_BAND7_LOG10_OUTMON': '28 - 32 kHz',
}
PI_SAT_THRESH = 0.5
PI_YLABEL = 'Band-Limited RMS [log]'
PI_YLIMS = [0, 1]
PI_CHANNELS = ifochans(PI_CHANNELS)
PI_CHANNELS = []
for chan in PI_DICT:
PI_CHANNELS.append(chan)
PI_SAT_THRESH = 0.5
PI_SEARCH_WINDOW = [-(8*60), 5]
##################################################
......
......@@ -12,7 +12,7 @@ from .. import plotutils
ASD_CHANNEL = [
'{}:OMC-PI_DCPD_64KHZ_AHF_DQ'.format(config.IFO)
f'{config.IFO}:OMC-PI_DCPD_64KHZ_AHF_DQ'
]
ASD_WINDOW = [-(8*60), 0]
......@@ -21,10 +21,11 @@ ASD_WINDOW = [-(8*60), 0]
def check_pi(event):
"""Checks BAND 1-7 log channels for pi.
"""Checks OMC downconverted signals 2, 6, 7 (H1) or
BAND 1-7 log channels (L1) for PIs.
Checks pi band goes above threshold and
creates a tag/table if above a certain threshold.
Checks if PI band goes above threshold and
adds tag if above a certain threshold.
"""
plotutils.set_rcparams()
......@@ -58,11 +59,13 @@ def check_pi(event):
saturating = True
if saturating:
# ADD H1 code here
if config.IFO == 'H1':
if event.transition_index[0] >= 600:
logger.info('PI found')
event.add_tag('PI_MONITOR')
if config.IFO == 'L1':
if event.transition_index[0] >= 1300:
logger.info('PI Tag not set up')
# event.add_tag('PI_MONITOR')
event.add_tag('PI_MONITOR')
else:
logger.info('no PI')
......@@ -75,48 +78,40 @@ def check_pi(event):
for idx, buf in enumerate(PI_channels):
srate = buf.sample_rate
t = np.arange(segment[0], segment[1], 1/srate)
ax1.plot(
t-event.gps,
buf.data,
label=buf.channel,
alpha=0.8,
lw=2,
# Plot all OMC PI channels on top two plots
for ax in [ax1, ax2]:
ax.plot(
t-event.gps,
buf.data,
label=f'{buf.channel[3:]}: {config.PI_DICT[buf.channel]}',
alpha=0.8,
lw=2,
)
# Configuring top two plots
for ax in [ax1, ax2]:
# Add dotted thresholds to the plots
ax.axhline(
config.PI_SAT_THRESH,
linestyle='--',
color='black',
label='PI threshold',
lw=5,
)
ax2.plot(
t-event.gps,
buf.data,
label=config.PI_DICT[buf.channel],
alpha=0.8,
lw=2,
ax.axhline(
-config.PI_SAT_THRESH,
linestyle='--',
color='black',
lw=5,
)
ax1.axhline(
config.PI_SAT_THRESH,
linestyle='--',
color='black',
label='PI threshold',
lw=5,
)
ax2.axhline(
config.PI_SAT_THRESH,
linestyle='--',
color='black',
label='PI threshold',
lw=5,
)
ax1.set_xlabel('Time [s] since lock loss at {}'.format(event.gps), labelpad=10)
ax2.set_xlabel('Time [s] since lock loss at {}'.format(event.gps), labelpad=10)
ax1.set_ylabel('Band-Limited RMS [log]')
ax2.set_ylabel('Band-Limited RMS [log]')
ax.set_xlabel(f'Time [s] since lock loss at {event.gps}', labelpad=10)
ax.set_ylabel(config.PI_YLABEL)
ax.set_ylim(config.PI_YLIMS[0], config.PI_YLIMS[1])
ax.legend(loc='best')
ax.set_title('PI BLRMS Monitors')
ax.grid()
ax1.set_xlim(t[0]-event.gps, t[-1]-event.gps)
ax2.set_xlim(-20, 5)
ax1.set_ylim(0, 1)
ax2.set_ylim(0, 1)
ax1.legend(loc='best')
ax2.legend(loc='best')
ax1.set_title('PI BLRMS Monitors')
ax2.set_title('PI BLRMS Monitors')
ax1.grid()
ax2.grid()
ax3.plot(
asd_during.frequencies / 1000,
......@@ -134,7 +129,7 @@ def check_pi(event):
ax3.set_yscale('log')
ax3.set_xscale('log')
ax3.set_xlim(5, 32)
ax3.set_title('ASD of {}'.format(ASD_data.channel))
ax3.set_title(f'ASD of {ASD_data.channel}')
ax3.set_ylabel('Magnitude')
ax3.set_xlabel('Frequency [kHz]')
ax3.legend(loc='best')
......
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