Skip to content
Snippets Groups Projects
Commit 6733ccd5 authored by Camilla Compton's avatar Camilla Compton
Browse files

Merge branch '155_3to2lockloss' into 'master'

Allow locklosses at LHO from X->3(LOCKLOSS_DRMI)->2(LOCKLOSS) to be marked as locklosses from X, when previously they would be marked as locklosses from 3; tags these locklosses as FAST_DRMI

Closes #155

See merge request jameson.rollins/locklost!148
parents 218d436a 627eafc1
No related branches found
No related tags found
No related merge requests found
Pipeline #702595 passed
...@@ -44,10 +44,7 @@ if IFO == 'H1': ...@@ -44,10 +44,7 @@ if IFO == 'H1':
GRD_NOMINAL_STATE = (600, 'NOMINAL_LOW_NOISE') GRD_NOMINAL_STATE = (600, 'NOMINAL_LOW_NOISE')
elif IFO == 'L1': elif IFO == 'L1':
GRD_NOMINAL_STATE = (2000, 'LOW_NOISE') GRD_NOMINAL_STATE = (2000, 'LOW_NOISE')
GRD_LOCKLOSS_STATES = [ GRD_LOCKLOSS_STATES = [(2, 'LOCKLOSS')]
(2, 'LOCKLOSS'),
# (3, 'LOCKLOSS_DRMI'),
]
if IFO == 'H1': if IFO == 'H1':
CDS_EVENT_ROOT = 'https://lhocds.ligo-wa.caltech.edu/exports/lockloss/events' CDS_EVENT_ROOT = 'https://lhocds.ligo-wa.caltech.edu/exports/lockloss/events'
......
...@@ -39,7 +39,8 @@ def find_previous_state(event): ...@@ -39,7 +39,8 @@ def find_previous_state(event):
# find start of previous state # find start of previous state
lockloss_found = False lockloss_found = False
candidate = 0 check_3_101_2 = 0
check_3_2 = 0
state_start_gps = None state_start_gps = None
power = 1 power = 1
window = [INITIAL_WINDOW[0], 1] window = [INITIAL_WINDOW[0], 1]
...@@ -82,12 +83,12 @@ def find_previous_state(event): ...@@ -82,12 +83,12 @@ def find_previous_state(event):
if transi == (101, 2): if transi == (101, 2):
# could be this case, so mark as candidate and # could be this case, so mark as candidate and
# continue # continue
candidate = 1 check_3_101_2 = 1
continue continue
elif candidate == 1: elif check_3_101_2 == 1:
if transi == (3, 101): if transi == (3, 101):
# yup, this is it, note and continue # yup, this is it, note and continue
candidate = 2 check_3_101_2 = 2
continue continue
else: else:
# nope, this is a regular 101->2 transtion, so # nope, this is a regular 101->2 transtion, so
...@@ -95,10 +96,30 @@ def find_previous_state(event): ...@@ -95,10 +96,30 @@ def find_previous_state(event):
lockloss_found = True lockloss_found = True
state_start_gps = transt state_start_gps = transt
break break
elif candidate == 2: elif check_3_101_2 == 2:
logger.info( logger.info(
f"updating H1 lockloss for X->3->101->2 " f'Updating H1 lockloss for X->3->101->2 '
f"transition: {transi}" f'transition: {transi}'
)
event.add_tag("FAST_DRMI")
# update the transition_index information on disk
# and clear cache so it's reloaded next access
with open(event.path('transition_index'), 'w') as f:
f.write('{} {}\n'.format(*transi))
event._transition_index = None
# don't continue so that we hit the lockloss_found
# check below
# If we don't have a X->3->101->2 LL, check if we maybe have
# a X->3->2 LL
if transi == (3, 2):
# Mark as candidate for this type of LL
check_3_2 = 1
continue
elif check_3_2 == 1:
logger.info(
f'Updating H1 lockloss for X->3->2 '
f'transition: {transi}'
) )
event.add_tag("FAST_DRMI") event.add_tag("FAST_DRMI")
# update the transition_index information on disk # update the transition_index information on disk
...@@ -107,13 +128,12 @@ def find_previous_state(event): ...@@ -107,13 +128,12 @@ def find_previous_state(event):
f.write('{} {}\n'.format(*transi)) f.write('{} {}\n'.format(*transi))
event._transition_index = None event._transition_index = None
# don't continue so that we hit the lockloss_found # don't continue so that we hit the lockloss_found
# check below.
if transi == event.transition_index: if transi == event.transition_index:
logger.info("lockloss found: {}".format(transi)) logger.info(f'Lockloss found: {transi}')
lockloss_found = True lockloss_found = True
assert lockloss_found, "lock loss not found in first segment" assert lockloss_found, "Lock loss not found in first segment"
window = [edge * (2 ** power) + window[0] for edge in INITIAL_WINDOW] window = [edge * (2 ** power) + window[0] for edge in INITIAL_WINDOW]
power += 1 power += 1
...@@ -121,6 +141,6 @@ def find_previous_state(event): ...@@ -121,6 +141,6 @@ def find_previous_state(event):
# write start of lock stretch to disk # write start of lock stretch to disk
previous_index, lockloss_index = event.transition_index previous_index, lockloss_index = event.transition_index
previous_state = (previous_index, state_start_gps, state_end_gps, lockloss_index) previous_state = (previous_index, state_start_gps, state_end_gps, lockloss_index)
logger.info("previous guardian state: {}".format(previous_state)) logger.info("Previous guardian state: {}".format(previous_state))
with open(event.path('previous_state'), 'w') as f: with open(event.path('previous_state'), 'w') as f:
f.write('{} {:f} {:f} {}\n'.format(*previous_state)) f.write('{} {:f} {:f} {}\n'.format(*previous_state))
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