Closed mj-will closed 1 month ago
@spxiwh I opted to make the change in a try/except
block so that the function still works with Array
inputs. I'm happy to change this if you have other suggestions
Could you elaborate on what bug this fixes? Which scientific output does the bug affect (searches, PE…)?
Could you elaborate on what bug this fixes? Which scientific output does the bug affect (searches, PE…)?
@titodalcanton scientific output might be a bit of a stretch but it was the best fit of the options listed.
The bug this fixes occurs if you call executed_cached_fft
on an instance of TimeSeries
(or on a FrequencSeries
if using the inverse option). The output object does not have the _epoch
attribute set, so it defaults to zero. I've updated the PR text with a minimal example that shows this.
This cropped up in some LISA-related short author work Ian, Gareth and I are working. We're using this function for performing faster FFTs/iFFTs with large time series/frequency series for both search and inference. The bug described here was leading to inconsistent epochs between the data and generated waveforms, which in turn led to incorrect results in the inference.
Update
pycbc.strain.strain.execute_cached_fft
so that the epoch of the output frequency/time series is set to match that of the input rather than being zero.Standard information about the request
This is a: bug fix
This change affects any code that makes use of
execute_cached_fft
or functions/classes that call it. This includespycbc.filter
andpycbc.psd
given this, it could impact a large part of the codebase.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: fix an existing bug
Motivation
This fixes a bug in
pycbc.strain.strain.execute_cached_fft
Contents
_epoch
attribute of the output frequency/time series based on the inputexecute_cached_fft
andexecute_cached_ifft
Links to any issues or associated PRs
N/A
Testing performed
Added unit tests to test the changes
Additional notes
Minimal example
which prints: