FEAT: add option to crop whitened time series#1030
Open
ColmTalbot wants to merge 15 commits intobilby-dev:mainfrom
Open
FEAT: add option to crop whitened time series#1030ColmTalbot wants to merge 15 commits intobilby-dev:mainfrom
ColmTalbot wants to merge 15 commits intobilby-dev:mainfrom
Conversation
f39871f to
5fbc454
Compare
mj-will
reviewed
Jan 22, 2026
Comment on lines
631
to
639
| @property | ||
| def frequency_mask(self): | ||
| frequencies = bilby.core.utils.series.create_frequency_series( | ||
| duration=self.ifo.cropped_duration, sampling_frequency=self.sampling_frequency | ||
| ) | ||
| return (self.ifo.minimum_frequency <= frequencies) & ( | ||
| frequencies <= self.ifo.maximum_frequency | ||
| ) | ||
|
|
Collaborator
There was a problem hiding this comment.
We should probably have a utility function that does this.
0b74e2b to
0972d62
Compare
Collaborator
GregoryAshton
left a comment
There was a problem hiding this comment.
Overall looks good and I'm supportive, just a few things I wanted to check.
ColmTalbot
commented
Jan 28, 2026
b420677 to
c244c9d
Compare
Co-authored-by: Colm Talbot <talbotcolm@gmail.com>
b8f4b97 to
c7e762a
Compare
asb5468
reviewed
Feb 5, 2026
bilby/gw/detector/interferometer.py
Outdated
| else: | ||
| return self.whiten_and_crop(frequency_series=frequency_series) | ||
|
|
||
| def whiten_and_crop(self, frequency_series : np.array) -> np.array: |
Collaborator
There was a problem hiding this comment.
It seems like this procedure is more fundamental than suggested by its being a method of the interferometer class. The nice thing about using the gwutils SNR functions was that you could calculate SNRs using them without necessarily initializing an interferometer object. Is it possible to pull this out to the utils and just call it here?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR implements the proposed modification to the likelihood from https://iopscience.iop.org/article/10.1088/1361-6382/ae1ac7/meta.
The main new feature is adding a
crop_durationto theInterferometerStrainDataand some accompanying utility code.I modified how the
GravitationalWaveTransientandBasicGravitationalWaveTransientcall the data. I did not have to change the reference likelihood tests, so there is good evidence that this doesn't impact the numerical values when not using the cropping.I suspect there is a performance penalty due to repeatedly whitening the data. There should be a way to cache this calculation, it just requires some cleverness about when the time/frequency masks might have changed.
I also haven't validated how this interacts with time/calibration marginalization.