Use pregenerated injection frame file to perform pregenerated injections (resurrected) #5161
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
This change affects: the offline search, inference, PyGRB
This change changes: scientific output
This change: has appropriate unit tests, follows style guidelines (See e.g. PEP8), has been proposed using the contribution guidelines
This change will: add new functionality, but not break anything
Motivation
This is an attempt to resurrect #4477. In the past it has been difficult to guarantee that different search codes are making identical injections, and therefore comparisons can be hard. In addition some newer injection waveforms can require huge amounts of RAM, making it difficult to set requirements for jobs running on OSG. Using pregenerated injection frame files fixes this and such files can be easily distributed over OSG
Contents
We add the ability to add injections from frame files containing pregenerated injections (... I note that one could put anything in these files, so if you wanted to inject cosmic string blip direct collapse non-GR mergers this would be the easiest way to do that).
Links to any issues or associated PRs
This is taken from #4477 I've resurrected the code and reworked a few things.
Testing performed
I will need to test this on pregenerated injection frames. The CI will test it in "normal" settings.
Additional notes
@ahnitz Had some comments on the original PR. Some responses here:
generate_injections
option in InjectionSet.apply(). I think it is not the right approach to not call InjectionSet.apply() if not generating injections, but still wanting to filter them. All our injection optimization (when not to analyse segments, times, templates etc. is based on information that comes from here when we read the injection files. Actually making the injections is one line (which we bypass if this is set), but all the rest is still needed. We're basically already doing this in the minifollowups where we use the hack of settinginjection_scale_factor
to 0 to acheive exactly the same thing. That can now be done "properly" ... reminding that we do want to not generate injections when using these frames because of high memory usage of some injection models.strain.py
'sfrom_cli
module. There is similarly between injection_frame reading and normal frame reading. I avoided further duplication by adding the two together immediately after reading the injection frames. I'm okay with this duplication ... Thefrom_cli
function could do with a cleanup and consideration of structure (might be nice to be flexible about the order in which things are done), but that feels out of scope of this.I think other issues are addressed.