Routines for NR surrogate models "NRSur7dq2" and "NRSur7dq4" | |
C code for NRSur7dq2 and NRSur7dq4 NR surrogate waveform models. NRSur7dq2: This is a fully precessing time domain model including all subdominant modes up to ell=4. See Blackman et al [2] for details. Any studies that use this waveform model should include a reference to that paper. Using this model requires the file lalsuite-extra/data/lalsimulation/NRSur7dq2.h5 Make sure your $LAL_DATA_PATH points to lalsuite-extra/data/lalsimulation/. The lalsuite-extra commit hash at the time of review was 77613e7f5f01d5ea11829ded5677783cafc0d298
NRSur7dq4: This is a q=4 extension of NRSur7dq2. See Varma et al. (arxiv:1905.09300) for details. Any studies that use this waveform model should include a reference to that paper. The binary data file (NRSur7dq4_v1.0.h5) is available at: https://git.ligo.org/waveforms/software/lalsuite-waveform-data and on Zenodo at: https://zenodo.org/records/14999310. Get the lalsuite-waveform-data repo or put the data into a location in your LAL_DATA_PATH. The data is also available on CIT at /home/lalsimulation_data and via CVMFS at /cvmfs/shared.storage.igwn.org/igwn/shared/auxiliary/obs_sci/cbc/waveform/lalsimulation_data Make sure the files are in your LAL_DATA_PATH. | |
static UNUSED bool | NRSur7dq2_IsSetup (void) |
Helper function which returns whether or not the global NRSur7dq2 surrogate data has been initialized. More... | |
static UNUSED bool | NRSur7dq4_IsSetup (void) |
Helper function which returns whether or not the global NRSur7dq4 surrogate data has been initialized. More... | |
REAL8 | ipow (REAL8 base, int exponent) |
Helper function for integer powers. More... | |
REAL8 | NRSur7dq2_eval_fit (FitData *data, REAL8 *x) |
static void | NRSur7dq2_eval_vector_fit (REAL8 *res, VectorFitData *data, REAL8 *x) |
static int | NRSur7dq4_effective_spins (REAL8 *chiHat, REAL8 *chi_a, const REAL8 q, const REAL8 chi1z, const REAL8 chi2z) |
REAL8 | NRSur7dq4_eval_fit (FitData *data, REAL8 *x) |
static void | NRSur7dq4_eval_vector_fit (REAL8 *res, VectorFitData *data, REAL8 *x) |
REAL8 | PrecessingNRSur_eval_fit (FitData *data, REAL8 *x, PrecessingNRSurData *__sur_data) |
static void | PrecessingNRSur_eval_vector_fit (REAL8 *res, VectorFitData *data, REAL8 *x, PrecessingNRSurData *__sur_data) |
static void | PrecessingNRSur_normalize_y (REAL8 chiANorm, REAL8 chiBNorm, REAL8 *y) |
static void | PrecessingNRSur_normalize_results (REAL8 normA, REAL8 normB, gsl_vector **quat, gsl_vector **chiA, gsl_vector **chiB) |
static void | PrecessingNRSur_rotate_spins (gsl_vector **chiA, gsl_vector **chiB, gsl_vector *phi_vec) |
Transforms chiA and chiB from the coprecessing frame to the coorbital frame using the orbital phase. More... | |
static void | PrecessingNRSur_ds_fit_x (REAL8 *x, REAL8 q, REAL8 *y) |
static void | PrecessingNRSur_assemble_dydt (REAL8 *dydt, REAL8 *y, REAL8 *Omega_coorb_xy, REAL8 omega, REAL8 *chiA_dot, REAL8 *chiB_dot) |
static REAL8 | cubic_interp (REAL8 xout, REAL8 *x, REAL8 *y) |
Cubic interpolation of 4 data points This gives a much closer result to scipy.interpolate.InterpolatedUnivariateSpline than using gsl_interp_cspline (see comment in spline_array_interp) More... | |
static gsl_vector * | spline_array_interp (gsl_vector *xout, gsl_vector *x, gsl_vector *y) |
Do cubic spline interpolation using a gsl_interp_cspline. More... | |
static REAL8 | PrecessingNRSur_get_omega (size_t node_index, REAL8 q, REAL8 *y0, PrecessingNRSurData *__sur_data) |
Computes the orbital angular frequency at a dynamics node. More... | |
static REAL8 | PrecessingNRSur_get_t_ref (REAL8 omega_ref, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 *init_quat, REAL8 init_orbphase, PrecessingNRSurData *__sur_data) |
Computes a reference time from a reference orbital angular frequency. More... | |
static void | PrecessingNRSur_get_time_deriv_from_index (REAL8 *dydt, int i0, REAL8 q, REAL8 *y, PrecessingNRSurData *__sur_data) |
Compute dydt at a given dynamics node, where y is the numerical solution to the dynamics ODE. More... | |
static void | PrecessingNRSur_get_time_deriv (REAL8 *dydt, REAL8 t, REAL8 q, REAL8 *y, PrecessingNRSurData *__sur_data) |
Compute dydt at any time by evaluating dydt at 4 nearby dynamics nodes and using cubic spline interpolation to evaluate at the desired time. More... | |
static int | PrecessingNRSur_initialize_at_dynamics_node (REAL8 *dynamics_data, REAL8 t_ref, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 init_orbphase, REAL8 *init_quat, REAL8 normA, REAL8 normB, PrecessingNRSurData *__sur_data) |
Initialize the dynamics ODE at a dynamics node. More... | |
static void | PrecessingNRSur_initialize_RK4_with_half_nodes (REAL8 *dynamics_data, REAL8 *time_steps, REAL8 *dydt0, REAL8 *dydt1, REAL8 *dydt2, REAL8 *dydt3, REAL8 normA, REAL8 normB, REAL8 q, PrecessingNRSurData *__sur_data) |
Initializes the AB4 ODE system from the surrogate start time by taking 3 RK4 steps, making use of the three additional half-time-step nodes for the RK4 substeps. More... | |
static int | PrecessingNRSur_initialize_RK4 (REAL8 *dynamics_data, REAL8 *time_steps, REAL8 *dydt0, REAL8 *dydt1, REAL8 *dydt2, REAL8 *dydt3, REAL8 normA, REAL8 normB, REAL8 q, int i0, PrecessingNRSurData *__sur_data) |
Initializes the AB4 ODE system from a single arbitrary dynamics node by taking 3 RK4 steps. More... | |
static void | PrecessingNRSur_integrate_AB4 (REAL8 *dynamics_data, REAL8 *time_steps, REAL8 *dydt0, REAL8 *dydt1, REAL8 *dydt2, REAL8 *dydt3, REAL8 normA, REAL8 normB, REAL8 q, int i_start, PrecessingNRSurData *__sur_data) |
Integrates the AB4 ODE system in time forwards, and backwards if needed. More... | |
static void | PrecessingNRSur_eval_data_piece (gsl_vector *result, REAL8 q, gsl_vector **chiA, gsl_vector **chiB, WaveformDataPiece *data, PrecessingNRSurData *__sur_data) |
Evaluates a single NRSur coorbital waveoform data piece. More... | |
static int | PrecessingNRSur_IntegrateDynamics (REAL8 *dynamics_data, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 omega_ref, REAL8 init_orbphase, REAL8 *init_quat, LALDict *LALparams, UINT4 PrecessingNRSurVersion) |
This is the main NRSur dynamics surrogate integration routine. More... | |
static PrecessingNRSurData * | PrecessingNRSur_LoadData (UNUSED Approximant approximant) |
Wrapper for Loading NRSur7dq2 and NRSur7dq4 data. More... | |
static PrecessingNRSurData * | PrecessingNRSur_core (MultiModalWaveform **h, REAL8 q, REAL8 *chiA0, REAL8 *chiB0, REAL8 omega_ref, REAL8 init_orbphase, REAL8 *init_quat, LALValue *ModeArray, LALDict *LALparams, Approximant approximant) |
REAL8 | PrecessingNRSur_StartFrequency (REAL8 m1, REAL8 m2, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, PrecessingNRSurData *__sur_data) |
Computes the starting frequency of the NRSur7dq2 or NRSur7dq4 waveform approximant when evaluated using fRef=0 (which uses the entire surrogate waveform starting 4500M for NRSur7dq2 and 4300M for NRSur7dq4, before the peak amplitude). More... | |
static bool | PrecessingNRSur_switch_labels_if_needed (REAL8 *m1, REAL8 *m2, REAL8 *s1x, REAL8 *s1y, REAL8 *s1z, REAL8 *s2x, REAL8 *s2y, REAL8 *s2z) |
If m1<m2, swaps the labels for the two BHs such that Bh1 is always heavier. More... | |
int | XLALSimInspiralPrecessingNRSurPolarizations (REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 inclination, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 distance, REAL8 fMin, REAL8 fRef, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, LALDict *LALparams, Approximant approximant) |
This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and sums over all ell <= 4 modes to obtain the + and x polarizations. More... | |
SphHarmTimeSeries * | XLALSimInspiralPrecessingNRSurModes (REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 fMin, REAL8 fRef, REAL8 distance, LALDict *LALparams, Approximant approximant) |
This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the inertial frame modes in the form of a SphHarmTimeSeries. More... | |
int | XLALPrecessingNRSurDynamics (gsl_vector **t_dynamics, gsl_vector **quat0, gsl_vector **quat1, gsl_vector **quat2, gsl_vector **quat3, gsl_vector **orbphase, gsl_vector **chiAx, gsl_vector **chiAy, gsl_vector **chiAz, gsl_vector **chiBx, gsl_vector **chiBy, gsl_vector **chiBz, REAL8 q, REAL8 chiA0x, REAL8 chiA0y, REAL8 chiA0z, REAL8 chiB0x, REAL8 chiB0y, REAL8 chiB0z, REAL8 omegaRef_dimless, REAL8 init_quat0, REAL8 init_quat1, REAL8 init_quat2, REAL8 init_quat3, REAL8 init_orbphase, LALDict *LALparams, Approximant approximant) |
This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the precessing frame dynamics. More... | |
|
static |
Helper function which returns whether or not the global NRSur7dq2 surrogate data has been initialized.
Definition at line 560 of file LALSimIMRPrecessingNRSur.c.
|
static |
Helper function which returns whether or not the global NRSur7dq4 surrogate data has been initialized.
Definition at line 568 of file LALSimIMRPrecessingNRSur.c.
Helper function for integer powers.
Definition at line 576 of file LALSimIMRPrecessingNRSur.c.
data | Data for fit |
x | size 7, giving mass ratio q, and dimensionless spin components |
Definition at line 596 of file LALSimIMRPrecessingNRSur.c.
|
static |
res | Result |
data | Data for fit |
x | size 7, giving mass ratio q, and dimensionless spin components |
Definition at line 636 of file LALSimIMRPrecessingNRSur.c.
|
static |
chiHat | Output: chiHat |
chi_a | Output: chi_a |
q | Mass ratio >= 1 |
chi1z | Dimensionless z-spin of heavier BH |
chi2z | Dimensionless z-spin of lighter BH |
Definition at line 679 of file LALSimIMRPrecessingNRSur.c.
data | Data for fit |
x | size 7, giving mass ratio q, and dimensionless spin components |
Definition at line 699 of file LALSimIMRPrecessingNRSur.c.
|
static |
res | Result |
data | Data for fit |
x | size 7, giving mass ratio q, and dimensionless spin components |
Definition at line 757 of file LALSimIMRPrecessingNRSur.c.
REAL8 PrecessingNRSur_eval_fit | ( | FitData * | data, |
REAL8 * | x, | ||
PrecessingNRSurData * | __sur_data | ||
) |
data | Data for fit |
x | size 7, giving mass ratio q, and dimensionless spin components |
__sur_data | Loaded surrogate data |
Definition at line 772 of file LALSimIMRPrecessingNRSur.c.
|
static |
res | Result |
data | Data for fit |
x | size 7, giving mass ratio q, and dimensionless spin components |
__sur_data | Loaded surrogate data |
Definition at line 789 of file LALSimIMRPrecessingNRSur.c.
chiANorm | ||vec{chi}_A|| |
chiBNorm | ||vec{chi}_B|| |
y | [q0, qx, qy, qz, phi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] |
Definition at line 809 of file LALSimIMRPrecessingNRSur.c.
|
static |
normA | ||vec{chi}_A|| |
normB | ||vec{chi}_B|| |
quat | The four quaternion time-dependent components |
chiA | Time-dependent components of chiA |
chiB | Time-dependent components of chiB |
Definition at line 853 of file LALSimIMRPrecessingNRSur.c.
|
static |
Transforms chiA and chiB from the coprecessing frame to the coorbital frame using the orbital phase.
chiA | 3 time-dependent components of chiA in the coorbital frame |
chiB | 3 time-dependent components of chiB in the coorbital frame |
phi_vec | The time-dependent orbital phase |
Definition at line 905 of file LALSimIMRPrecessingNRSur.c.
x | Result, length 7 |
q | Mass ratio |
y | [q0, qx, qy, qz, phi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] |
Definition at line 942 of file LALSimIMRPrecessingNRSur.c.
|
static |
dydt | Result, length 11 |
y | ODE solution at the current time step |
Omega_coorb_xy | a form of time derivative of the coprecessing frame |
omega | orbital angular frequency in the coprecessing frame |
chiA_dot | chiA time derivative |
chiB_dot | chiB time derivative |
Definition at line 970 of file LALSimIMRPrecessingNRSur.c.
Cubic interpolation of 4 data points This gives a much closer result to scipy.interpolate.InterpolatedUnivariateSpline than using gsl_interp_cspline (see comment in spline_array_interp)
xout | The target x value |
x | The x values of the points to interpolate. Length 4, must be increasing. |
y | The y values of the points to interpolate. Length 4. |
Definition at line 1010 of file LALSimIMRPrecessingNRSur.c.
|
static |
Do cubic spline interpolation using a gsl_interp_cspline.
Results differ from scipy.interpolate.InterpolatedUnivariateSpline due to different boundary conditions. This difference leads to small differences between this implementation and the python implementation, especially near the start and end of the waveform.
xout | The vector of points onto which we want to interpolate. |
x | The x values of the data to interpolate. |
y | The y values of the data to interpolate. |
Definition at line 1030 of file LALSimIMRPrecessingNRSur.c.
|
static |
Computes the orbital angular frequency at a dynamics node.
node_index | The index of the dynamics node. |
q | The mass ratio. |
y0 | The value of the ODE state y = [q0, qx, qy, qz, orbphase, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] |
__sur_data | Loaded surrogate data |
Definition at line 1053 of file LALSimIMRPrecessingNRSur.c.
|
static |
Computes a reference time from a reference orbital angular frequency.
omega_ref | reference orbital angular frequency |
q | mass ratio |
chiA0 | chiA at reference point |
chiB0 | chiB at reference point |
init_quat | coprecessing frame quaternion at reference point |
init_orbphase | orbital phase at reference point |
__sur_data | Loaded surrogate data |
Definition at line 1069 of file LALSimIMRPrecessingNRSur.c.
|
static |
Compute dydt at a given dynamics node, where y is the numerical solution to the dynamics ODE.
dydt | Output: dy/dt evaluated at the ODE time node with index i0. Must have space for 11 entries. |
i0 | Time node index. i0=-1, -2, and -3 are used for time nodes 1/2, 3/2, and 5/2 respectively. |
q | Mass ratio |
y | Current ODE state: [q0, qx, qy, qz, orbphase, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] |
__sur_data | Loaded surrogate data |
Definition at line 1134 of file LALSimIMRPrecessingNRSur.c.
|
static |
Compute dydt at any time by evaluating dydt at 4 nearby dynamics nodes and using cubic spline interpolation to evaluate at the desired time.
dydt | Output: dy/dt evaluated at time t. Must have space for 11 entries. |
t | Time at which the ODE should be evaluated. |
q | Mass ratio |
y | Current ODE state |
__sur_data | Loaded surrogate data |
Definition at line 1169 of file LALSimIMRPrecessingNRSur.c.
|
static |
Initialize the dynamics ODE at a dynamics node.
Given t_ref, finds the nearest dynamics node and integrates the initial conditions at t_ref a tiny bit to obtain the ODE state at the dynamics node.
dynamics_data | ODE output |
t_ref | reference time. t_ds[i0] will be close to t_ref. |
q | mass ratio |
chiA0 | chiA at t_ref. |
chiB0 | chiB at t_ref. |
init_orbphase | orbital phase at t_ref. |
init_quat | quaternion at t_ref. |
normA | |chiA| |
normB | |chiB| |
__sur_data | Loaded surrogate data |
Definition at line 1221 of file LALSimIMRPrecessingNRSur.c.
|
static |
Initializes the AB4 ODE system from the surrogate start time by taking 3 RK4 steps, making use of the three additional half-time-step nodes for the RK4 substeps.
This is the recommended way to initialize the AB4 ODE system - the additional nodes are there to increase accuracy during initialization. The drawback is that we are forced to accept fRef to be the surrogate start frequency, which will depend on masses and spins. The ODE system is for the vector of 11 quantities: [q0, qx, qy, qz, varphi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] where (q0, qx, qy, qz) is the coprecessing frame quaternion, varphi is the orbital phase, and the spin components are in the coprecessing frame.
dynamics_data | A pointer to the start of the ODE output; the first 11 entries (for node 0) should have already been set. |
time_steps | Output: first three time steps. Should have size 3. |
dydt0 | Output: dydt at node 0. Should have size 11. |
dydt1 | Output: dydt at node 1. Should have size 11. |
dydt2 | Output: dydt at node 2. Should have size 11. |
dydt3 | Output: dydt at node 3. Should have size 11. |
normA | |chiA| |
normB | |chiB| |
q | mass ratio |
__sur_data | Loaded surrogate data |
Definition at line 1299 of file LALSimIMRPrecessingNRSur.c.
|
static |
Initializes the AB4 ODE system from a single arbitrary dynamics node by taking 3 RK4 steps.
Compared to PrecessingNRSur_initialize_RK4_with_half_nodes, this may be slightly less accurate and slightly more time consuming as we must interpolate many dynamics node fit evaluations, but this is more flexible as we can initialize from any node instead of just node 0.
dynamics_data | A pointer to the start of the ODE output. Entries with i0*11 <= i < (i0+1)*11 should have already be computed. |
time_steps | Output: first three time steps. Should have size 3. |
dydt0 | Output: dydt at node i0 + 0. Should have size 11. |
dydt1 | Output: dydt at node i0 + 1. Should have size 11. |
dydt2 | Output: dydt at node i0 + 2. Should have size 11. |
dydt3 | Output: dydt at node i0 + 3. Should have size 11. |
normA | |chiA| |
normB | |chiB| |
q | mass ratio |
i0 | the node that is already initialized |
__sur_data | Loaded surrogate data |
Definition at line 1378 of file LALSimIMRPrecessingNRSur.c.
|
static |
Integrates the AB4 ODE system in time forwards, and backwards if needed.
The system should have already been initialized at 4 adjacent dynamics nodes. Output is a flattened array where entries i*11 <= j < (i+1)*11 are [q0, qx, qy, qz, varphi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] at dynamics node i, where (q0, qx, qy, qz) is the coprecessing frame quaternion, varphi is the orbital phase, and the spin components are in the coprecessing frame.
dynamics_data | ODE output |
time_steps | The first three time steps beginning at i_start. |
dydt0 | dydt at node i_start |
dydt1 | dydt at node i_start + 1 |
dydt2 | dydt at node i_start + 2 |
dydt3 | dydt at node i_start + 3 |
normA | |chiA| |
normB | |chiB| |
q | mass ratio |
i_start | nodes i_start through i_start+3 are already initialized |
__sur_data | Loaded surrogate data |
Definition at line 1520 of file LALSimIMRPrecessingNRSur.c.
|
static |
Evaluates a single NRSur coorbital waveoform data piece.
The dynamics ODE must have already been solved, since this requires the spins evaluated at all of the empirical nodes for this waveform data piece.
result | Output: Should have already been assigned space |
q | Mass ratio |
chiA | 3 gsl_vector *s, one for each (coorbital) component |
chiB | similar to chiA |
data | The data piece to evaluate |
__sur_data | Loaded surrogate data |
Definition at line 1630 of file LALSimIMRPrecessingNRSur.c.
|
static |
This is the main NRSur dynamics surrogate integration routine.
Given omega_ref and the system parameters at omega_ref, we find the corresponding t_ref and first (if needed) take a tiny time step and evolve the system to the nearest dynamics node. We then initialize the AB4 ODE system at 4 consecutive dynamics nodes by taking 3 RK4 steps. Finally, we integrate forwards (and backwards if needed) to obtain the solution at all dynamics nodes. Output is a flattened array where entries i*11 <= j < (i+1)*11 are [q0, qx, qy, qz, varphi, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz] at dynamics node i, where (q0, qx, qy, qz) is the coprecessing frame quaternion, varphi is the orbital phase, and the spin components are in the coprecessing frame.
dynamics_data | Output: length (n_dynamics_nodes * 11) |
q | Mass ratio mA / mB |
chiA0 | chiA at the reference point |
chiB0 | chiB at the reference point |
omega_ref | orbital angular frequency at reference point |
init_orbphase | orbital phase at the reference point |
init_quat | coprecessing quaterion at the reference point |
LALparams | Dict with extra parameters |
PrecessingNRSurVersion | 0 for NRSur7dq2, 1 for NRSur7dq4 |
Definition at line 1675 of file LALSimIMRPrecessingNRSur.c.
|
static |
Wrapper for Loading NRSur7dq2 and NRSur7dq4 data.
Calls NRSur7dq2_Init_LALDATA() or NRSur7dq4_Init_LALDATA() if surrogate data is not already loaded, and returns loaded surrogate data. If surrogate data is already loaded, just returns the loaded data.
approximant | approximant (NRSur7dq2 or NRSur7dq4) |
Definition at line 1797 of file LALSimIMRPrecessingNRSur.c.
|
static |
h | Output. Dimensionless waveform modes sampled on t_coorb |
q | Mass ratio mA / mB |
chiA0 | chiA at the reference point |
chiB0 | chiB at the reference point |
omega_ref | orbital angular frequency at the reference point |
init_orbphase | orbital phase at the reference point |
init_quat | coprecessing quaterion at the reference point |
ModeArray | Container for the ell and m co-orbital modes to generate |
LALparams | Dict with extra parameters |
approximant | approximant (NRSur7dq2 or NRSur7dq4) |
Definition at line 1848 of file LALSimIMRPrecessingNRSur.c.
REAL8 PrecessingNRSur_StartFrequency | ( | REAL8 | m1, |
REAL8 | m2, | ||
REAL8 | s1x, | ||
REAL8 | s1y, | ||
REAL8 | s1z, | ||
REAL8 | s2x, | ||
REAL8 | s2y, | ||
REAL8 | s2z, | ||
PrecessingNRSurData * | __sur_data | ||
) |
Computes the starting frequency of the NRSur7dq2 or NRSur7dq4 waveform approximant when evaluated using fRef=0 (which uses the entire surrogate waveform starting 4500M for NRSur7dq2 and 4300M for NRSur7dq4, before the peak amplitude).
m1 | mass of companion 1 (kg) |
m2 | mass of companion 2 (kg) |
s1x | initial value of S1x |
s1y | initial value of S1y |
s1z | initial value of S1z |
s2x | initial value of S2x |
s2y | initial value of S2y |
s2z | initial value of S2z |
__sur_data | Loaded surrogate data |
Definition at line 2021 of file LALSimIMRPrecessingNRSur.c.
|
static |
If m1<m2, swaps the labels for the two BHs such that Bh1 is always heavier.
Then rotates the in-plane spins by pi. These two together are the same as a rigid rotation of the system by pi. This rotation will be undone by multiplying the odd-m modes by a minus sign after the modes are generated.
m1 | Input and Output. mass of companion 1 (kg) |
m2 | Input and Output. mass of companion 2 (kg) |
s1x | Input and Output. S1x at reference epoch |
s1y | Input and Output. S1y at reference epoch |
s1z | Input and Output. S1z at reference epoch |
s2x | Input and Output. S2x at reference epoch |
s2y | Input and Output. S2y at reference epoch |
s2z | Input and Output. S2z at reference epoch |
Definition at line 2059 of file LALSimIMRPrecessingNRSur.c.
int XLALSimInspiralPrecessingNRSurPolarizations | ( | REAL8TimeSeries ** | hplus, |
REAL8TimeSeries ** | hcross, | ||
REAL8 | phiRef, | ||
REAL8 | inclination, | ||
REAL8 | deltaT, | ||
REAL8 | m1, | ||
REAL8 | m2, | ||
REAL8 | distance, | ||
REAL8 | fMin, | ||
REAL8 | fRef, | ||
REAL8 | s1x, | ||
REAL8 | s1y, | ||
REAL8 | s1z, | ||
REAL8 | s2x, | ||
REAL8 | s2y, | ||
REAL8 | s2z, | ||
LALDict * | LALparams, | ||
Approximant | approximant | ||
) |
This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and sums over all ell <= 4 modes to obtain the + and x polarizations.
Papers: NRSur7dq2: https://arxiv.org/abs/1705.07089 NRSur7dq4: https://arxiv.org/abs/1905.09300
The system is initialized at a time where the orbital frequency of the waveform in the coprecessing frame (Eq.11 of https://arxiv.org/abs/1705.07089) is pi * fRef. At this reference point, the system is initialized in the coorbital frame, with the z-axis along the principal eigenvector of the angular momentum operator acting on the waveform, the x-axis along the line of separation from the lighter BH to the heavier BH, and the y-axis completing the triad. The polarizations of the waveform are returned in the sky of this frame at (inclination, pi/2 - phiRef). This agrees with the LAL convention.
Extra options are passed through a LALDict: dictParams = lal.CreateDict()
ma=lalsim.SimInspiralCreateModeArray()
1a. If you want all models upto ellMax:
for ell in range(2, ellMax+1): lalsim.SimInspiralModeArrayActivateAllModesAtL(ma, ell)
lalsim.SimInspiralWaveformParamsInsertModeArray(dictParams, ma)
1b. If you want only a single mode:
lalsim.SimInspiralModeArrayActivateMode(ma, l, m) lalsim.SimInspiralModeArrayActivateMode(ma, l, -m)
lalsim.SimInspiralWaveformParamsInsertModeArray(params, ma)
Extrapolation: The surrogate models are trained on the following ranges. NRSur7dq2: q <= 2.01, |chi_1|, |chi_2| <= 0.81. NRSur7dq4: q <= 4.01, |chi_1|, |chi_2| <= 0.81. If you want a guarantee of accuracy you should stick to the above ranges.
We allow extrapolation to the following ranges, but with a warning: NRSur7dq2: q <= 3.01, |chi_1|, |chi_2| <= 1. NRSur7dq4: q <= 6.01, |chi_1|, |chi_2| <= 1. We expect the models to be reasonable when extrapolated to these ranges.
Beyond the above ranges, we raise an error. If you want to extrapolate beyond these limits you can specify unlimited_extrapolation = 1 in your dictParams as follows:
lal.DictInsertUINT4Value(dictParams, "unlimited_extrapolation", 1)
hplus | OUTPUT h_+ vector |
hcross | OUTPUT h_x vector |
phiRef | azimuthal angle for Ylms |
inclination | inclination angle |
deltaT | sampling interval (s) |
m1 | mass of companion 1 (kg) |
m2 | mass of companion 2 (kg) |
distance | distance of source (m) |
fMin | start GW frequency (Hz) |
fRef | reference GW frequency (Hz) |
s1x | initial value of S1x |
s1y | initial value of S1y |
s1z | initial value of S1z |
s2x | initial value of S2x |
s2y | initial value of S2y |
s2z | initial value of S2z |
LALparams | Dict with extra parameters |
approximant | approximant (NRSur7dq2 or NRSur7dq4) |
Definition at line 2154 of file LALSimIMRPrecessingNRSur.c.
SphHarmTimeSeries * XLALSimInspiralPrecessingNRSurModes | ( | REAL8 | deltaT, |
REAL8 | m1, | ||
REAL8 | m2, | ||
REAL8 | S1x, | ||
REAL8 | S1y, | ||
REAL8 | S1z, | ||
REAL8 | S2x, | ||
REAL8 | S2y, | ||
REAL8 | S2z, | ||
REAL8 | fMin, | ||
REAL8 | fRef, | ||
REAL8 | distance, | ||
LALDict * | LALparams, | ||
Approximant | approximant | ||
) |
This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the inertial frame modes in the form of a SphHarmTimeSeries.
Papers: NRSur7dq2: https://arxiv.org/abs/1705.07089 NRSur7dq4: https://arxiv.org/abs/1905.09300
The system is initialized at a time where the orbital frequency of the waveform in the coprecessing frame (Eq.11 of https://arxiv.org/abs/1705.07089) is pi * fRef. At this reference point, the system is initialized in the coorbital frame, with the z-axis along the principal eigenvector of the angular momentum operator acting on the waveform, the x-axis along the line of separation from the lighter BH to the heavier BH, and the y-axis completing the triad. The modes are returned in this frame, which agrees with the LAL convention. When combining the modes to get the polarizations, the Ylms should be evaluated at (inclination, pi/2 - phiRef), following the LAL convention.
Extra options are passed through a LALDict: dictParams = lal.CreateDict()
ma=lalsim.SimInspiralCreateModeArray()
1a. If you want all models upto ellMax:
for ell in range(2, ellMax+1): lalsim.SimInspiralModeArrayActivateAllModesAtL(ma, ell)
lalsim.SimInspiralWaveformParamsInsertModeArray(dictParams, ma)
1b. If you want only a single mode:
lalsim.SimInspiralModeArrayActivateMode(ma, l, m) lalsim.SimInspiralModeArrayActivateMode(ma, l, -m)
lalsim.SimInspiralWaveformParamsInsertModeArray(params, ma)
Extrapolation: The surrogate models are trained on the following ranges. NRSur7dq2: q <= 2.01, |chi_1|, |chi_2| <= 0.81. NRSur7dq4: q <= 4.01, |chi_1|, |chi_2| <= 0.81. If you want a guarantee of accuracy you should stick to the above ranges.
We allow extrapolation to the following ranges, but with a warning: NRSur7dq2: q <= 3.01, |chi_1|, |chi_2| <= 1. NRSur7dq4: q <= 6.01, |chi_1|, |chi_2| <= 1. We expect the models to be reasonable when extrapolated to these ranges.
Beyond the above ranges, we raise an error. If you want to extrapolate beyond these limits you can specify unlimited_extrapolation = 1 in your dictParams as follows:
lal.DictInsertUINT4Value(dictParams, "unlimited_extrapolation", 1)
deltaT | sampling interval (s) |
m1 | mass of companion 1 (kg) |
m2 | mass of companion 2 (kg) |
S1x | x-component of the dimensionless spin of object 1 |
S1y | y-component of the dimensionless spin of object 1 |
S1z | z-component of the dimensionless spin of object 1 |
S2x | x-component of the dimensionless spin of object 2 |
S2y | y-component of the dimensionless spin of object 2 |
S2z | z-component of the dimensionless spin of object 2 |
fMin | start GW frequency (Hz) |
fRef | reference GW frequency (Hz) |
distance | distance of source (m) |
LALparams | Dict with extra parameters |
approximant | approximant (NRSur7dq2 or NRSur7dq4) |
Definition at line 2423 of file LALSimIMRPrecessingNRSur.c.
int XLALPrecessingNRSurDynamics | ( | gsl_vector ** | t_dynamics, |
gsl_vector ** | quat0, | ||
gsl_vector ** | quat1, | ||
gsl_vector ** | quat2, | ||
gsl_vector ** | quat3, | ||
gsl_vector ** | orbphase, | ||
gsl_vector ** | chiAx, | ||
gsl_vector ** | chiAy, | ||
gsl_vector ** | chiAz, | ||
gsl_vector ** | chiBx, | ||
gsl_vector ** | chiBy, | ||
gsl_vector ** | chiBz, | ||
REAL8 | q, | ||
REAL8 | chiA0x, | ||
REAL8 | chiA0y, | ||
REAL8 | chiA0z, | ||
REAL8 | chiB0x, | ||
REAL8 | chiB0y, | ||
REAL8 | chiB0z, | ||
REAL8 | omegaRef_dimless, | ||
REAL8 | init_quat0, | ||
REAL8 | init_quat1, | ||
REAL8 | init_quat2, | ||
REAL8 | init_quat3, | ||
REAL8 | init_orbphase, | ||
LALDict * | LALparams, | ||
Approximant | approximant | ||
) |
This function evaluates the NRSur7dq2 or NRSur7dq4 surrogate model and returns the precessing frame dynamics.
Papers: NRSur7dq2: https://arxiv.org/abs/1705.07089 NRSur7dq4: https://arxiv.org/abs/1905.09300
Example usage: t_dynamics, quat0, quat1, quat2, quat3, orbphase, chiAx, chiAy, chiAz, chiBx, chiBy, chiBz = lalsim.PrecessingNRSurDynamics( q, chiA0x, chiA0y, chiA0z, chiB0x, chiB0y, chiB0z, omegaRef_dimless, init_quat0, init_quat1, init_quat2, init_quat3, init_orbphase, LALparams, approxTag)
INPUTS: q mass ratio, mA/mB >= 1. chiA0x chiA0y chiA0z spin of the heavier BH at the reference epoch, in the coorbital frame, as defined in the above papers. This agrees with the LAL convention, see LALSimInspiral.h for definition of the LAL frame. chiB0x chiB0y chiB0z spin of the lighter BH at the reference epoch, in the coorbital frame. omegaRef_dimless reference dimensionless orbital frequency in the coprecessing frame, this is used to set the reference epoch. The coprecessing frame is defined in the above papers. init_quat0 init_quat1 init_quat2 init_quat3 coprecessing frame quaternion at the reference epoch. To follow the LAL convention this should be [1, 0, 0, 0], but the surrogate allows arbitrary unit quaternions. init_orbphase orbital phase in the coprecessing frame at the reference epoch. To follow the LAL convention this should be 0, but the surrogate allows arbitrary initial orbital phase. LALparams LAL dictionary containing additional parameters, if required. Initialized with: LALparams = lal.CreateDict()
Extrapolation options: The surrogate models are trained on the following ranges: NRSur7dq2: q <= 2.01, |chi_1|, |chi_2| <= 0.81. NRSur7dq4: q <= 4.01, |chi_1|, |chi_2| <= 0.81. If you want a guarantee of accuracy you should stick to the above ranges.
We allow extrapolation to the following ranges, but with a warning: NRSur7dq2: q <= 3.01, |chi_1|, |chi_2| <= 1. NRSur7dq4: q <= 6.01, |chi_1|, |chi_2| <= 1. We expect the models to be reasonable when extrapolated to these ranges.
Beyond the above ranges, we raise an error. If you want to extrapolate beyond these limits you can specify unlimited_extrapolation = 1 in your LALparams as follows: USE AT YOUR OWN RISK!! lal.DictInsertUINT4Value(LALparams,"unlimited_extrapolation",1) approxTag LAL object specifying the surrogate model to use. Example: approxTag = lalsim.SimInspiralGetApproximantFromString('NRSur7dq4') OUTPUTS: t_dynamics time values at which the dynamics are returned. These are the dynamics time nodes as described in the above papers and are nonuniform and sparse. quat0 quat1 quat2 quat3 time series of coprecessing frame quaternions. These are used to transform between the inertial frame and the coprecessing frames. orbphase orbital phase time series in the coprecessing frame. This is used to transform between the coprecessing and the coorbital frames. chiAx chiAy chiAz time series of spin of the heavier BH in the coprecessing frame. For convenience for the main use case with surrogate remnant fits, these are in coprecessing frame rather then the reference frame in which the input spins are specified. chiBx chiBy chiBz time series of spin of the heavier BH in the coprecessing frame.
t_dynamics | Output: Time array at which the dynamics are returned. |
quat0 | Output: Time series of 0th index of coprecessing frame quaternion. |
quat1 | Output: Time series of 1st index of coprecessing frame quaternion. |
quat2 | Output: Time series of 2nd index of coprecessing frame quaternion. |
quat3 | Output: Time series of 3rd index of coprecessing frame quaternion. |
orbphase | Output: Time series of orbital phase in the coprecessing frame. |
chiAx | Output: Time series of x-comp of dimensionless spin of BhA in the coprecessing frame. |
chiAy | Output: Time series of y-comp of dimensionless spin of BhA in the coprecessing frame. |
chiAz | Output: Time series of z-comp of dimensionless spin of BhA in the coprecessing frame. |
chiBx | Output: Time series of x-comp of dimensionless spin of BhB in the coprecessing frame. |
chiBy | Output: Time series of y-comp of dimensionless spin of BhB in the coprecessing frame. |
chiBz | Output: Time series of z-comp of dimensionless spin of BhB in the coprecessing frame. |
q | mass ratio m1/m2 >= 1. |
chiA0x | x-comp of dimensionless spin of BhA in the coorbital frame at the reference epoch. |
chiA0y | y-comp of dimensionless spin of BhA in the coorbital frame at the reference epoch. |
chiA0z | z-comp of dimensionless spin of BhA in the coorbital frame at the reference epoch. |
chiB0x | x-comp of dimensionless spin of BhB in the coorbital frame at the reference epoch. |
chiB0y | y-comp of dimensionless spin of BhB in the coorbital frame at the reference epoch. |
chiB0z | z-comp of dimensionless spin of BhB in the coorbital frame at the reference epoch. |
omegaRef_dimless | Dimensionless orbital frequency (rad/M) in the coprecessing frame at the reference epoch. |
init_quat0 | 0th comp of the coprecessing frame quaternion at the reference epoch. |
init_quat1 | 1st comp of the coprecessing frame quaternion at the reference epoch. |
init_quat2 | 2nd comp of the coprecessing frame quaternion at the reference epoch. |
init_quat3 | 3rd comp of the coprecessing frame quaternion at the reference epoch. |
init_orbphase | orbital phase in the coprecessing frame at the reference epoch. |
LALparams | Dict with extra parameters. |
approximant | approximant (NRSur7dq2 or NRSur7dq4). |
Definition at line 2696 of file LALSimIMRPrecessingNRSur.c.