Skip to content

Commit

Permalink
More robust pygrb_page_tables (#5027)
Browse files Browse the repository at this point in the history
* Correcting slide_id choice in page_tables for the onsource

* More reobuse if/elif conditions in page_tables

* Comment

* More robust if condition in page_tables
  • Loading branch information
pannarale authored Jan 31, 2025
1 parent bf5ff50 commit c52c22b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bin/pygrb/pycbc_pygrb_page_tables
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ if onsource_file:
# Get trigs
on_trigs = ppu.load_data(onsource_file, ifos, data_tag=None,
rw_snr_threshold=opts.newsnr_threshold,
slide_id='all')
slide_id=0)

# Record loudest trig by BestNR
loud_on_bestnr = 0
Expand Down
9 changes: 5 additions & 4 deletions pycbc/results/pygrb_postprocessing_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,19 +344,20 @@ def load_data(input_file, ifos, rw_snr_threshold=None, data_tag=None,
trigs_dict = {}
with HFile(input_file, "r") as trigs:
for (path, dset) in _dataset_iterator(trigs):
# The dataset contains information other than trig/inj properties:
# The dataset contains search information or missed injections
# information, not properties of triggers or found injections:
# just copy it
if len(dset) != num_orig_pts:
if 'search' in path or 'missed' in path:
trigs_dict[path] = dset[:]
# The dataset is relative to an IFO: cut with the correct index
# The dataset is trig/inj info at an IFO: cut with the correct index
elif path[:2] in ifos:
ifo = path[:2]
if ifo_ids_above_thresh_locations[ifo].size != 0:
trigs_dict[path] = \
dset[:][ifo_ids_above_thresh_locations[ifo]]
else:
trigs_dict[path] = numpy.array([])
# The dataset is relative to the network: cut it before copying
# The dataset is trig/inj network info: cut it before copying
else:
trigs_dict[path] = dset[above_thresh]

Expand Down

0 comments on commit c52c22b

Please sign in to comment.