PyGRB now establishes the tc prior for injections at workflow time #4751
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Standard information about the request
This is a: new feature for consistency with injections times within PyGRB.
This change affects: PyGRB.
This change changes: the workflow generator to avoid "wasting" injections.
This change: was tested in a full PyGRB workflow run.
Motivation
When setting up the coherent search, the user must specify a max-duration and a min-duration of the search and provides a trigger time (and a time window for the possible search which generally extends for max-duration seconds before and after the trigger time). The workflow generator then determines how to place the analysis time around the trigger time to maximise the coincident time with the detectors in the network specified by the user. It is only at this point that it becomes clear when in time the injections can be allowed to happen: if a prior for the time of the injections were specified from the start, based on the time window around the trigger time set up by the user for inspection, a(n unknown) fraction of the injections would be wasted.
Contents
This PR allows the user to ask the workflow generator to write up the prior for the time of the injections, after the analysis time is optimally determined. The prior is written to a file which is passed to all injection sets.
Testing performed
Plot from a workflow with 500 injections which precedes this PR: .
The injections were allowed to occur at any time the user was happy to consider for the search (roughly [-max-duration, +max-duration] around the trigger time) and the plot is showing all recovered injections up to the cut on reweighted SNR.
Here is the impact on missing injections:
Lots of nearby injections were missed (black crossed) because of when they happened.
Corresponding plots after the feature added in this PR, with a "stress-test" of 2500 injections:
(Please ignore the change in the color bar, which was part of a separate fix: the main point is that nearby injections are no longer black crosses, i.e., missed.)