ML4GW / amplfi

Performing parameter estimation on gravitational wave data with machine learning
MIT License
7 stars 8 forks source link

Make `FrequencyDomainCBCGenerator` robust to choices of `f_min`, `f_max`, and `padding` #133

Closed EthanMarx closed 3 weeks ago

EthanMarx commented 3 weeks ago

@ravioli1369 ran into an issue where the waveforms being generated were not sufficiently long enough. The underlying issue was that the number of samples in the time domain data after ffting the waveform is a function of f_min and f_max.

Another issue was the ringdown of the ffted waveform was on the left side of the waveform.

This PR does a couple of things to address these:

  1. Adds RINGDOWN_DURATION class variable set to 0.5 seconds that will roll the waveform by that amount so that the coalescence and ringdown are properly connected. This means that by default, the waveform coalesence time is RINGDOWN_DURATION from the right edge of the kernel.
  2. The padding variable now specifies additional zero padding on top of the 0.5 seconds of ringdown to add to the waveform
  3. A left_padding variable is calculated to ensure that the waveform is long enough to fulfill the requested duration
ravioli1369 commented 3 weeks ago

the ringdown duration should also be defined in the cbc.yaml file as well right? since it's configurable

EthanMarx commented 3 weeks ago

the ringdown duration should also be defined in the cbc.yaml file as well right? since it's configurable

Yeah I think specifying it in the config makes sense - let me do that

EthanMarx commented 3 weeks ago

@ravioli1369 I set ringdown_duration = 0.5 and padding = 0.0 as defaults in the config, which should place the coalescence 0.5 seconds from the right edge of the window.

Let me know if any issues come up with this

ravioli1369 commented 3 weeks ago

The rest looks good, I tried generating a waveform as before and the shifts look right. Also started a training run to see how this compares to the model I trained with the old waveform generator.