Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Gareth S Cabourn Davies <gareth.cabourndavies@ligo.org>
  • Loading branch information
maxtrevor and GarethCabournDavies authored Aug 19, 2024
1 parent ea50598 commit eae4d1f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
19 changes: 14 additions & 5 deletions bin/pycbc_live
Original file line number Diff line number Diff line change
Expand Up @@ -1318,17 +1318,26 @@ with ctx:
times = results[ifo]['end_time']
flag_active = data_reader[ifo].idq.flag_at_times(
start, valid_pad, times,
padding=data_reader[ifo].dq_padding)
padding=data_reader[ifo].dq_padding
)

if args.idq_reweighting:
logging.info('iDQ flagged %d/%d %s triggers',
numpy.sum(flag_active), len(times), ifo)
logging.info(
'iDQ flagged %d/%d %s triggers',
numpy.sum(flag_active),
len(times),
ifo
)
results[ifo]['dq_state'] = flag_active.astype(int)
else:
# use idq as a veto
keep = numpy.logical_not(flag_active)
logging.info('Keeping %d/%d %s triggers after iDQ',
numpy.sum(keep), len(times), ifo)
logging.info(
'Keeping %d/%d %s triggers after iDQ',
numpy.sum(keep),
len(times),
ifo
)
for key in results[ifo]:
if len(results[ifo][key]):
results[ifo][key] = \
Expand Down
6 changes: 4 additions & 2 deletions pycbc/events/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2304,11 +2304,13 @@ def check_low_latency(self, key):
# if segs are not in file, we must be in LL
if self.dq_state_segments is not None:
raise ValueError(
'Either all dq stat files must have segments or none')
'Either all dq stat files must have segments or none'
)
self.low_latency = True
elif self.low_latency:
raise ValueError(
'Either all dq stat files must have segments or none')
'Either all dq stat files must have segments or none'
)

def assign_template_bins(self, key):
"""
Expand Down

0 comments on commit eae4d1f

Please sign in to comment.