-
Notifications
You must be signed in to change notification settings - Fork 352
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dq fitting to Live supervised fitting script #4866
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good - mainly stylistic/standardisation comments from me with a couple of minor questions
303beed
to
d37185d
Compare
ifo_group.create_dataset('observing_livetime', data=livetime) | ||
ifo_group.create_dataset('dq_flag_livetime', data=flagged_time) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've found the issue with using HFile, this line uses hasattr('dtytpe') to check it is is a numpy array, which is needed to allow the fletcher32 keyword to be set.
However numpy number-types have dtype attributes as well. The options are either:
- change that line to use
isinstance(data, np.ndarray)
instead [should work] - change this line to give dq_flag_livetime as an attribute [will work]
- Change this line to cast dq_flag_livetime as a numpy array before saving it [I think this will work, and allow this dataset to be checksummed]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think changing that line to use isinstance(data, np.ndarray)
is the cleanest fix. It will also prevent this issue from arising again in the future for some other unsuspecting student.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All my remaining comments are pedantry/optional, so approving
This MR completes the statistic upgrade for PyCBC Live by allowing the daily supervised fitting script to produce DQ trigger rate files for use with the DQ reweighting statistic
This is a new feature.
This change primarily affects the live search.
Two files are modified which are used in the offline search; they are bin/all_sky_search/pycbc_bin_templates and bin/plotting/pycbc_plot_dq_flag_likelihood . In both cases, the change should not cause any functional difference.
This changes the scientific output of the live search when the DQ reweighted stat is being used, otherwise it does not make a difference.
This also makes a number of changes to bin/live/pycbc_live_supervise_collated_trigger_fits beyond just adding the dq fitting process. Changes include moving the code used to calculate the original date of replay data into its own function, code style improvements, removing unused imports, changing variable names to be less ambiguous, etc.
Two new scripts are added to the bin/live/ folder, these are used for performing the dq fitting. The first gathers dq statistical information for a day of data, the second combines the information from multiple days an produces a statistic file to be ingested by the search.
After this is merged, we should be ready to create a new release branch for the live analysis.