29 #include <lal/SphericalHarmonics.h>
30 #include <lal/LALConstants.h>
54 #ifndef PHENOMXHMDEBUG
97 "Error: XLALIMRPhenomXPCheckMassesAndSpins failed in XLALSimIMRPhenomX_PNR_GenerateAntisymmetricWaveform.\n");
104 LALDict *lalParams_aux;
105 if (lalParams == NULL)
117 XLAL_PRINT_WARNING(
"Warning:Antisymmetric waveform generation currently not supported without PNR angles. Turning on PNR angles ... \n");
122 REAL8 fRef = (fRef_In == 0.0) ?
f_min : fRef_In;
126 size_t iStart = (size_t)(
f_min / deltaF);
127 size_t iStop = (size_t)(
f_max / deltaF) + 1;
132 "Error: the starting frequency index is greater than the stopping index! Please ensure that f_min <= f_max.\n");
140 for (
UINT4 i = iStart;
i < iStop;
i++)
142 freqs->
data[
i - iStart] =
i * deltaF;
147 status =
IMRPhenomXSetWaveformVariables(pWF, m1_SI, m2_SI, chi1z, chi2z, deltaF, fRef, phiRef,
f_min,
f_max, distance, inclination, lalParams_aux,
PHENOMXDEBUG);
152 status =
IMRPhenomXGetAndSetPrecessionVariables(pWF, pPrec, m1_SI, m2_SI, chi1x, chi1y, chi1z, chi2x, chi2y, chi2z, lalParams_aux,
DEBUG);
198 "Error: XLALIMRPhenomXPCheckMassesAndSpins failed in XLALSimIMRPhenomX_PNR_GenerateAntisymmetricAmpRatio.\n");
201 LALDict *lalParams_aux;
202 if (lalParams == NULL)
214 XLAL_PRINT_WARNING(
"Warning:Antisymmetric waveform generation currently not supported without PNR angles. Turning on PNR angles ... \n");
219 REAL8 fRef = (fRef_In == 0.0) ?
f_min : fRef_In;
223 size_t iStart = (size_t)(
f_min / deltaF);
224 size_t iStop = (size_t)(
f_max / deltaF) + 1;
229 "Error: the starting frequency index is greater than the stopping index! Please ensure that f_min <= f_max.\n");
236 REAL8 distance = 1.0;
240 for (
UINT4 i = iStart;
i < iStop;
i++)
242 (*freqs)->data[
i - iStart] =
i * deltaF;
246 REAL8 f_min_eval = (*freqs)->data[0];
247 REAL8 f_max_eval = (*freqs)->data[(*freqs)->length - 1];
252 status =
IMRPhenomXSetWaveformVariables(pWF, m1_SI, m2_SI, chi1z, chi2z, deltaF, fRef, phiRef, f_min_eval, f_max_eval, distance, inclination, lalParams_aux,
DEBUG);
257 status =
IMRPhenomXGetAndSetPrecessionVariables(pWF, pPrec, m1_SI, m2_SI, chi1x, chi1y, chi1z, chi2x, chi2y, chi2z, lalParams_aux,
DEBUG);
305 double MfT = 0.85 * pWF->
fRING;
342 double Mf = pWF->
M_sec * freqs->
data[idx];
356 else if(Mf > fPhaseIM)
366 phi += linb*Mf + lina + phiref22;
383 amp_AS = kappa->
data[idx] * amp;
388 phi_AS = phi/2 + alphaPNR->
data[idx] + A0*Mf + phi_A0;
392 phi_AS = phi + phi_B0;
398 antisymphase->
data[idx] = phi_AS;
427 const double m2 = pWF->
m2;
428 const double M = pWF->
Mtot;
431 const double MfRD = pWF->
fRING;
439 double b3 = -203.6290;
446 for (
size_t i = 0;
i < freqs->
length;
i++)
456 kappa->
data[
i] = kappaRD;
462 if(width > kappa->
length - 1)
464 width = (size_t)floor((
double)(kappa->
length) / 2.0);
466 size_t half_width = (size_t)floor((
double)(width / 2.0));
469 for (
size_t id = 0;
id < kappa->
length-width-1;
id++)
471 double smoothed_ratio = 0.0;
472 double frequency_width = 0.0;
473 for (
size_t j = 0; j < width+1; j++)
475 df = freqs->
data[
id+j+1] - freqs->
data[
id+j];
476 smoothed_ratio += (kappa->
data[
id+j]*df);
477 frequency_width += df;
479 kappa->
data[
id+half_width] = smoothed_ratio *1.0/frequency_width;
491 REAL8 kappaPNden = 2 * (42 + 84 *
LAL_PI * v3 + v2 * (55 * eta - 107) - 28 * v3 * (1 +
delta - eta) * Chi * cos (
theta ));
492 REAL8 amp_ratio = kappaPNnum/kappaPNden * (1 + b * v5 );
521 "Error: IMRPhenomX_PNR_precompute_alpha_coefficients failed.\n");
527 "Error: IMRPhenomX_PNR_alpha_connection_parameters failed.\n");
529 REAL8 phi_der_MfT = 0.0;
531 REAL8 alpha_MfT = 0.0;
532 REAL8 alpha_der_MfT = 0.0;
544 const double deltaMF = 0.0005;
545 const double Mf_right = MfT + deltaMF;
546 const double Mf_left = MfT - deltaMF;
552 if ((q <= pPrec->PNR_q_window_lower) && (chi <= pPrec->PNR_chi_window_lower))
558 else if ((q <= pPrec->PNR_q_window_upper) && (chi <= pPrec->PNR_chi_window_upper))
578 else if(MfT > fPhaseIM)
594 phi_der_MfT *= inveta;
597 phi_MfT += linb*MfT + lina + phiref22;
599 *A0 = phi_der_MfT/2 - alpha_der_MfT;
600 *phi_A0 = pPrec-> alpha_offset;
601 *phi_B0 = alpha_MfT - phi_MfT/2 + *A0 * MfT + *phi_A0;
void XLALDestroyDict(LALDict *dict)
LALDict * XLALDictDuplicate(LALDict *old)
LALDict * XLALCreateDict(void)
static double double delta
double XLALSimPhenomUtilsHztoMf(REAL8 fHz, REAL8 Mtot_Msun)
Convert from frequency in Hz to geometric frequency.
int IMRPhenomX_PNR_precompute_alpha_coefficients(IMRPhenomX_PNR_alpha_parameters *alphaParams, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
This function evaluates the coefficients outlined in Sec 7A of arXiv:2107.08876 for alpha.
REAL8 IMRPhenomX_PNR_GetPNAlphaAtFreq(REAL8 Mf, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
Here we write a wrapper function to produce either MSA or NNLO alpha for use in IMRPhenomX_PNR_Genera...
REAL8 IMRPhenomX_PNR_GeneratePNRAlphaAtMf(REAL8 Mf, const IMRPhenomX_PNR_alpha_parameters *alphaParams, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
This function evaluates Eq.
int IMRPhenomX_PNR_alpha_connection_parameters(IMRPhenomX_PNR_alpha_parameters *alphaParams, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
This function evaluates the connection frequencies Mf1 and Mf2 detailed in Sec.
REAL8 IMRPhenomX_PNR_GenerateMergedPNRAlphaAtMf(REAL8 Mf, const IMRPhenomX_PNR_alpha_parameters *alphaParams, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec)
This function generates the blended PNR and PN expressions for alpha for the transition region of par...
static double IMRPhenomX_Inspiral_Phase_22_Ansatz(double Mf, IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXPhaseCoefficients *pPhase)
static double IMRPhenomX_Inspiral_Phase_22_AnsatzInt(double Mf, IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXPhaseCoefficients *pPhase)
Ansatz for the inspiral phase.
static double IMRPhenomX_Inspiral_Amp_22_Ansatz(double Mf, IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp)
int IMRPhenomXSetWaveformVariables(IMRPhenomXWaveformStruct *wf, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi1L_In, const REAL8 chi2L_In, const REAL8 deltaF, const REAL8 fRef, const REAL8 phi0, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, const REAL8 inclination, LALDict *LALParams, UNUSED const UINT4 debug)
double IMRPhenomX_TimeShift_22(IMRPhenomXPhaseCoefficients *pPhase, IMRPhenomXWaveformStruct *pWF)
void IMRPhenomX_Phase_22_ConnectionCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase)
int IMRPhenomXGetAmplitudeCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp)
int IMRPhenomX_Initialize_Powers(IMRPhenomX_UsefulPowers *p, REAL8 number)
double IMRPhenomX_Phase_22(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXPhaseCoefficients *pPhase, IMRPhenomXWaveformStruct *pWF)
int IMRPhenomXGetPhaseCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase)
int IMRPhenomXGetAndSetPrecessionVariables(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, LALDict *lalParams, INT4 debug_flag)
Function to populate the IMRPhenomXPrecessionStruct:
static double IMRPhenomX_Ringdown_Phase_22_AnsatzInt(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase)
static double IMRPhenomX_Ringdown_Phase_22_Ansatz(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase)
static double IMRPhenomX_Ringdown_Amp_22_Ansatz(double ff, IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp)
INT4 XLALIMRPhenomXPCheckMassesAndSpins(REAL8 *m1, REAL8 *m2, REAL8 *chi1x, REAL8 *chi1y, REAL8 *chi1z, REAL8 *chi2x, REAL8 *chi2y, REAL8 *chi2z)
Check if m1 > m2.
void * XLALMalloc(size_t n)
int IMRPhenomX_PNR_GeneratePNRAlphaForAntisymmetry(REAL8Sequence *alphaPNR, const REAL8Sequence *freqs, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPrecessionStruct *pPrec, LALDict *lalParams)
Internal helper function to generate PNR alpha for the antisymmetric waveform.
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
#define XLAL_CHECK(assertion,...)
#define XLAL_PRINT_WARNING(...)
IMRPhenomXWaveformStruct * pWF22AS
REAL8 chi_singleSpin_antisymmetric
magnitude of effective single spin of a two spin system for the antisymmetric waveform
REAL8 chi_singleSpin
Magnitude of effective single spin used for tapering two-spin angles, Eq.
REAL8 theta_antisymmetric
Polar angle effective single spin for antisymmetric waveform.