GWSignalWaveformGenerator¶
- class GWSignalWaveformGenerator(spinning=True, eccentric=False, tidal=False, **kwargs)[source]¶
Bases:
WaveformGeneratorA wrapper to the gwsignal waveform generator that allows for use of arbitrary waveforms implemented as gwsignal generators and caches the generator between calls.
See the gwsignal documentation for more details.
This wrapper allows sets of parameters to be enabled/disabled. When, e.g.,
spinning=Falseall spin parameters will be fixed to zero.- Parameters:
- spinning: bool
Whether to model spins of the individual objects (default=True)
- eccentric: bool
Whether to model orbital eccentricity (default=False)
- tidal: bool
Whether to model tidal deformability of the individual objects (default=False)
- sampling_frequency: float, optional
The sampling frequency
- duration: float, optional
Time duration of data
- start_time: float, optional
Starting time of the time array
- parameters: DEPRECATED
Passing parameters via the waveform generator init is deprecated and will be removed in a future release.
- parameter_conversion: func, optional
Function to convert from sampled parameters to parameters of the waveform generator. The default value is the identity, i.e., it leaves the parameters unaffected.
- waveform_arguments: dict, optional
A dictionary of fixed keyword arguments to pass to the waveform generator. There is one required waveform argument
waveform_approximant.
- __init__(spinning=True, eccentric=False, tidal=False, **kwargs)[source]¶
The base waveform generator class.
- Parameters:
- sampling_frequency: float, optional
The sampling frequency
- duration: float, optional
Time duration of data
- start_time: float, optional
Starting time of the time array
- frequency_domain_source_model: func, optional
A python function taking some arguments and returning the frequency domain strain. Note the first argument must be the frequencies at which to compute the strain
- time_domain_source_model: func, optional
A python function taking some arguments and returning the time domain strain. Note the first argument must be the times at which to compute the strain
- parameters: DEPRECATED
Passing parameters via the waveform generator init is deprecated and will be removed in a future release.
- parameter_conversion: func, optional
Function to convert from sampled parameters to parameters of the waveform generator. Default value is the identity, i.e. it leaves the parameters unaffected.
- waveform_arguments: dict, optional
A dictionary of fixed keyword arguments to pass to either frequency_domain_source_model or time_domain_source_model.
Note: the arguments of frequency_domain_source_model (except the first, which is the frequencies at which to compute the strain) will be added to the WaveformGenerator object and initialised to None.
- use_cache: bool
Whether to attempt caching the waveform between subsequent calls. This is
Trueby default but must be disabled for JIT compilation withJAX.
- __call__(*args, **kwargs)¶
Call self as a function.
Methods
__init__([spinning, eccentric, tidal])The base waveform generator class.
frequency_domain_strain(parameters)Wrapper to source_model.
time_domain_strain(parameters)Wrapper to source_model.
Attributes
defaultsAlias for
_times_and_frequencies.duration.Alias for
_times_and_frequencies.frequency_array.generator_picklesDictionary of metadata associated with the waveform generator.
The dictionary of parameters for source model.
Alias for
_times_and_frequencies.sampling_frequency.Alias for
_times_and_frequencies.start_time.Alias for
_times_and_frequencies.time_array.- duration¶
Alias for
_times_and_frequencies.duration.
- frequency_array¶
Alias for
_times_and_frequencies.frequency_array.
- frequency_domain_strain(parameters)[source]¶
Wrapper to source_model.
Converts parameters with self.parameter_conversion before handing it off to the source model. Automatically refers to the time_domain_source model via NFFT if no frequency_domain_source_model is given.
- Parameters:
- parameters: dict, optional
Parameters to evaluate the waveform for. If not passed and the generator has been called previously, the last used parameters will be used.
- Returns:
- array_like: The frequency domain strain for the given set of parameters
- Raises:
- RuntimeError: If no source model is given
- property meta_data¶
Dictionary of metadata associated with the waveform generator.
Subclasses can override this property to include additional constructor parameters needed to recreate the waveform generator.
- Returns:
- dict: Dictionary of waveform generator metadata (empty for base class)
- property parameters¶
The dictionary of parameters for source model.
- Returns:
- dict: The dictionary of parameter key-value pairs
- Raises:
- AttributeError: If
parametersis not present in the internal cache.
- AttributeError: If
- sampling_frequency¶
Alias for
_times_and_frequencies.sampling_frequency.
- start_time¶
Alias for
_times_and_frequencies.start_time.
- time_array¶
Alias for
_times_and_frequencies.time_array.
- time_domain_strain(parameters)[source]¶
Wrapper to source_model.
Converts parameters with self.parameter_conversion before handing it off to the source model. Automatically refers to the frequency_domain_source model via INFFT if no frequency_domain_source_model is given.
- Parameters:
- parameters: dict, optional
Parameters to evaluate the waveform for. If not passed and the generator has been called previously, the last used parameters will be used.
- xp: array module, optional
The array module to use when evaluating the source model, e.g.,
numpy. This can be used to override thetime_arraystored in the generator. IfNone, the default will be used.
- Returns:
- array_like: The time domain strain for the given set of parameters
- Raises:
- RuntimeError: If no source model is given