ROMWaveformManager API Reference
- RIFT.physics.ROMWaveformManager.ConvertWPtoSurrogateParams(P, **kwargs)
Takes P, returns arguments of the form usually used in gwsurrogate. (currently, just returns 1/q = P.m1/P.m1, the mass ratio parameter usually accepted)
- RIFT.physics.ROMWaveformManager.ConvertWPtoSurrogateParamsAligned(P, **kwargs)
Takes P, returns arguments of the form used in gwsurrogate for a nonprecessing binary
- RIFT.physics.ROMWaveformManager.ConvertWPtoSurrogateParamsPrecessing(P, **kwargs)
Takes P, returns arguments of the form usually used in gwsurrogate. (currently, just returns 1/q = P.m1/P.m1, the mass ratio parameter usually accepted)
- RIFT.physics.ROMWaveformManager.ConvertWPtoSurrogateParamsPrecessingFull(P, **kwargs)
Takes P, returns arguments of the form usually used in gwsurrogate. (currently, just returns 1/q = P.m1/P.m1, the mass ratio parameter usually accepted)
- RIFT.physics.ROMWaveformManager.CreateCompatibleComplexIP(hlmf, **kwargs)
Creates a complex Inner Product (IP) object compatible with the provided harmonic modes.
- Args:
hlmf (dict): A dictionary of harmonic modes. **kwargs: Additional arguments for ComplexIP.
- Returns:
lalsimutils.ComplexIP: A compatible inner product object.
- RIFT.physics.ROMWaveformManager.CreateCompatibleComplexOverlap(hlmf, **kwargs)
Creates a ComplexOverlap object compatible with the provided harmonic modes.
- Args:
hlmf (dict): A dictionary of harmonic modes. **kwargs: Additional arguments for ComplexOverlap.
- Returns:
lalsimutils.ComplexOverlap: A compatible overlap object.
- RIFT.physics.ROMWaveformManager.DataFourierNumpy(wfComplex)
Performs a NumPy-based Fast Fourier Transform (FFT) on a complex waveform. Assumes the input is an (n, 2) array of [time_values, waveform_values].
- Args:
wfComplex (np.ndarray): Array of shape (n, 2) containing time and complex signal.
- Returns:
np.ndarray: Array of shape (n, 2) containing frequency values and the FFT result.
- RIFT.physics.ROMWaveformManager.DataInverseFourierNumpy(wfComplex)
Performs a NumPy-based Inverse Fast Fourier Transform (IFFT) on frequency-domain data. Assumes the input is an (n, 2) array of [frequency_values, waveform_values].
- Args:
wfComplex (np.ndarray): Array of shape (n, 2) containing frequencies and complex signal.
- Returns:
np.ndarray: Array of shape (n, 2) containing time values and the reconstructed signal.
- RIFT.physics.ROMWaveformManager.ModeToString(pair)
Converts a harmonic mode pair (l, m) into a string representation (e.g., ‘l2_m2’).
- Args:
pair (tuple): A tuple containing (l, m) integers.
- Returns:
str: The formatted mode string.
- exception RIFT.physics.ROMWaveformManager.NRError
Bases:
ExceptionBase exception class for ROMWaveformManager module.
- exception RIFT.physics.ROMWaveformManager.NRNoSimulation(expr, msg)
Bases:
NRErrorException raised when no known simulation is found for the given parameters.
- RIFT.physics.ROMWaveformManager.RangeWrap1d(bound, val, fn)
RangeWrap1d: Uses np.piecewise to construct a piecewise function which is =fn inside the boundary, and 0 outside. SHOULD be syntactic sugar, but depending on the python version the language needed to implement this changes.
- RIFT.physics.ROMWaveformManager.RawGetModePeakTime(wfMode)
Finds the time of the maximum absolute magnitude for a given complex waveform mode.
- Args:
wfMode (np.ndarray): A complex data sequence (usually an (n, 2) array).
- Returns:
float: The real-valued time of the peak magnitude.
- RIFT.physics.ROMWaveformManager.SurrogateDimensionlessBasisFunction(sur, k)
Creates a basis function w(t) for a surrogate model.
- Args:
sur: The surrogate model object containing fit functions. k (int): The index of the basis function.
- Returns:
function: A function w(t) that returns the basis function value at time t.
- class RIFT.physics.ROMWaveformManager.WaveformMode
Bases:
objectClass representing a dimensionless timeseries X( au=t/M)
- class RIFT.physics.ROMWaveformManager.WaveformModeCatalog(group, param, lmax=2, strain_basis_functions_dimensionless=None, mode_list_to_load=None, build_fourier_time_window=1000, reflection_symmetric=True, max_nbasis_per_mode=None, coord_names_internal=['q'])
Bases:
objectManager for Reduced Order Model (ROM) waveforms.
This class handles the loading of surrogate models, coordinate transformation between RIFT and surrogate parameters, and the reconstruction of waveforms using a reduced basis of functions.
- Attributes:
group (str): The surrogate group name. param (str): The surrogate parameter identifier. lmax (int): Maximum harmonic mode l to load. reflection_symmetric (bool): Whether to use reflection symmetry for modes. sur_dict (dict): Mapping of (l, m) to the loaded surrogate model. modes_available (list): List of available (l, m) modes.
- basis_off(P, force_T=False, deltaT=6.103515625e-05, time_over_M_zero=0.0)
basis_off takes fourier transforms of LAL timeseries generated from basis_oft. All modes have physical units, appropriate to a physical signal.
- basis_oft(P, force_T=False, deltaT=6.103515625e-05, time_over_M_zero=0.0, return_numpy=False)
Generates the ROM basis functions in the time domain, resampled to a physical grid.
- Args:
P (ChooseWaveformParams): Waveform parameters. force_T (float/bool): If float, forces a specific time length. deltaT (float): Time step. time_over_M_zero (float): Reference time offset. return_numpy (bool): If True, returns NumPy arrays instead of LAL time series.
- Returns:
- dict or tuple: A dictionary mapping (l, m, index) to LAL time series,
or a tuple of (tvals, basis_grid) if return_numpy is True.
- coefficients(P, **kwargs)
Returns the values of the ROM coefficients for the parameter P. Usees the key-value pairing convention described in basis_oft. Note that the coefficients are created on a mode by mode basis, so the conversion call is VERY redundant.
- complex_hoff(P, force_T=False)
Generates a complex-valued frequency-domain waveform using the FFT of complex_hoft.
- Args:
P (ChooseWaveformParams): Waveform parameters. force_T (float/bool): If float, forces a specific time length.
- Returns:
lal.COMPLEX16FrequencySeries: The complex frequency-domain waveform.
- complex_hoft(P, force_T=False, deltaT=6.103515625e-05, time_over_M_zero=0.0, sgn=-1)
Generates a complex-valued time-domain waveform h(t) summed over available modes.
- Args:
P (ChooseWaveformParams): Waveform parameters. force_T (float/bool): If float, forces a specific time length. deltaT (float): Time step. time_over_M_zero (float): Reference time offset. sgn (int): Sign of the imaginary part (usually -1).
- Returns:
lal.COMPLEX16TimeSeries: The complex waveform.
- conj_hlmoff(P, force_T=False, deltaT=6.103515625e-05, time_over_M_zero=0.0, use_basis=False, Lmax=inf, **kwargs)
conj_hlmoff takes fourier transforms of LAL timeseries generated from hlmoft, but after complex conjugation. All modes have physical units, appropriate to a physical signal.
- estimateDurationSec(P, fmin=10.0)
estimateDuration uses fmin*M from the (2,2) mode to estimate the waveform duration from the well-posed part. By default it uses the entire waveform duration. CURRENTLY DOES NOT IMPLEMENT frequency-dependent duration
- estimateFminHz(P, fmin=10.0)
Estimate the minimum frequency for the ROM based on the 2,2 mode.
- Args:
P (ChooseWaveformParams): Waveform parameters. fmin (float): Nominal fmin. Default is 10 Hz.
- Returns:
float: Estimated minimum frequency.
- hlmoff(P, force_T=False, deltaT=6.103515625e-05, time_over_M_zero=0.0, use_basis=False, Lmax=inf, **kwargs)
hlmoff takes fourier transforms of LAL timeseries generated from hlmoft. All modes have physical units, appropriate to a physical signal.
- hlmoft(P, force_T=False, deltaT=6.103515625e-05, time_over_M_zero=0.0, use_basis=False, Lmax=inf, hybrid_time=None, hybrid_use=False, hybrid_method='taper_add', hybrid_frequency=None, verbose=False, rom_taper_start=False, rom_taper_end=True, use_reference_spins=True, **kwargs)
hlmoft uses the dimensionless ROM basis functions to extract hlm(t) in physical units, in a LAL array. The argument ‘P’ is a ChooseWaveformParaams object FIXME: Add tapering option!
rom_taper_start # use manual tapering in this routine. Should taper if this is true, OR the P.taper includes start tapering rom_taper_end # use gwsurrogate built-in tapering as appropriate (HybSur only), with hard-coded taper time from scott (40M out of 140 M)
- non_herm_hoff(P)
Generates the 2-sided frequency-domain waveform h(f) for a real instrument.
- Args:
P (ChooseWaveformParams): Waveform parameters.
- Returns:
lal.COMPLEX16FrequencySeries: The frequency-domain waveform.
- print_params()
Prints the available modes and their associated basis sizes for the current ROM.
- real_hoft(P, Fp=None, Fc=None)
Generates a real-valued time-domain waveform projected onto a detector.
- Args:
P (ChooseWaveformParams): Waveform parameters. Fp (float/array, optional): Antenna pattern F+. Fc (float/array, optional): Antenna pattern Fx.
- Returns:
lal.REAL8TimeSeries: The real-valued detector strain.
- RIFT.physics.ROMWaveformManager.myzero(arg)
Returns zero. Used as a helper for RangeWrap1d boundary conditions.
- RIFT.physics.ROMWaveformManager.sur_conj(t, hp, hc)
Conjugation transformation for surrogate output (negates hc).
- RIFT.physics.ROMWaveformManager.sur_identity(t, hp, hc)
Identity transformation for surrogate output.