-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Additions for v2.3.4 release (#4616)
* Fix error querying Virgo frame type (#4523) * Fix error querying Virgo frame type * Typo * Typo * Implement Ian's suggestion * Make it work * Use an actual DeprecationWarning * Scripts for dealing with preparation of offline gracedb upload files (#4534) * Scripts for dealing with preparation of offline gracedb upload files * Update bin/all_sky_search/pycbc_make_bayestar_skymap Co-authored-by: Tito Dal Canton <[email protected]> * reinstate SNR timeseries being saved into HDF * TDC comments * TDC comments 2 * Remove unneeded import --------- Co-authored-by: Tito Dal Canton <[email protected]> Co-authored-by: Tito Dal Canton <[email protected]> * Use vetoed times followup in example (#4597) * Use vetoed times followup in example * Fix statistic files double-definition * Rationalize some calls to waveform properties (#4540) * rationalize some calls to waveform properties * Only allow explictly listed names * don't try to change function name * g g * Add the ability to choose how to sort injections in minifollowups (#4602) * Add the ability to choose how to sort injections in minifollowups * Minor cleanup * Minor refactor * Tom's comments * Update example search workflow * Further thoughts and suggestions * Tom's suggestion * Fix bug and Tom's suggestion * Standardise logging: bin/all_sky_search and pycbc/events (#4576) * add level to default logging * Decrease logging level for debug information in coinc_findtrigs * decrease logging level for some information in sngls_findtrigs * add named logger in pycbc/events/cuts.py * add named logger in pycbc/events/significance.py * REVERT ME: an example of usage * CC fix * Revert "REVERT ME: an example of usage" This reverts commit eb647e0. * Use init_logging throughout all_sky_search * give pycbc/events modules named loggers * missed the fact that the level was set to warn, not info, as default before * CC * missed an import * start moving verbose argparse into common facility * add common_options to all_sky_search executables * set --verbose default value to zero * pycbc not imported in some codes * CC * rename function to be more decriptive * O4b idq offline update (#4603) * Start offline dq workflow rework * Modified stat * Rewrote dq workflow * Added note for future suggested changes to dq workflow * Finished first draft of offline workflow * Fixed a comment * Removed unneeded argument to make dq workflow * Made bin templates executable * WOrking version of offline dq workflow * Reverting non-functional changes in stat.py * linting * Reverted more non-functional changes * Reverted low-latency related features * Rearrange imports * Addressed Ian's comments * Simplified masking in dq workflow * Modify dq workflow to avoid using numpy arrays * Use vetoed times followup in example (#4597) * Use vetoed times followup in example * Fix statistic files double-definition * Addressed more comments from Tom * Addressed Gareth's comments on parser arguments * Don't allow dq stat to uprank candidates * Modify dq trigger rate plots to not use dq trigger rates below 1 * Address Tom's most recent comment * Readded [Min 1] to dq plot's y-axis label * Pass bank plotting tags to dq template bin plots * Update bin/plotting/pycbc_plot_dq_flag_likelihood Co-authored-by: Thomas Dent <[email protected]> * Update bin/workflows/pycbc_make_offline_search_workflow Co-authored-by: Thomas Dent <[email protected]> * Use abs() correctly * Break up 2 try/ecept cases --------- Co-authored-by: Gareth S Cabourn Davies <[email protected]> Co-authored-by: Thomas Dent <[email protected]> * Bumping version number --------- Co-authored-by: Tito Dal Canton <[email protected]> Co-authored-by: Gareth S Cabourn Davies <[email protected]> Co-authored-by: Tito Dal Canton <[email protected]> Co-authored-by: Thomas Dent <[email protected]> Co-authored-by: maxtrevor <[email protected]>
- Loading branch information
1 parent
132e9da
commit 1c1a91a
Showing
66 changed files
with
1,516 additions
and
1,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
#!/usr/bin/env python | ||
""" Bin templates by their duration | ||
""" | ||
import logging | ||
import argparse | ||
import h5py as h5 | ||
import numpy as np | ||
|
||
import pycbc | ||
import pycbc.pnutils | ||
from pycbc.version import git_verbose_msg as version | ||
from pycbc.events import background_bin_from_string | ||
|
||
parser = argparse.ArgumentParser(description=__doc__) | ||
parser.add_argument('--version', action='version', version=version) | ||
parser.add_argument('--verbose', action="count") | ||
parser.add_argument("--ifo", type=str, required=True) | ||
parser.add_argument("--f-lower", type=float, default=15., | ||
help='Enforce a uniform low frequency cutoff to ' | ||
'calculate template duration over the bank') | ||
parser.add_argument('--bank-file', help='hdf format template bank file', | ||
required=True) | ||
parser.add_argument('--background-bins', nargs='+', | ||
help='Used to provide a list of ' | ||
'precomputed background bins') | ||
parser.add_argument("--output-file", required=True) | ||
|
||
args = parser.parse_args() | ||
|
||
pycbc.init_logging(args.verbose) | ||
logging.info('Starting template binning') | ||
|
||
with h5.File(args.bank_file, 'r') as bank: | ||
logging.info('Sorting bank into bins') | ||
data = { | ||
'mass1': bank['mass1'][:], | ||
'mass2': bank['mass2'][:], | ||
'spin1z': bank['spin1z'][:], | ||
'spin2z': bank['spin2z'][:], | ||
'f_lower': np.ones_like(bank['mass1'][:]) * args.f_lower | ||
} | ||
|
||
bin_dict = background_bin_from_string(args.background_bins, data) | ||
bin_names = [b.split(':')[0] for b in args.background_bins] | ||
|
||
logging.info('Writing bin template ids to file') | ||
with h5.File(args.output_file, 'w') as f: | ||
ifo_grp = f.create_group(args.ifo) | ||
for bin_name in bin_names: | ||
bin_tids = bin_dict[bin_name] | ||
grp = ifo_grp.create_group(bin_name) | ||
grp['tids'] = bin_tids | ||
f.attrs['f_lower'] = args.f_lower | ||
f.attrs['background_bins'] = args.background_bins | ||
|
||
logging.info('Finished') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.