Skip to content

Commit

Permalink
Use HFile for outputs (#4880)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtrevor authored Sep 13, 2024
1 parent 405be55 commit 3264f60
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions bin/live/pycbc_live_collated_dq_trigger_rates
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import argparse
import hashlib

import numpy as np
import h5py as h5

import pycbc
from pycbc.io import HFile
Expand Down Expand Up @@ -121,7 +120,7 @@ with HFile(args.trigger_file, 'r') as trigf:

# write outputs to file
logging.info(f'Writing results to {args.output}')
with h5.File(args.output, 'w') as f:
with HFile(args.output, 'w') as f:
ifo_group = f.create_group(args.ifo)
ifo_group.create_dataset('observing_livetime', data=livetime)
ifo_group.create_dataset('dq_flag_livetime', data=flagged_time)
Expand Down
3 changes: 1 addition & 2 deletions bin/live/pycbc_live_combine_dq_trigger_rates
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import logging
import argparse

import numpy as np
import h5py as h5

import pycbc
from pycbc.io import HFile
Expand Down Expand Up @@ -79,7 +78,7 @@ bg_livetime = total_livetime - flagged_livetime
bg_trigger_rate = bg_triggers / bg_livetime

# save results
with h5.File(args.output, 'w') as f:
with HFile(args.output, 'w') as f:
ifo_grp = f.create_group(args.ifo)
all_bin_grp = ifo_grp.create_group('bins')

Expand Down

0 comments on commit 3264f60

Please sign in to comment.