Skip to content

Commit

Permalink
Improve logic for getting ifo frm trigs
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtrevor committed Jul 22, 2024
1 parent b88025c commit d82cbca
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions pycbc/events/stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -2169,10 +2169,9 @@ def find_dq_noise_rate(self, trigs):
try:
ifo = trigs.ifo
except AttributeError:
ifo = trigs['ifo']
assert len(numpy.unique(ifo)) == 1
# Should be exactly one ifo provided
ifo = ifo[0]
assert len(numpy.unique(trigs['ifo'])) == 1
ifo = trigs['ifo'][0]

dq_state = trigs['dq_state']
dq_val = numpy.ones(len(dq_state))
Expand Down Expand Up @@ -2230,13 +2229,11 @@ def single(self, trigs):
# make sure every trig has a dq state

try:
# works in offline
ifo = trigs.ifo
except AttributeError:
# works in low-latency
ifo = trigs['ifo'][0]
# Should be exactly one ifo provided
assert len(numpy.unique(trigs['ifo'])) == 1
ifo = trigs['ifo'][0]

singles = ExpFitFgBgNormStatistic.single(self, trigs)

Expand Down

0 comments on commit d82cbca

Please sign in to comment.