ml4gw.waveforms package
Submodules
ml4gw.waveforms.generator module
- class ml4gw.waveforms.generator.TimeDomainCBCWaveformGenerator(approximant, sample_rate, duration, f_min, f_ref, right_pad)
Bases:
Module
Waveform generator that generates time-domain waveforms from frequency-domain approximants.
Frequency domain waveforms are conditioned as done by lalsimulation. Specifically, waveforms are generated with a starting frequency fstart slightly below the requested f_min, so that they can be tapered from fstart to f_min using a cosine window.
Please see https://lscsoft.docs.ligo.org/lalsuite/lalsimulation/group___l_a_l_sim_inspiral__c.html#gac9f16dab2cbca5a431738ee7d2505969 for more information
- Parameters:
approximant (
Callable
) -- A callable that returns hplus and hcross polarizations given requested frequencies and relevant set of parameters. See ml4gw.waveforms.cbc for implemented approximants.sample_rate (
float
) -- Rate at which returned time domain waveform will be sampled in Hz. This also specifies f_max for generating waveforms via the nyquist frequency: f_max = sample_rate // 2.f_min (
float
) -- Lower frequency bound for waveformsduration (
float
) -- Length of waveform in seconds. Waveforms will be left padded with zeros appropiately to fill the requested durationright_pad (
float
) -- How far from the right edge of the window in seconds the returned waveform coalescence will be placed.f_ref (
float
) -- Reference frequency for the waveform
- build_highpass_filter()
Builds highpass filter object.
- property delta_f
- property delta_t
- forward(**parameters)
Generates a time-domain waveform from a frequency-domain approximant. Conditioning is based onhttps://git.ligo.org/lscsoft/lalsuite/-/blob/master/lalsimulation/python/lalsimulation/gwsignal/core/waveform_conditioning.py?ref_type=heads#L248
A frequency domain waveform is generated, conditioned (see generate_conditioned_fd_waveform) and fft'd into the time-domain
- Return type:
Tuple
[Float[Tensor, '{N} samples']
,Float[Tensor, '{N} samples']
]
- **parameters:
Dictionary of parameters for waveform generation where each key is the parameter name and each value is a tensor of parameters. It is required that parameters contains mass_1, mass_2, s1z, and s2z keys, which are used for determining parameters of data conditioning.
If the specified approximant takes other parameters for waveform generation, like chirp_mass and mass_ratio, the utility functions in ml4gw.waveforms.conversion may be useful for populating the parameters dictionary with these additional parameters.
Note that, if using an approximant from ml4gw.waveforms.cbc, any additional keys in parameters not ingested by the approximant will be ignored.
- generate_conditioned_fd_waveform(**parameters)
Generate a conditioned frequency domain waveform from a frequency-domain approximant.
- Parameters:
**parameters (
dict
[str
,Float[Tensor, 'batch']
]) --Dictionary of parameters for waveform generation where key is the parameter name and value is a tensor of parameters. It is required that parameters contains mass_1, mass_2, s1z, and s2z keys, which are used for determining parameters of data conditioning.
If the specified approximant takes other parameters for waveform generation, like chirp_mass and mass_ratio, the utility functions in `ml4gw.waveforms.conversion`may be useful for populating the parameters dictionary with these additional parameters.
Note that, if using an approximant from ml4gw.waveforms.cbc, any additional keys in parameters not ingested by the approximant will be ignored.
- Return type:
Tuple
[Float[Tensor, '{N} samples']
,Float[Tensor, '{N} samples']
]
- get_frequencies(df)
Get the frequencies from 0 to nyquist for corresponding df
- property nyquist
- property size
Number of samples in the waveform