Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALSimInspiralGeneratorLegacy.c
Go to the documentation of this file.
1#include <lal/LALStdlib.h>
2#include <lal/LALSimInspiral.h>
3#include <lal/LALDict.h>
5#include <lal/LALSimIMR.h>
9#include "rotation_macros.h"
11
12#include <lal/FrequencySeries.h>
13#include <lal/AVFactories.h>
14
15#ifdef __GNUC__
16#define UNUSED __attribute__ ((unused))
17#else
18#define UNUSED
19#endif
20
21
23 REAL8TimeSeries **hplus,
24 REAL8TimeSeries **hcross,
25 REAL8 m1,
26 REAL8 m2,
27 REAL8 S1x,
28 REAL8 S1y,
29 REAL8 S1z,
30 REAL8 S2x,
31 REAL8 S2y,
32 REAL8 S2z,
33 REAL8 distance,
34 REAL8 inclination,
35 REAL8 phiRef,
36 REAL8 longAscNodes,
37 REAL8 eccentricity,
38 REAL8 meanPerAno,
41 REAL8 f_ref,
42 LALDict *params,
44);
45
47 COMPLEX16FrequencySeries ** hptilde,
48 COMPLEX16FrequencySeries ** hctilde,
49 REAL8 m1,
50 REAL8 m2,
51 REAL8 S1x,
52 REAL8 S1y,
53 REAL8 S1z,
54 REAL8 S2x,
55 REAL8 S2y,
56 REAL8 S2z,
57 REAL8 distance,
58 REAL8 inclination,
59 REAL8 phiRef,
60 REAL8 longAscNodes,
61 REAL8 eccentricity,
62 REAL8 meanPerAno,
63 REAL8 deltaF,
66 REAL8 f_ref,
67 LALDict * params,
69);
70
72 REAL8 phiRef,
74 REAL8 m1,
75 REAL8 m2,
76 REAL8 S1x,
77 REAL8 S1y,
78 REAL8 S1z,
79 REAL8 S2x,
80 REAL8 S2y,
81 REAL8 S2z,
83 REAL8 f_ref,
84 REAL8 r,
85 LALDict * LALpars,
86 int lmax,
88);
89
91 REAL8 m1,
92 REAL8 m2,
93 REAL8 S1x,
94 REAL8 S1y,
95 REAL8 S1z,
96 REAL8 S2x,
97 REAL8 S2y,
98 REAL8 S2z,
99 REAL8 deltaF,
100 REAL8 f_min,
101 REAL8 f_max,
102 REAL8 f_ref,
103 REAL8 phiRef,
104 REAL8 distance,
105 REAL8 inclination,
106 LALDict * params,
108);
109
110/**
111 * Method to initialize generator. This activates the conditioning for proper Fourier transform in the option `condition` is on in the LALDict
112 */
113
114static int initialize(LALSimInspiralGenerator * myself, LALDict *params)
115{
116 if (params && XLALDictContains(params, "condition")) {
117 int condition;
118 int errnum;
119 XLAL_TRY(condition = XLALDictLookupINT4Value(params, "condition"), errnum);
120 if (errnum)
121 XLAL_ERROR(errnum);
122 if (condition) {
123 Approximant approximant = *(Approximant *)myself->internal_data;
125 }
126 }
127 return 0;
128}
129
130/**
131 * Define waveform generator methods to generate polarizations or modes in time or Fourier domain for legacy approximants
132 */
133
134/** Fourier domain modes */
137 LALDict *params,
138 LALSimInspiralGenerator *myself
139)
140{
141 REAL8 m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, deltaF, f_min, f_max, f_ref, phiRef, distance, inclination;
143
144 /* approximant for this generator */
145 approximant = *(Approximant *)myself->internal_data;
146
147 XLALSimInspiralParseDictionaryToChooseFDModes(&m1, &m2, &S1x, &S1y, &S1z, &S2x, &S2y, &S2z, &deltaF, &f_min, &f_max, &f_ref, &phiRef, &distance, &inclination, params);
148
149 *hlm = XLALSimInspiralChooseFDModes_legacy(m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, deltaF, f_min, f_max, f_ref, phiRef, distance, inclination, params, approximant);
150
151 return 0;
152}
153
154/** Fourier domain polarizations */
158 LALDict *params,
159 LALSimInspiralGenerator *myself
160)
161{
162 REAL8 m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaF, f_min, f_max, f_ref;
164
165 /* approximant for this generator */
166 approximant = *(Approximant *)myself->internal_data;
167
168 XLALSimInspiralParseDictionaryToChooseFDWaveform(&m1, &m2, &S1x, &S1y, &S1z, &S2x, &S2y, &S2z, &distance, &inclination, &phiRef, &longAscNodes, &eccentricity, &meanPerAno, &deltaF, &f_min, &f_max, &f_ref, params);
169
170 return XLALSimInspiralChooseFDWaveform_legacy(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaF, f_min, f_max, f_ref, params, approximant);
171}
172
173/** Time domain modes */
175 SphHarmTimeSeries **hlm,
176 LALDict *params,
177 LALSimInspiralGenerator *myself
178)
179{
180 REAL8 phiRef, deltaT, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, f_min, f_ref, distance;
181 INT4 lmax;
183
184 /* approximant for this generator */
185 approximant = *(Approximant *)myself->internal_data;
186
187 XLALSimInspiralParseDictionaryToChooseTDModes(&phiRef, &deltaT, &m1, &m2, &S1x, &S1y, &S1z, &S2x, &S2y, &S2z, &f_min, &f_ref, &distance, &lmax, params);
188
189 *hlm = XLALSimInspiralChooseTDModes_legacy(phiRef, deltaT, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, f_min, f_ref, distance, params, lmax, approximant);
190
191 return 0;
192}
193
194/** Time domain polarizations */
196 REAL8TimeSeries **hplus,
197 REAL8TimeSeries **hcross,
198 LALDict *params,
199 LALSimInspiralGenerator *myself
200)
201{
202 REAL8 m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref;
204
205 /* approximant for this generator */
206 approximant = *(Approximant *)myself->internal_data;
207
208 /* read parameters needed for ChooseTDWaveform from lal dictionary */
209 XLALSimInspiralParseDictionaryToChooseTDWaveform(&m1, &m2, &S1x, &S1y, &S1z, &S2x, &S2y, &S2z, &distance, &inclination, &phiRef, &longAscNodes, &eccentricity, &meanPerAno, &deltaT, &f_min, &f_ref, params);
210
211 return XLALSimInspiralChooseTDWaveform_legacy(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
212}
213
214/**
215 * Define which methods are supported by every legacy approximant
216 */
217
218#define DEFINE_GENERATOR_TEMPLATE(approx, fd_modes, fd_waveform, td_modes, td_waveform) \
219 static Approximant _lal ## approx ## GeneratorInternalData = approx; \
220 const LALSimInspiralGenerator lal ## approx ## GeneratorTemplate = { \
221 .name = #approx, \
222 .initialize = initialize, \
223 .finalize = NULL, \
224 .generate_fd_modes = fd_modes, \
225 .generate_fd_waveform = fd_waveform, \
226 .generate_td_modes = td_modes, \
227 .generate_td_waveform = td_waveform, \
228 .internal_data = &_lal ## approx ## GeneratorInternalData \
229 };
230
231/* TD POLARIZATIONS ONLY */
255
256/* TD POLARIZATIONS AND MODES ONLY */
275
276/* FD POLARIZATIONS ONLY */
301
302/* FD POLARIZATIONS AND MODES ONLY */
305
306/* TD AND FD POLARIZATIONS ONLY */
327
328/* TD POLARIZATIONS AND FD POLARIZATIONS AND MODES ONLY */
335
336
337/**
338 * Copy of the old code of XLALSimInspiralChooseTDWaveform(). The new version of XLALSimInspiralChooseTDWaveform() is just a wrapper over XLALSimInspiralGenerateTDWaveform().
339 * XLALSimInspiralGenerateTDWaveform() internally calls this function for legacy approximants.
340 */
342 REAL8TimeSeries **hplus, /* +-polarization waveform */
343 REAL8TimeSeries **hcross, /* x-polarization waveform */
344 REAL8 m1, /* mass of companion 1 (kg) */
345 REAL8 m2, /* mass of companion 2 (kg) */
346 REAL8 S1x, /* x-component of the dimensionless spin of object 1 */
347 REAL8 S1y, /* y-component of the dimensionless spin of object 1 */
348 REAL8 S1z, /* z-component of the dimensionless spin of object 1 */
349 REAL8 S2x, /* x-component of the dimensionless spin of object 2 */
350 REAL8 S2y, /* y-component of the dimensionless spin of object 2 */
351 REAL8 S2z, /* z-component of the dimensionless spin of object 2 */
352 REAL8 distance, /* distance of source (m) */
353 REAL8 inclination, /* inclination of source (rad) */
354 REAL8 phiRef, /* reference orbital phase (rad) */
355 REAL8 longAscNodes, /* longitude of ascending nodes, degenerate with the polarization angle, Omega in documentation */
356 REAL8 eccentricity, /* eccentrocity at reference epoch */
357 REAL8 meanPerAno, /* mean anomaly of periastron */
358 REAL8 deltaT, /* sampling interval (s) */
359 REAL8 f_min, /* starting GW frequency (Hz) */
360 REAL8 f_ref, /* reference GW frequency (Hz) */
361 LALDict *params, /* LAL dictionary containing accessory parameters */
362 Approximant approximant /* post-Newtonian approximant to use for waveform production */
363
364)
365{
366 REAL8 LNhatx, LNhaty, LNhatz, E1x, E1y, E1z;
367 //REAL8 tmp1, tmp2;
368 int ret;
369 /* N.B. the quadrupole of a spinning compact body labeled by A is
370 * Q_A = - quadparam_A chi_A^2 m_A^3 (see gr-qc/9709032)
371 * where quadparam = 1 for BH ~= 4-8 for NS.
372 * This affects the quadrupole-monopole interaction.
373 */
374 REAL8 v0 = 1.;
375 /* Note: approximant SEOBNRv2T/v4T will by default compute dQuadMon1, dQuadMon2 */
376 /* from TidalLambda1, TidalLambda2 using universal relations, */
377 /* or use the input value if it is present in the dictionary params */
384 /* Tidal parameters to be computed, if required, by universal relations */
385 REAL8 lambda3A_UR = 0.;
386 REAL8 omega2TidalA_UR = 0.;
387 REAL8 omega3TidalA_UR = 0.;
388 REAL8 lambda3B_UR = 0.;
389 REAL8 omega2TidalB_UR = 0.;
390 REAL8 omega3TidalB_UR = 0.;
391 REAL8 quadparam1_UR = 0.;
392 REAL8 quadparam2_UR = 0.;
393
394 /* General sanity checks that will abort
395 *
396 * If non-GR approximants are added, include them in
397 * XLALSimInspiralApproximantAcceptTestGRParams()
398 */
400 XLALPrintError("XLAL Error - %s: Passed in non-NULL pointer to LALSimInspiralTestGRParam for an approximant that does not use LALSimInspiralTestGRParam\n", __func__);
402 }
403 /* Support variables for precessing wfs */
404 REAL8 incl;
405
406
407 /* SEOBNR flag for spin aligned model version. 1 for SEOBNRv1, 2 for SEOBNRv2 */
408 UINT4 SpinAlignedEOBversion;
409 REAL8 spin1x, spin1y, spin1z;
410 REAL8 spin2x, spin2y, spin2z;
411 REAL8 polariz = longAscNodes;
412
413 /* SEOBNR flag for precessing model version. 3 for SEOBNRv3, 300 for SEOBNRv3_opt, 401 for SEOBNRv4P, 402 for SEOBNRv4PHM */
414 UINT4 PrecEOBversion;
415 REAL8 spin1[3], spin2[3];
416
417 REAL8 maxamp = 0;
418 INT4 loopi = 0;
419 INT4 maxind = 0;
420
421 //LIGOTimeGPS epoch = LIGOTIMEGPSZERO;
422
423 /* General sanity check the input parameters - only give warnings! */
424 if (deltaT > 1.)
425 XLALPrintWarning("XLAL Warning - %s: Large value of deltaT = %e requested.\nPerhaps sample rate and time step size were swapped?\n", __func__, deltaT);
426 if (deltaT < 1. / 16385.)
427 XLALPrintWarning("XLAL Warning - %s: Small value of deltaT = %e requested.\nCheck for errors, this could create very large time series.\n", __func__, deltaT);
428 if (m1 < 0.09 * LAL_MSUN_SI)
429 XLALPrintWarning("XLAL Warning - %s: Small value of m1 = %e (kg) = %e (Msun) requested.\nPerhaps you have a unit conversion error?\n", __func__, m1, m1 / LAL_MSUN_SI);
430 if (m2 < 0.09 * LAL_MSUN_SI)
431 XLALPrintWarning("XLAL Warning - %s: Small value of m2 = %e (kg) = %e (Msun) requested.\nPerhaps you have a unit conversion error?\n", __func__, m2, m2 / LAL_MSUN_SI);
432 if (m1 + m2 > 1000. * LAL_MSUN_SI)
433 XLALPrintWarning("XLAL Warning - %s: Large value of total mass m1+m2 = %e (kg) = %e (Msun) requested.\nSignal not likely to be in band of ground-based detectors.\n", __func__, m1 + m2, (m1 + m2) / LAL_MSUN_SI);
434 if (S1x * S1x + S1y * S1y + S1z * S1z > 1.000001)
435 XLALPrintWarning("XLAL Warning - %s: S1 = (%e,%e,%e) with norm > 1 requested.\nAre you sure you want to violate the Kerr bound?\n", __func__, S1x, S1y, S1z);
436 if (S2x * S2x + S2y * S2y + S2z * S2z > 1.000001)
437 XLALPrintWarning("XLAL Warning - %s: S2 = (%e,%e,%e) with norm > 1 requested.\nAre you sure you want to violate the Kerr bound?\n", __func__, S2x, S2y, S2z);
438 if (f_min < 1.)
439 XLALPrintWarning("XLAL Warning - %s: Small value of fmin = %e requested.\nCheck for errors, this could create a very long waveform.\n", __func__, f_min);
440 if (f_min > 40.000001)
441 XLALPrintWarning("XLAL Warning - %s: Large value of fmin = %e requested.\nCheck for errors, the signal will start in band.\n", __func__, f_min);
442
443 /* adjust the reference frequency for certain precessing approximants:
444 * if that approximate interprets f_ref==0 to be f_min, set f_ref=f_min;
445 * otherwise do nothing */
447
448 switch (approximant) {
449 /* non-spinning inspiral-only models */
450 case TaylorEt:
451 /* Waveform-specific sanity checks */
453 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
454 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
455 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
456 if (!checkTidesZero(lambda1, lambda2))
457 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
458 if (f_ref != 0.)
459 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
460 /* Call the waveform driver routine */
461 ret = XLALSimInspiralTaylorEtPNGenerator(hplus, hcross, phiRef, v0, deltaT, m1, m2, f_min, distance, inclination, amplitudeO, phaseO);
462 break;
463
464 case TaylorT1:
465 /* Waveform-specific sanity checks */
467 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
469 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
471 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
472 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
473 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
474 /* Call the waveform driver routine */
475 ret = XLALSimInspiralTaylorT1PNGenerator(hplus, hcross, phiRef, v0, deltaT, m1, m2, f_min, f_ref, distance, inclination, lambda1, lambda2, XLALSimInspiralWaveformParamsLookupPNTidalOrder(params), amplitudeO, phaseO);
476 break;
477
478 case TaylorT2:
479 /* Waveform-specific sanity checks */
481 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
483 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
485 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
486 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
487 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
488 /* Call the waveform driver routine */
489 ret = XLALSimInspiralTaylorT2PNGenerator(hplus, hcross, phiRef, v0, deltaT, m1, m2, f_min, f_ref, distance, inclination, lambda1, lambda2, XLALSimInspiralWaveformParamsLookupPNTidalOrder(params), amplitudeO, phaseO);
490 break;
491
492 case TaylorT3:
493 /* Waveform-specific sanity checks */
495 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
497 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
499 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
500 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
501 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
502 /* Call the waveform driver routine */
503 ret = XLALSimInspiralTaylorT3PNGenerator(hplus, hcross, phiRef, v0, deltaT, m1, m2, f_min, f_ref, distance, inclination, lambda1, lambda2, XLALSimInspiralWaveformParamsLookupPNTidalOrder(params), amplitudeO, phaseO);
504 break;
505
506 case TaylorT4:
507 /* Waveform-specific sanity checks */
509 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
511 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
513 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
514 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
515 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
516 /* Call the waveform driver routine */
517 ret = XLALSimInspiralTaylorT4PNGenerator(hplus, hcross, phiRef, v0, deltaT, m1, m2, f_min, f_ref, distance, inclination, lambda1, lambda2, XLALSimInspiralWaveformParamsLookupPNTidalOrder(params), amplitudeO, phaseO);
518 break;
519
520 case TEOBResum_ROM:
521 /* Waveform-specific sanity checks */
523 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
525 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
527 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
528 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
529 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
530 /* Call the waveform driver routine */
531 ret = XLALSimInspiralTEOBResumROM(hplus, hcross, phiRef, deltaT, f_min, f_ref, distance, inclination, m1, m2, lambda1, lambda2);
532 break;
533
534 case TEOBResumS:
535 /* Waveform-specific sanity checks */
537 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
539 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
540 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
541 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
542 if (f_ref != 0.)
543 XLALPrintWarning("XLAL Warning - %s: This approximant does not use f_ref. The reference phase will be defined at coalescence.\n", __func__);
544 /* Comply with master convention on orientation angles */
545 polariz += LAL_PI_2;
546 /* Call the waveform driver routine */
547 // MA: TODO if( something about modes choice )
548
549 /* Make sure params exists (otherwise segfault) */
550 if (!params)
552 ret = XLALSimIMRTEOBResumS(hplus, hcross, phiRef, deltaT, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, lambda1, lambda2, distance, inclination, longAscNodes, params, eccentricity, meanPerAno, f_min, f_ref);
553 break;
554
555
556 case EccentricTD:
557 /* Waveform-specific sanity checks */
559 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
561 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
563 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralSpinOrder provided, but this approximant does not use that flag.");
564 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
565 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
566 if (!checkTidesZero(lambda1, lambda2))
567 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
568 /* Call the waveform driver routine */
569 ret = XLALSimInspiralEccentricTDPNGenerator(hplus, hcross, phiRef, deltaT, m1, m2, f_min, f_ref, distance, inclination, eccentricity, amplitudeO, phaseO);
570 if (ret == XLAL_FAILURE)
572 break;
573
574 /* non-spinning inspiral-merger-ringdown models */
575 case IMRPhenomA:
576 /* Waveform-specific sanity checks */
578 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
579 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
580 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
581 if (!checkTidesZero(lambda1, lambda2))
582 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
583 if (f_ref != 0.)
584 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
585 /* Call the waveform driver routine */
586 // NB: f_max = 0 will generate up to the ringdown cut-off frequency
587 ret = XLALSimIMRPhenomAGenerateTD(hplus, hcross, phiRef, deltaT, m1, m2, f_min, 0., distance, inclination);
588 break;
589
590 case EOBNRv2HM:
591 /* Waveform-specific sanity checks */
593 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
594 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
595 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
596 if (!checkTidesZero(lambda1, lambda2))
597 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
598 if (f_ref != 0.)
599 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
600 /* Call the waveform driver routine */
601 // FIXME: need to create a function to take in different modes or produce an error if all modes not given
602 ret = XLALSimIMREOBNRv2AllModes(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination);
603 break;
604
605 case EOBNRv2:
606 /* Waveform-specific sanity checks */
608 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
609 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
610 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
611 if (!checkTidesZero(lambda1, lambda2))
612 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
613 if (f_ref != 0.)
614 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
615 /* Call the waveform driver routine */
616 ret = XLALSimIMREOBNRv2DominantMode(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination);
617 break;
618
619 /* spinning inspiral-only models */
620 case SpinTaylorT5:
621 /* Waveform-specific sanity checks */
622 //if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) && (XLALSimInspiralWaveformParamsLookupPNSpinOrder(params)>5) )
623 //XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given with spinOrder %d, but this spins dynamics is not implemented to this order for precessing spins.", XLALSimInspiralWaveformParamsLookupPNSpinOrder);
624 XLALSimInspiralInitialConditionsPrecessingApproxs(&incl, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z, inclination, S1x, S1y, S1z, S2x, S2y, S2z, m1, m2, f_ref, phiRef, XLALSimInspiralWaveformParamsLookupFrameAxis(params));
625 LNhatx = sin(incl);
626 LNhaty = 0.;
627 LNhatz = cos(incl);
628 E1x = 0.;
629 E1y = 1.;
630 E1z = 0.;
631 polariz += LAL_PI / 2.;
632 /* Call the waveform driver routine */
633 ret = XLALSimInspiralSpinTaylorT5(hplus, hcross, phiRef, deltaT, m1, m2, f_min, f_ref, distance, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, LNhatx, LNhaty, LNhatz, E1x, E1y, E1z, params);
634 break;
635
636 // need to make a consistent choice for SpinTaylorT4 and PSpinInspiralRD waveform inputs
637 // proposal: TotalJ frame of PSpinInspiralRD
638 // inclination denotes the angle between the view direction
639 // and J (J is constant during the evolution, J//z, both N and initial
640 // L are in the x-z plane) and the spin coordinates are given wrt
641 // initial ** L **.
642 case SpinTaylorT4:
643 /* Waveform-specific sanity checks */
644 //if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) && (XLALSimInspiralWaveformParamsLookupPNSpinOrder(params)>5) )
645 // XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given with spinOrder %d, but this spins dynamics is not implemented to this order for precessing spins.", XLALSimInspiralWaveformParamsLookupPNSpinOrder);
646 XLALSimInspiralInitialConditionsPrecessingApproxs(&incl, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z, inclination, S1x, S1y, S1z, S2x, S2y, S2z, m1, m2, f_ref, phiRef, XLALSimInspiralWaveformParamsLookupFrameAxis(params));
647 LNhatx = sin(incl);
648 LNhaty = 0.;
649 LNhatz = cos(incl);
650 E1x = 0.;
651 E1y = 1.;
652 E1z = 0.;
653 polariz += LAL_PI / 2.;
654 /* Call the waveform driver routine */
655 ret = XLALSimInspiralSpinTaylorT4(hplus, hcross, phiRef, deltaT, m1, m2, f_min, f_ref, distance, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, LNhatx, LNhaty, LNhatz, E1x, E1y, E1z, params);
656 break;
657
658 case SpinTaylorT1:
659 /* Waveform-specific sanity checks */
660 /* Waveform-specific sanity checks */
661 //if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) && (XLALSimInspiralWaveformParamsLookupPNSpinOrder(params)>5) )
662 // XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given with spinOrder %d, but this spins dynamics is not implemented to this order for precessing spins.", XLALSimInspiralWaveformParamsLookupPNSpinOrder);
663 XLALSimInspiralInitialConditionsPrecessingApproxs(&incl, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z, inclination, S1x, S1y, S1z, S2x, S2y, S2z, m1, m2, f_ref, phiRef, XLALSimInspiralWaveformParamsLookupFrameAxis(params));
664 LNhatx = sin(incl);
665 LNhaty = 0.;
666 LNhatz = cos(incl);
667 E1x = 0.;
668 E1y = 1.;
669 E1z = 0.;
670 polariz += LAL_PI / 2.;
671 /* Call the waveform driver routine */
672 ret = XLALSimInspiralSpinTaylorT1(hplus, hcross, phiRef, deltaT, m1, m2, f_min, f_ref, distance, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, LNhatx, LNhaty, LNhatz, E1x, E1y, E1z, params);
673 break;
674
675 case SpinDominatedWf:
676 // waveform specific sanity checks
677 if (S2x != 0. || S2y != 0. || S2z != 0.) {
678 XLALPrintError("XLAL Error : The spindominatedwf approximant is only for 1 spin case.\n");
680 }
681 /*Maximal PN amplitude order is 1.5, maximal phase order is 2 PN */
682 if (amplitudeO > 3) {
683 XLALPrintError("XLAL Error : Foe the spindominatedwf approximant maximal amplitude correction is 1.5 PN\n");
685 }
686 if (phaseO > 4) {
687 XLALPrintError("XLAL Error : For the spindominatedwf approximant maximal phase correction is 2 PN\n");
689 }
690 incl = inclination;
691 LNhatx = 0.;
692 LNhaty = 0.;
693 LNhatz = 1.;
694 /* Call the waveform driver routine */
695 ret = XLALSimInspiralSpinDominatedWaveformInterfaceTD(hplus, hcross, deltaT, m1, m2, f_min, f_ref, distance, S1x, S1y, S1z, LNhatx, LNhaty, LNhatz, incl, phaseO, amplitudeO, phiRef);
696 break;
697
698 /* spin aligned inspiral-merger-ringdown models */
699 case IMRPhenomB:
700 /* Waveform-specific sanity checks */
702 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
703 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
704 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
705 if (!checkTidesZero(lambda1, lambda2))
706 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
707 if (f_ref != 0.)
708 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
709 /* Call the waveform driver routine */
710 // NB: f_max = 0 will generate up to the ringdown cut-off frequency
711 ret = XLALSimIMRPhenomBGenerateTD(hplus, hcross, phiRef, deltaT, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z), f_min, 0., distance, inclination);
712 break;
713
714 case PhenSpinTaylor:
715 /* Waveform-specific sanity checks */
716
717 /* Call the waveform driver routine */
718 XLALSimInspiralInitialConditionsPrecessingApproxs(&incl, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z, inclination, S1x, S1y, S1z, S2x, S2y, S2z, m1, m2, f_ref, phiRef, XLALSimInspiralWaveformParamsLookupFrameAxis(params));
719 polariz += LAL_PI / 2.;
720
721 ret = XLALSimSpinInspiralGenerator(hplus, hcross, phiRef, deltaT, m1, m2, f_min, f_ref, distance, incl, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, phaseO, amplitudeO, lambda1, lambda2, quadparam1, quadparam2, params);
722 break;
723
724 case IMRPhenomC:
725 /* Waveform-specific sanity checks */
727 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
728 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
729 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
730 if (!checkTidesZero(lambda1, lambda2))
731 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
732 if (f_ref != 0.)
733 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
734 /* Call the waveform driver routine */
735 // NB: f_max = 0 will generate up to the ringdown cut-off frequency
736 ret = XLALSimIMRPhenomCGenerateTD(hplus, hcross, phiRef, deltaT, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z), f_min, 0., distance, inclination, params);
737 break;
738
739 case IMRPhenomD:
741 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
742 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
743 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
744 if (!checkTidesZero(lambda1, lambda2))
745 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
746 // generate TD waveforms with zero inclincation so that amplitude can be
747 // calculated from hplus and hcross, apply inclination-dependent factors
748 // in loop below
749 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, 0., phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
750 maxamp = 0;
751 REAL8TimeSeries *hp = *hplus;
752 REAL8TimeSeries *hc = *hcross;
753 maxind = hp->data->length - 1;
754 const REAL8 cfac = cos(inclination);
755 const REAL8 pfac = 0.5 * (1. + cfac * cfac);
756 for (loopi = hp->data->length - 1; loopi > -1; loopi--) {
757 REAL8 ampsqr = (hp->data->data[loopi]) * (hp->data->data[loopi]) + (hc->data->data[loopi]) * (hc->data->data[loopi]);
758 if (ampsqr > maxamp) {
759 maxind = loopi;
760 maxamp = ampsqr;
761 }
762 hp->data->data[loopi] *= pfac;
763 hc->data->data[loopi] *= cfac;
764 }
765 XLALGPSSetREAL8(&(hp->epoch), (-1.) * deltaT * maxind);
766 XLALGPSSetREAL8(&(hc->epoch), (-1.) * deltaT * maxind);
767 break;
768
769 case IMRPhenomHM:
771 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
772 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
773 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
774 if (!checkTidesZero(lambda1, lambda2))
775 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
776
777 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
778 /*
779 * NOTE: We enforce that the hp**2 + hx**2 peaks at t=0
780 * see the wiki page from phenomHM review
781 * https://git.ligo.org/waveforms/reviews/phenomhm/wikis/time-domain-behaviour
782 */
783 maxamp = 0;
784 maxind = (*hplus)->data->length - 1;
785 for (loopi = (*hplus)->data->length - 1; loopi > -1; loopi--) {
786 REAL8 ampsqr = ((*hplus)->data->data[loopi]) * ((*hplus)->data->data[loopi]) + ((*hcross)->data->data[loopi]) * ((*hcross)->data->data[loopi]);
787 if (ampsqr > maxamp) {
788 maxind = loopi;
789 maxamp = ampsqr;
790 }
791 }
792 XLALGPSSetREAL8(&((*hplus)->epoch), (-1.) * deltaT * maxind);
793 XLALGPSSetREAL8(&((*hcross)->epoch), (-1.) * deltaT * maxind);
794 break;
795
796 case IMRPhenomPv2:
797 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
798 break;
799
800 case IMRPhenomPv3:
801 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
802 break;
803
804 case IMRPhenomPv3HM:
805 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
806 break;
807
809 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
810 break;
811
813 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
814 break;
815
817 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
818 break;
819
821 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
822 break;
823
825 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
826 break;
827
828 case IMRPhenomNSBH:
829 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
830 break;
831
833 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
834 break;
835
836 case SEOBNRv5HM_ROM:
837 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
838 break;
839
840 case PhenSpinTaylorRD:
841 /* Waveform-specific sanity checks */
842 if (!checkTidesZero(lambda1, lambda2))
843 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
844 if (f_ref != 0.)
845 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at the start.\n", __func__);
846 /* Call the waveform driver routine */
847 XLALSimInspiralInitialConditionsPrecessingApproxs(&incl, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z, inclination, S1x, S1y, S1z, S2x, S2y, S2z, m1, m2, f_ref, phiRef, XLALSimInspiralWaveformParamsLookupFrameAxis(params));
848 polariz += LAL_PI / 2.;
849 ret = XLALSimIMRPhenSpinInspiralRDGenerator(hplus, hcross, phiRef, deltaT, m1, m2, f_min, f_ref, distance, incl, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, phaseO, amplitudeO, lambda1, lambda2, quadparam1, quadparam2, params);
850 break;
851
852 case SEOBNRv1:
853 case SEOBNRv2_opt:
854 case SEOBNRv2:
855 case SEOBNRv4_opt:
856 case SEOBNRv4:
857 case SEOBNRv4HM:
858 /* Waveform-specific sanity checks */
860 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
861 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
862 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
863 if (!checkTidesZero(lambda1, lambda2))
864 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
865 if (f_ref != 0.)
866 XLALPrintWarning("XLAL Warning - %s: This approximant does not use f_ref. The reference phase will be defined at coalescence.\n", __func__);
867 /* Call the waveform driver routine */
868 polariz += -LAL_PI / 2.;
869 //R.C. this rotation of -pi/2 is needed to go from the EOB wave frame to the LAL wave frame, see slide 9 of https://git.ligo.org/waveforms/reviews/SEOBNRv4HM/blob/master/tests/conventions/conventions.pdf
870 if (approximant == SEOBNRv1)
871 SpinAlignedEOBversion = 1;
872 if (approximant == SEOBNRv2)
873 SpinAlignedEOBversion = 2;
875 SpinAlignedEOBversion = 200;
876 if (approximant == SEOBNRv4)
877 SpinAlignedEOBversion = 4;
879 SpinAlignedEOBversion = 400;
880 if (approximant == SEOBNRv4HM)
881 SpinAlignedEOBversion = 41;
882 ret = XLALSimIMRSpinAlignedEOBWaveform(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination, S1z, S2z, SpinAlignedEOBversion, params);
883 break;
884
885 case SEOBNRv4HM_PA:
886 case pSEOBNRv4HM_PA:
888 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
889 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
890 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
891 if( !checkTidesZero(lambda1, lambda2) )
892 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant does not have tidal corrections.");
893 if( f_ref != 0.)
894 XLALPrintWarning("XLAL Warning - %s: This approximant does not use f_ref. The reference phase will be defined at coalescence.\n", __func__);
895 /* Call the waveform driver routine */
896 polariz+=-LAL_PI/2.;
897 //R.C. this rotation of -pi/2 is needed to go from the EOB wave frame to the LAL wave frame, see slide 9 of https://git.ligo.org/waveforms/reviews/SEOBNRv4HM/blob/master/tests/conventions/con \ventions.pdf
898 if(approximant == SEOBNRv4HM_PA) SpinAlignedEOBversion = 4111;
899 if(approximant == pSEOBNRv4HM_PA) SpinAlignedEOBversion = 4112;
900
902 hplus, hcross,
903 phiRef, deltaT,
904 m1, m2,
905 f_min,
906 distance, inclination,
907 S1z, S2z,
908 SpinAlignedEOBversion, params
909 );
910 break;
911
912 case SEOBNRv3_opt_rk4:
913 case SEOBNRv3_opt:
914 case SEOBNRv3_pert:
915 case SEOBNRv3:
916 /* Waveform-specific sanity checks */
918 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
919 if (!checkTidesZero(lambda1, lambda2))
920 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
921 if (f_ref != 0.)
922 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
923 /* Call the waveform driver routine */
924 //REAL8 spin1[3], spin2[3];
925 spin1[0] = S1x;
926 spin1[1] = S1y;
927 spin1[2] = S1z;
928 spin2[0] = S2x;
929 spin2[1] = S2y;
930 spin2[2] = S2z;
931 polariz += -LAL_PI / 2.;
932 PrecEOBversion = 3;
933 if (approximant == SEOBNRv3_pert) {
934 const double m1pert = m1 * (1.0 + 1e-15);
935 ret = XLALSimIMRSpinEOBWaveform(hplus, hcross, /*&epoch, */ phiRef,
936 deltaT, m1pert, m2, f_min, distance, inclination, spin1, spin2, PrecEOBversion);
937
938 } else {
940 PrecEOBversion = 300;
942 PrecEOBversion = 304;
943 ret = XLALSimIMRSpinEOBWaveform(hplus, hcross, /*&epoch, */ phiRef,
944 deltaT, m1, m2, f_min, distance, inclination, spin1, spin2, PrecEOBversion);
945 }
946 break;
947
948 case SEOBNRv4P:
949 /* Waveform-specific sanity checks */
951 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
952 if (!checkTidesZero(lambda1, lambda2))
953 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
954 if (f_ref != 0.)
955 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
956
957 spin1[0] = S1x;
958 spin1[1] = S1y;
959 spin1[2] = S1z;
960 spin2[0] = S2x;
961 spin2[1] = S2y;
962 spin2[2] = S2z;
963 polariz += -LAL_PI / 2.;
964 PrecEOBversion = 401;
965 ret = XLALSimIMRSpinPrecEOBWaveform(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination, spin1, spin2, PrecEOBversion, params);
966 break;
967 case SEOBNRv4PHM:
968 /* Waveform-specific sanity checks */
970 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
971 if (!checkTidesZero(lambda1, lambda2))
972 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
973 if (f_ref != 0.)
974 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
975
976 spin1[0] = S1x;
977 spin1[1] = S1y;
978 spin1[2] = S1z;
979 spin2[0] = S2x;
980 spin2[1] = S2y;
981 spin2[2] = S2z;
982 polariz += -LAL_PI / 2.;
983 PrecEOBversion = 402;
984 ret = XLALSimIMRSpinPrecEOBWaveform(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination, spin1, spin2, PrecEOBversion, params);
985 break;
986
987 case SEOBNRv2T:
988 case SEOBNRv4T:
989 /* Waveform-specific sanity checks */
991 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
992 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
993 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
994 if (f_ref != 0.)
995 XLALPrintWarning("XLAL Warning - %s: This approximant does not use f_ref. The reference phase will be defined at coalescence.\n", __func__);
996 /* If tides-related parameter was not input by the user, use universal relations to compute it from quadrupolar lambda (or from octupolar lambda, itself either input or computed, for omega03) - else use the input value given by the user */
997 if (!XLALDictContains(params, "TidalOctupolarLambda1")) {
1000 }
1001 if (!XLALDictContains(params, "TidalOctupolarLambda2")) {
1004 }
1005 if (!XLALDictContains(params, "TidalQuadrupolarFMode1")) {
1006 omega2TidalA_UR = XLALSimUniversalRelationomega02TidalVSlambda2Tidal(lambda1);
1008 }
1009 if (!XLALDictContains(params, "TidalQuadrupolarFMode2")) {
1010 omega2TidalB_UR = XLALSimUniversalRelationomega02TidalVSlambda2Tidal(lambda2);
1012 }
1013 if (!XLALDictContains(params, "TidalOctupolarFMode1")) {
1014 omega3TidalA_UR = XLALSimUniversalRelationomega03TidalVSlambda3Tidal(lambda3A_UR);
1016 }
1017 if (!XLALDictContains(params, "TidalOctupolarFMode2")) {
1018 omega3TidalB_UR = XLALSimUniversalRelationomega03TidalVSlambda3Tidal(lambda3B_UR);
1020 }
1021 if (!XLALDictContains(params, "dQuadMon1")) {
1022 quadparam1_UR = XLALSimUniversalRelationQuadMonVSlambda2Tidal(lambda1);
1024 }
1025 if (!XLALDictContains(params, "dQuadMon2")) {
1026 quadparam2_UR = XLALSimUniversalRelationQuadMonVSlambda2Tidal(lambda2);
1028 }
1029 /* Call the waveform driver routine */
1030 if (approximant == SEOBNRv2T)
1031 SpinAlignedEOBversion = 201;
1032 if (approximant == SEOBNRv4T)
1033 SpinAlignedEOBversion = 401;
1034 ret = XLALSimIMRSpinAlignedEOBWaveform(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination, S1z, S2z, SpinAlignedEOBversion, params);
1035 break;
1036
1037 case HGimri:
1038 /* Waveform-specific sanity checks */
1039 if (!checkTidesZero(lambda1, lambda2))
1040 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1041 if (!checkCOSpinZero(S2x, S2y, S2z))
1042 XLAL_ERROR(XLAL_EINVAL, "Non-zero CO spin given, but this approximant does not support this case.");
1043 /* Call the waveform driver */
1044 ret = XLALHGimriGenerator(hplus, hcross, phiRef, deltaT, m1, m2, f_min, distance, inclination, S1z);
1045 break;
1046
1047 case NR_hdf5:
1048 /* Waveform-specific sanity checks */
1049 /* Call the waveform driver routine */
1050 ret = XLALSimInspiralNRWaveformGetHplusHcross(hplus, hcross,
1051 phiRef, inclination, deltaT, m1, m2, distance, f_min, f_ref, S1x, S1y, S1z,
1053 break;
1054
1055 case NRSur7dq2:
1056 /* Waveform-specific sanity checks */
1058 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1059 if (!checkTidesZero(lambda1, lambda2))
1060 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1061 /* Call the waveform driver routine */
1062 ret = XLALSimInspiralPrecessingNRSurPolarizations(hplus, hcross, phiRef, inclination, deltaT, m1, m2, distance, f_min, f_ref, S1x, S1y, S1z, S2x, S2y, S2z, params, approximant);
1063 break;
1064
1065 case NRSur7dq4:
1066 /* Waveform-specific sanity checks */
1068 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1069 if (!checkTidesZero(lambda1, lambda2))
1070 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1071 /* Call the waveform driver routine */
1072 ret = XLALSimInspiralPrecessingNRSurPolarizations(hplus, hcross, phiRef, inclination, deltaT, m1, m2, distance, f_min, f_ref, S1x, S1y, S1z, S2x, S2y, S2z, params, approximant);
1073 break;
1074
1075 case NRHybSur3dq8:
1076 /* Waveform-specific sanity checks */
1078 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1079 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1080 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1081 if (!checkTidesZero(lambda1, lambda2))
1082 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1083
1084 /* Call the waveform driver routine */
1085 ret = XLALSimIMRNRHybSur3dq8Polarizations(hplus, hcross, phiRef, inclination, deltaT, m1, m2, distance, f_min, f_ref, S1z, S2z, params);
1086 break;
1087
1088 case IMRPhenomXAS:
1090 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1091 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1092 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1093 if (!checkTidesZero(lambda1, lambda2))
1094 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1095 // generate TD waveforms with zero inclincation so that amplitude can be
1096 // calculated from hplus and hcross, apply inclination-dependent factors
1097 // in loop below
1098 polariz = 0;
1099
1100 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1101
1102 if (ret == XLAL_FAILURE)
1104
1105 // The Fourier domain model is built such that the TD transformation peakds approximately at zero.
1106 // Here we force an exact alignment at zero by computing the maximum of hp^2 + hc^2.
1107 maxamp = 0;
1108 maxind = (*hplus)->data->length - 1;
1109 for (loopi = (*hplus)->data->length - 1; loopi > -1; loopi--) {
1110 REAL8 ampsqr = ((*hplus)->data->data[loopi]) * ((*hplus)->data->data[loopi]) + ((*hcross)->data->data[loopi]) * ((*hcross)->data->data[loopi]);
1111 if (ampsqr > maxamp) {
1112 maxind = loopi;
1113 maxamp = ampsqr;
1114 }
1115 }
1116 // Shift peak to t=0.
1117 XLALGPSSetREAL8(&((*hplus)->epoch), (-1.) * deltaT * maxind);
1118 XLALGPSSetREAL8(&((*hcross)->epoch), (-1.) * deltaT * maxind);
1119 break;
1120
1123 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1124 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
1125 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1126
1127 // generate TD waveforms with zero inclincation so that amplitude can be
1128 // calculated from hplus and hcross, apply inclination-dependent factors
1129 // in loop below
1130 polariz = 0;
1131
1132 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef,
1133 longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1134
1135 if (ret == XLAL_FAILURE) XLAL_ERROR(XLAL_EFUNC);
1136
1137 break;
1138
1141 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1142 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
1143 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1144
1145 // generate TD waveforms with zero inclincation so that amplitude can be
1146 // calculated from hplus and hcross, apply inclination-dependent factors
1147 // in loop below
1148 polariz = 0;
1149
1150 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef,
1151 longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1152
1153 if (ret == XLAL_FAILURE) XLAL_ERROR(XLAL_EFUNC);
1154
1155 break;
1156
1157 case IMRPhenomXHM:
1159 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1160 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1161 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1162 if (!checkTidesZero(lambda1, lambda2))
1163 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1164 polariz = 0;
1165
1166 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1167
1168 if (ret == XLAL_FAILURE)
1170
1171 // The Fourier domain model is built such that the TD transformation peakds approximately at zero.
1172 // Here we force an exact alignment at zero by computing the maximum of hp^2 + hc^2.
1173 maxamp = 0;
1174 maxind = (*hplus)->data->length - 1;
1175 for (loopi = (*hplus)->data->length - 1; loopi > -1; loopi--) {
1176 REAL8 ampsqr = ((*hplus)->data->data[loopi]) * ((*hplus)->data->data[loopi]) + ((*hcross)->data->data[loopi]) * ((*hcross)->data->data[loopi]);
1177 if (ampsqr > maxamp) {
1178 maxind = loopi;
1179 maxamp = ampsqr;
1180 }
1181 }
1182 // Shift peak to t=0.
1183 XLALGPSSetREAL8(&((*hplus)->epoch), (-1.) * deltaT * maxind);
1184 XLALGPSSetREAL8(&((*hcross)->epoch), (-1.) * deltaT * maxind);
1185 break;
1186
1187 case IMRPhenomXP:
1188 polariz = 0;
1189 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1190 break;
1192 polariz = 0;
1193 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1194 break;
1195
1197 polariz = 0;
1198 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1199 break;
1200
1201 case IMRPhenomXPHM:
1202 polariz = 0;
1203 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1204 break;
1205
1206 case IMRPhenomT:
1207 /* Waveform-specific sanity checks */
1209 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1210 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1211 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1212 if (!checkTidesZero(lambda1, lambda2))
1213 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1214
1215 ret = XLALSimIMRPhenomT(hplus, hcross, m1, m2, S1z, S2z, distance, inclination, deltaT, f_min, f_ref, phiRef, params);
1216 break;
1217
1218
1219 case IMRPhenomTHM:
1220 /* Waveform-specific sanity checks */
1222 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1223 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1224 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1225 if (!checkTidesZero(lambda1, lambda2))
1226 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1227
1228 ret = XLALSimIMRPhenomTHM(hplus, hcross, m1, m2, S1z, S2z, distance, inclination, deltaT, f_min, f_ref, phiRef, params);
1229 break;
1230
1231 case IMRPhenomTP:
1232 /* Waveform-specific sanity checks */
1233 /* FIXME: CHECK ADDITIONAL CHECKS OF XP */
1235 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1236 if (!checkTidesZero(lambda1, lambda2))
1237 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1238
1239 ret = XLALSimIMRPhenomTP(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, deltaT, f_min, f_ref, phiRef, params);
1240 break;
1241
1242 case IMRPhenomTPHM:
1243 /* Waveform-specific sanity checks */
1244 /* FIXME: CHECK ADDITIONAL CHECKS OF XPHM */
1246 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1247 if (!checkTidesZero(lambda1, lambda2))
1248 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1249
1250 ret = XLALSimIMRPhenomTPHM(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, deltaT, f_min, f_ref, phiRef, params);
1251 break;
1252
1253 case IMRPhenomXO4a:
1254 polariz = 0;
1255 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1256 break;
1257
1258 case IMRPhenomXPNR:
1259 polariz = 0;
1260 ret = XLALSimInspiralTDFromFD(hplus, hcross, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, longAscNodes, eccentricity, meanPerAno, deltaT, f_min, f_ref, params, approximant);
1261 break;
1262
1263 default:
1264 XLALPrintError("TD version of approximant not implemented in lalsimulation\n");
1266 }
1267 //R.C.: here's the reference explaining why we perform this rotation https://dcc.ligo.org/LIGO-G1900275
1268 if (polariz && (*hplus) && (*hcross)) {
1269 REAL8 tmpP, tmpC;
1270 REAL8 cp = cos(2. * polariz);
1271 REAL8 sp = sin(2. * polariz);
1272 for (UINT4 idx = 0; idx < (*hplus)->data->length; idx++) {
1273 tmpP = (*hplus)->data->data[idx];
1274 tmpC = (*hcross)->data->data[idx];
1275 (*hplus)->data->data[idx] = cp * tmpP + sp * tmpC;
1276 (*hcross)->data->data[idx] = cp * tmpC - sp * tmpP;
1277 }
1278 }
1279
1280 if (ret == XLAL_FAILURE)
1282
1283 return ret;
1284}
1285
1286/**
1287 * Copy of the old code of XLALSimInspiralChooseFDWaveform(). The new version of XLALSimInspiralChooseFDWaveform() is just a wrapper over XLALSimInspiralGenerateFDWaveform.
1288 * XLALSimInspiralGenerateFDWaveform() internally calls this function for legacy approximants.
1289 */
1291 COMPLEX16FrequencySeries **hptilde, /* FD plus polarization */
1292 COMPLEX16FrequencySeries **hctilde, /* FD cross polarization */
1293 REAL8 m1, /* mass of companion 1 (kg) */
1294 REAL8 m2, /* mass of companion 2 (kg) */
1295 REAL8 S1x, /* x-component of the dimensionless spin of object 1 */
1296 REAL8 S1y, /* y-component of the dimensionless spin of object 1 */
1297 REAL8 S1z, /* z-component of the dimensionless spin of object 1 */
1298 REAL8 S2x, /* x-component of the dimensionless spin of object 2 */
1299 REAL8 S2y, /* y-component of the dimensionless spin of object 2 */
1300 REAL8 S2z, /* z-component of the dimensionless spin of object 2 */
1301 REAL8 distance, /* distance of source (m) */
1302 REAL8 inclination, /* inclination of source (rad) */
1303 REAL8 phiRef, /* reference orbital phase (rad) */
1304 REAL8 longAscNodes, /* longitude of ascending nodes, degenerate with the polarization angle, Omega in documentation */
1305 REAL8 eccentricity, /* eccentricity at reference epoch */
1306 REAL8 UNUSED meanPerAno, /* mean anomaly of periastron */
1307 // frequency sampling parameters, no default value
1308 REAL8 deltaF, /* sampling interval (Hz) */
1309 REAL8 f_min, /* starting GW frequency (Hz) */
1310 REAL8 f_max, /* ending GW frequency (Hz) */
1311 REAL8 f_ref, /* Reference frequency (Hz) */
1312 LALDict *params, /* LAL dictionary containing accessory parameters */
1313 Approximant approximant /* post-Newtonian approximant to use for waveform production */
1314)
1315{
1316 REAL8 LNhatx, LNhaty, LNhatz;
1317 REAL8 tmp1, tmp2;
1318 REAL8 E1x, E1y, E1z;
1319 REAL8 kMax;
1320 REAL8 v0, fStart;
1321 int ret;
1322 unsigned int j;
1323 REAL8 pfac, cfac;
1324 INT4 phiRefAtEnd;
1327
1332
1333 /* Support variables for precessing wfs */
1334 REAL8 spin1x, spin1y, spin1z;
1335 REAL8 spin2x, spin2y, spin2z;
1336
1337 /* Variables for IMRPhenomP and IMRPhenomPv2 */
1338 REAL8 chi1_l, chi2_l, chip, thetaJN, alpha0, phi_aligned, zeta_polariz;
1339 COMPLEX16 PhPpolp, PhPpolc;
1340
1341 /* General sanity checks that will abort
1342 *
1343 * If non-GR approximants are added, include them in
1344 * XLALSimInspiralApproximantAcceptTestGRParams()
1345 */
1347 XLALPrintError("XLAL Error - %s: Passed in non-NULL pointer to LALSimInspiralTestGRParam for an approximant that does not use LALSimInspiralTestGRParam\n", __func__);
1349 }
1350
1351 /* General sanity check the input parameters - only give warnings! */
1352 if (deltaF > 1.)
1353 XLALPrintWarning("XLAL Warning - %s: Large value of deltaF = %e requested...This corresponds to a very short TD signal (with padding). Consider a smaller value.\n", __func__, deltaF);
1354 if (deltaF < 1. / 4096.)
1355 XLALPrintWarning("XLAL Warning - %s: Small value of deltaF = %e requested...This corresponds to a very long TD signal. Consider a larger value.\n", __func__, deltaF);
1356 if (m1 < 0.09 * LAL_MSUN_SI)
1357 XLALPrintWarning("XLAL Warning - %s: Small value of m1 = %e (kg) = %e (Msun) requested...Perhaps you have a unit conversion error?\n", __func__, m1, m1 / LAL_MSUN_SI);
1358 if (m2 < 0.09 * LAL_MSUN_SI)
1359 XLALPrintWarning("XLAL Warning - %s: Small value of m2 = %e (kg) = %e (Msun) requested...Perhaps you have a unit conversion error?\n", __func__, m2, m2 / LAL_MSUN_SI);
1360 if (m1 + m2 > 1000. * LAL_MSUN_SI)
1361 XLALPrintWarning("XLAL Warning - %s: Large value of total mass m1+m2 = %e (kg) = %e (Msun) requested...Signal not likely to be in band of ground-based detectors.\n", __func__, m1 + m2, (m1 + m2) / LAL_MSUN_SI);
1362 if (S1x * S1x + S1y * S1y + S1z * S1z > 1.000001)
1363 XLALPrintWarning("XLAL Warning - %s: S1 = (%e,%e,%e) with norm > 1 requested...Are you sure you want to violate the Kerr bound?\n", __func__, S1x, S1y, S1z);
1364 if (S2x * S2x + S2y * S2y + S2z * S2z > 1.000001)
1365 XLALPrintWarning("XLAL Warning - %s: S2 = (%e,%e,%e) with norm > 1 requested...Are you sure you want to violate the Kerr bound?\n", __func__, S2x, S2y, S2z);
1366 if (f_min < 1.)
1367 XLALPrintWarning("XLAL Warning - %s: Small value of fmin = %e requested...Check for errors, this could create a very long waveform.\n", __func__, f_min);
1368 if (f_min > 40.000001)
1369 XLALPrintWarning("XLAL Warning - %s: Large value of fmin = %e requested...Check for errors, the signal will start in band.\n", __func__, f_min);
1370
1371 /* adjust the reference frequency for certain precessing approximants:
1372 * if that approximate interprets f_ref==0 to be f_min, set f_ref=f_min;
1373 * otherwise do nothing */
1375
1376 /* The non-precessing waveforms return h(f) for optimal orientation
1377 * (i=0, Fp=1, Fc=0; Lhat pointed toward the observer)
1378 * To get generic polarizations we multiply by inclination dependence
1379 * and note hc(f) \propto -I * hp(f)
1380 * Non-precessing waveforms multiply hp by pfac, hc by -I*cfac
1381 */
1382 cfac = cos(inclination);
1383 pfac = 0.5 * (1. + cfac * cfac);
1384
1385 switch (approximant) {
1386 /* inspiral-only models */
1387 case EccentricFD:
1388 /* Waveform-specific sanity checks */
1390 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
1392 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
1393 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1394 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1395 /* Call the waveform driver routine */
1396 /* Note that for generic inclined eccentric waveforms
1397 * * it is not possible to decompose hc(f) \propto I * hp(f)
1398 * * we call both polarizations independently
1399 * */
1400 /*ret = XLALSimInspiralEFD(hptilde, hctilde, phiRef, deltaF, m1, m2,
1401 * f_min, f_max, i, r, lambda1, lambda2, phaseO);*/
1402 // IMPORTANT CHECK: verify that inclination_azimuth is the longitude of ascending nodes
1403 ret = XLALSimInspiralEFD(hptilde, hctilde, phiRef, deltaF, m1, m2, f_min, f_max, inclination, distance, longAscNodes, eccentricity, phaseO);
1404 if (ret == XLAL_FAILURE)
1406 break;
1407
1408 case TaylorF2:
1409 /* Waveform-specific sanity checks */
1411 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
1413 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
1414 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1415 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1416
1417 /* Call the waveform driver routine */
1418 ret = XLALSimInspiralTaylorF2(hptilde, phiRef, deltaF, m1, m2, S1z, S2z, f_min, f_max, f_ref, distance, params);
1419 if (ret == XLAL_FAILURE)
1421 /* Produce both polarizations */
1422 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1423 for (j = 0; j < (*hptilde)->data->length; j++) {
1424 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1425 (*hptilde)->data->data[j] *= pfac;
1426 }
1427 break;
1428
1429 case TaylorF2Ecc:
1430 /* Waveform-specific sanity checks */
1432 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
1434 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
1435 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1436 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1438 if (eccentricity > 0.0 && eccentricity < 1.0 && f_ecc < 0.0) {
1439 /* we set f_ecc to be f_ref for correct eccentricity but not specifying f_ecc. */
1440 f_ecc = f_ref;
1441 if (f_ecc == 0)
1442 f_ecc = f_min;
1444 XLAL_PRINT_WARNING("Warning... The reference frequency for eccentricity was set as default value(%f). This might be not optimal case for you.\n", f_ecc);
1445 }
1446
1447 /* Call the waveform driver routine */
1448 ret = XLALSimInspiralTaylorF2Ecc(hptilde, phiRef, deltaF, m1, m2, S1z, S2z, f_min, f_max, f_ref, distance, eccentricity, params);
1449 if (ret == XLAL_FAILURE)
1451 /* Produce both polarizations */
1452 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1453 for (j = 0; j < (*hptilde)->data->length; j++) {
1454 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1455 (*hptilde)->data->data[j] *= pfac;
1456 }
1457 break;
1458
1459 case TaylorF2NLTides:
1460 /* Waveform-specific sanity checks */
1462 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
1464 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
1465 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1466 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1467
1468 // FIXME : add checks for NL tidal parameters?
1469
1470 /* Call the waveform driver routine */
1471 ret = XLALSimInspiralTaylorF2NLTides(hptilde, phiRef, deltaF, m1, m2, S1z, S2z, f_min, f_max, f_ref, distance, params);
1472 if (ret == XLAL_FAILURE)
1474 /* Produce both polarizations */
1475 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1476 for (j = 0; j < (*hptilde)->data->length; j++) {
1477 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1478 (*hptilde)->data->data[j] *= pfac;
1479 }
1480 break;
1481
1482 /* non-spinning inspiral-merger-ringdown models */
1483 case IMRPhenomA:
1484 /* Waveform-specific sanity checks */
1486 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1487 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
1488 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
1489 if (!checkTidesZero(lambda1, lambda2))
1490 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1491 /* Call the waveform driver routine */
1492 ret = XLALSimIMRPhenomAGenerateFD(hptilde, phiRef, deltaF, m1, m2, f_min, f_max, distance);
1493 if (ret == XLAL_FAILURE)
1495 /* Produce both polarizations */
1496 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1497 for (j = 0; j < (*hptilde)->data->length; j++) {
1498 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1499 (*hptilde)->data->data[j] *= pfac;
1500 }
1501 break;
1502
1503 /* spinning inspiral-only models */
1504 case SpinTaylorF2:
1505 /* Waveform-specific sanity checks */
1506 /* Sanity check unused fields of params */
1508 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
1510 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
1511 if (!checkCOSpinZero(S2x, S2y, S2z)) // This is a single-spin model
1512 XLAL_ERROR(XLAL_EINVAL, "Non-zero CO spin given, but this approximant does not support this case.");
1513 spin1x = S1x;
1514 spin1y = S1y;
1515 spin1z = S1z;
1516 ROTATEY(inclination, spin1x, spin1y, spin1z);
1517 LNhatx = sin(inclination);
1518 LNhaty = 0.;
1519 LNhatz = cos(inclination);
1520 /* Maximum PN amplitude order for precessing waveforms is
1521 * MAX_PRECESSING_AMP_PN_ORDER */
1522 amplitudeO = 0; /* amplitudeO <= MAX_PRECESSING_AMP_PN_ORDER ?
1523 amplitudeO : MAX_PRECESSING_AMP_PN_ORDER */ ;
1524 /* Call the waveform driver routine */
1525 ret = XLALSimInspiralSpinTaylorF2(hptilde, hctilde, phiRef, deltaF, m1, m2, spin1x, spin1y, spin1z, LNhatx, LNhaty, LNhatz, f_min, f_max, f_ref, distance, params, phaseO, amplitudeO);
1526 if (ret == XLAL_FAILURE)
1528 break;
1529
1530 /* FIXME: Comment out this case, as I don't have its source code */
1531 //case TaylorR2F4:
1532 // /* Waveform-specific sanity checks */
1533 // if( !XLALSimInspiralWaveformParamsFlagsAreDefault(params) )
1534 // XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1535 // if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
1536 // XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1537 // /* Call the waveform driver routine */
1538 // ret = XLALSimInspiralTaylorR2F4(hptilde, phiRef, deltaF, m1, m2,
1539 // S1z, S2z, f_min, r, phaseO, amplitudeO);
1540 // break;
1541
1542 case TaylorF2RedSpin:
1543 /* Waveform-specific sanity checks */
1545 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1546 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1547 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1548 if (!checkTidesZero(lambda1, lambda2))
1549 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1550 /* Call the waveform driver routine */
1551 ret = XLALSimInspiralTaylorF2ReducedSpin(hptilde, phiRef, deltaF, m1, m2, XLALSimInspiralTaylorF2ReducedSpinComputeChi(m1, m2, S1z, S2z), f_min, f_max, distance, phaseO, amplitudeO);
1552 if (ret == XLAL_FAILURE)
1554 /* Produce both polarizations */
1555 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1556 for (j = 0; j < (*hptilde)->data->length; j++) {
1557 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1558 (*hptilde)->data->data[j] *= pfac;
1559 }
1560 break;
1561
1563 /* Waveform-specific sanity checks */
1565 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1566 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1567 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1568 /* Call the waveform driver routine */
1569 ret = XLALSimInspiralTaylorF2ReducedSpinTidal(hptilde, phiRef, deltaF, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z), lambda1, lambda2, f_min, f_max, distance, phaseO, amplitudeO);
1570 if (ret == XLAL_FAILURE)
1572 /* Produce both polarizations */
1573 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1574 for (j = 0; j < (*hptilde)->data->length; j++) {
1575 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1576 (*hptilde)->data->data[j] *= pfac;
1577 }
1578 break;
1579
1580 /* spinning inspiral-merger-ringdown models */
1581 case IMRPhenomB:
1582 /* Waveform-specific sanity checks */
1584 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1585 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1586 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1587 if (!checkTidesZero(lambda1, lambda2))
1588 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1589 /* Call the waveform driver routine */
1590 ret = XLALSimIMRPhenomBGenerateFD(hptilde, phiRef, deltaF, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z), f_min, f_max, distance);
1591 if (ret == XLAL_FAILURE)
1593 /* Produce both polarizations */
1594 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1595 for (j = 0; j < (*hptilde)->data->length; j++) {
1596 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1597 (*hptilde)->data->data[j] *= pfac;
1598 }
1599 break;
1600
1601 case IMRPhenomC:
1602 /* Waveform-specific sanity checks */
1604 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1605 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1606 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1607 if (!checkTidesZero(lambda1, lambda2))
1608 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1609 /* Call the waveform driver routine */
1610 ret = XLALSimIMRPhenomCGenerateFD(hptilde, phiRef, deltaF, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z), f_min, f_max, distance, params);
1611 if (ret == XLAL_FAILURE)
1613 /* Produce both polarizations */
1614 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1615 for (j = 0; j < (*hptilde)->data->length; j++) {
1616 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1617 (*hptilde)->data->data[j] *= pfac;
1618 }
1619 break;
1620
1621 case IMRPhenomD:
1622 /* Waveform-specific sanity checks */
1624 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1625 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1626 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1627 if (!checkTidesZero(lambda1, lambda2))
1628 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1629 /* Call the waveform driver routine */
1630
1631 ret = XLALSimIMRPhenomDGenerateFD(hptilde, phiRef, f_ref, deltaF, m1, m2, S1z, S2z, f_min, f_max, distance, params, NoNRT_V);
1632 if (ret == XLAL_FAILURE)
1634 /* Produce both polarizations */
1635 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1636 for (j = 0; j < (*hptilde)->data->length; j++) {
1637 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1638 (*hptilde)->data->data[j] *= pfac;
1639 }
1640 break;
1641
1642 case IMRPhenomD_NRTidal:
1643 /* Waveform-specific sanity checks */
1645 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1646 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1647 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1648 if (lambda1 < 0 || lambda2 < 0)
1649 XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for IMRPhenomD_NRTidal", lambda1, lambda2);
1650 /* Call the waveform driver routine */
1651 ret = XLALSimIMRPhenomDNRTidal(hptilde, phiRef, deltaF, f_min, f_max, f_ref, distance, m1, m2, S1z, S2z, lambda1, lambda2, params, NRTidal_V);
1652 if (ret == XLAL_FAILURE)
1654 /* Produce both polarizations */
1655 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1656 for (j = 0; j < (*hptilde)->data->length; j++) {
1657 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1658 (*hptilde)->data->data[j] *= pfac;
1659 }
1660 break;
1661
1663 /* Waveform-specific sanity checks */
1665 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1666 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1667 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1668 if (lambda1 < 0 || lambda2 < 0)
1669 XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for IMRPhenomD_NRTidalv2", lambda1, lambda2);
1671 XLAL_CHECK(XLAL_SUCCESS == ret, ret, "Failed to set QuadMon from Lambdas for IMRPhenomD_NRTidalv2");
1672 /* Call the waveform driver routine */
1673 ret = XLALSimIMRPhenomDNRTidal(hptilde, phiRef, deltaF, f_min, f_max, f_ref, distance, m1, m2, S1z, S2z, lambda1, lambda2, params, NRTidalv2_V);
1674 if (ret == XLAL_FAILURE)
1676 /* Produce both polarizations */
1677 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1678 for (j = 0; j < (*hptilde)->data->length; j++) {
1679 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1680 (*hptilde)->data->data[j] *= pfac;
1681 }
1682 break;
1683
1684 case IMRPhenomNSBH:
1685 /* Waveform-specific sanity checks */
1686 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1687 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1688 if (lambda1 != 0 || lambda2 < 0)
1689 XLAL_ERROR(XLAL_EDOM, "lambda1 = %f, lambda2 = %f. lambda1 should be equal to zero and lambda2 should be greater than or equal to zero for IMRPhenomNSBH", lambda1, lambda2);
1690 /* Call the waveform driver routine */
1691 ret = XLALSimIMRPhenomNSBH(hptilde, phiRef, deltaF, f_min, f_max, f_ref, distance, m1, m2, S1z, S2z, params);
1692 if (ret == XLAL_FAILURE)
1694 /* Produce both polarizations */
1695 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
1696 for (j = 0; j < (*hptilde)->data->length; j++) {
1697 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j];
1698 (*hptilde)->data->data[j] *= pfac;
1699 }
1700 break;
1701
1702 case IMRPhenomHM:
1703 /* Waveform-specific sanity checks */
1704 // if( !XLALSimInspiralWaveformParamsFlagsAreDefault(params) )
1705 // XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1706 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1707 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1708 if (!checkTidesZero(lambda1, lambda2))
1709 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1710 /* Call the waveform driver routine */
1711
1713 freqs->data[0] = f_min;
1714 freqs->data[1] = f_max;
1715 ret = XLALSimIMRPhenomHM(hptilde, hctilde, freqs, m1, m2, S1z, S2z, distance, inclination, phiRef, deltaF, f_ref, params);
1716 if (ret == XLAL_FAILURE)
1719 break;
1720
1721 case EOBNRv2_ROM:
1722 /* Waveform-specific sanity checks */
1724 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1725 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
1726 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
1727 if (!checkTidesZero(lambda1, lambda2))
1728 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1729
1730 ret = XLALSimIMREOBNRv2HMROM(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, 0);
1731 break;
1732
1733 case EOBNRv2HM_ROM:
1734 /* Waveform-specific sanity checks */
1736 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1737 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
1738 XLAL_ERROR(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
1739 if (!checkTidesZero(lambda1, lambda2))
1740 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1741
1742 ret = XLALSimIMREOBNRv2HMROM(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, 1);
1743 break;
1744
1746 /* Waveform-specific sanity checks */
1748 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1749 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1750 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1751 if (!checkTidesZero(lambda1, lambda2))
1752 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1753 if (!checkAlignedSpinsEqual(S1z, S2z)) {
1754 XLALPrintError("XLAL Error - %s: SEOBNRv1ROM Effective Spin model called with unequal aligned spins: %lf, %lf.\n", __func__, S1z, S2z);
1756 }
1757
1758 ret = XLALSimIMRSEOBNRv1ROMEffectiveSpin(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z));
1759 break;
1760
1762 /* Waveform-specific sanity checks */
1764 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1765 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1766 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1767 if (!checkTidesZero(lambda1, lambda2))
1768 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1769
1770 ret = XLALSimIMRSEOBNRv1ROMDoubleSpin(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z);
1771 break;
1772
1774 /* Waveform-specific sanity checks */
1776 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1777 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1778 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1779 if (!checkTidesZero(lambda1, lambda2))
1780 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1781 if (!checkAlignedSpinsEqual(S1z, S2z)) {
1782 XLALPrintError("XLAL Error - %s: SEOBNRv2ROM Effective Spin model called with unequal aligned spins: %lf, %lf.\n", __func__, S1z, S2z);
1784 }
1785
1786 ret = XLALSimIMRSEOBNRv2ROMEffectiveSpin(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, XLALSimIMRPhenomBComputeChi(m1, m2, S1z, S2z));
1787 break;
1788
1790 /* Waveform-specific sanity checks */
1792 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1793 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1794 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1795 if (!checkTidesZero(lambda1, lambda2))
1796 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1797
1798 ret = XLALSimIMRSEOBNRv2ROMDoubleSpin(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z);
1799 break;
1800
1802 /* Waveform-specific sanity checks */
1804 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1805 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1806 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1807 if (!checkTidesZero(lambda1, lambda2))
1808 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1809
1810 ret = XLALSimIMRSEOBNRv2ROMDoubleSpinHI(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, -1);
1811 break;
1812
1813 case SEOBNRv4_ROM:
1814 /* Waveform-specific sanity checks */
1816 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1817 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1818 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1819 if (!checkTidesZero(lambda1, lambda2))
1820 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1821
1822 ret = XLALSimIMRSEOBNRv4ROM(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, -1, params, NoNRT_V);
1823 break;
1824
1825 case SEOBNRv4HM_ROM:
1826 /* Waveform-specific sanity checks */
1828 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1829 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1830 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1831 if (!checkTidesZero(lambda1, lambda2))
1832 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1833
1834 ret = XLALSimIMRSEOBNRv4HMROM(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, -1, 5, 1, params);
1835 break;
1836
1837 case SEOBNRv5_ROM:
1838 /* Waveform-specific sanity checks */
1840 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1841 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
1842 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1843 if( !checkTidesZero(lambda1, lambda2) )
1844 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1845
1846 ret = XLALSimIMRSEOBNRv5HMROM(hptilde, hctilde,
1847 phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, -1, 1, true, params, NoNRT_V);
1848 break;
1849
1850 case SEOBNRv5HM_ROM:
1851 /* Waveform-specific sanity checks */
1853 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1854 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
1855 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1856 if( !checkTidesZero(lambda1, lambda2) )
1857 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
1858
1859 LALValue *mode_arr = NULL;
1860 LALDict *pars_aux;
1861 INT2Sequence *modeseq = NULL;
1862 UINT4 nmodes = 7;
1863 UINT2 eobmodesv5hm = 7;
1864
1865 if(params == NULL){
1866 pars_aux = XLALCreateDict();
1867 }
1868 else{
1869 pars_aux = XLALDictDuplicate(params);
1870 }
1872
1873 if(mode_arr != NULL)
1874 {
1875 modeseq = XLALSimInspiralModeArrayReadModes(mode_arr);
1876 nmodes = modeseq->length/2;
1877 if (
1878 nmodes == 2 &&
1879 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
1880 modeseq->data[2] == 3 && abs(modeseq->data[3]) == 3)
1881 {
1882 eobmodesv5hm = 2;
1883 }
1884 if (
1885 nmodes == 3 &&
1886 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
1887 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
1888 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1)
1889 {
1890 eobmodesv5hm = 3;
1891 }
1892 if (
1893 nmodes == 4 &&
1894 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
1895 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
1896 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1 &&
1897 modeseq->data[6] == 4 && abs(modeseq->data[7]) == 4)
1898 {
1899 eobmodesv5hm = 4;
1900 }
1901 if (
1902 nmodes == 5 &&
1903 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
1904 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
1905 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1 &&
1906 modeseq->data[6] == 4 && abs(modeseq->data[7]) == 4 &&
1907 modeseq->data[8] == 5 && abs(modeseq->data[9]) == 5)
1908 {
1909 eobmodesv5hm = 5;
1910 }
1911 if (
1912 nmodes == 6 &&
1913 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
1914 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
1915 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1 &&
1916 modeseq->data[8] == 4 && abs(modeseq->data[9]) == 4 &&
1917 modeseq->data[10] == 5 && abs(modeseq->data[11]) == 5 &&
1918 modeseq->data[6] == 3 && abs(modeseq->data[7]) == 2)
1919 {
1920 eobmodesv5hm = 6;
1921 }
1922 }
1923 ret = XLALSimIMRSEOBNRv5HMROM(hptilde, hctilde,
1924 phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, -1, eobmodesv5hm, true, params, NoNRT_V);
1925 XLALDestroyINT2Sequence(modeseq);
1926 XLALDestroyValue(mode_arr);
1927 XLALDestroyDict(pars_aux);
1928 break;
1929
1931
1932 /* Waveform-specific sanity checks */
1934 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1935 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1936 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1937 if (lambda1 < 0 || lambda2 < 0)
1938 XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for SEOBNRv4_ROM_NRTidal", lambda1, lambda2);
1940 XLAL_CHECK(XLAL_SUCCESS == ret, ret, "Failed to set QuadMon from Lambdas for SEOBNRv4_ROM_NRTidal");
1941 ret = XLALSimIMRSEOBNRv4ROMNRTidal(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, lambda1, lambda2, params, NRTidal_V);
1942 break;
1943
1945 /* Waveform-specific sanity checks */
1947 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1948 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1949 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1950 if (lambda1 < 0 || lambda2 < 0)
1951 XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for SEOBNRv4_ROM_NRTidal", lambda1, lambda2);
1953 XLAL_CHECK(XLAL_SUCCESS == ret, ret, "Failed to set QuadMon from Lambdas for SEOBNRv4_ROM_NRTidalv2");
1954 ret = XLALSimIMRSEOBNRv4ROMNRTidal(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, lambda1, lambda2, params, NRTidalv2_V);
1955 break;
1956
1958 /* Waveform-specific sanity checks */
1960 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1961 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1962 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1963 if (m1 < m2)
1964 XLAL_ERROR(XLAL_EDOM, "m1 = %e, m2=%e. m1 should be greater than or equal to m2 for SEOBNRv4_ROM_NRTidalv2_NSBH", m1, m2);
1965 if (lambda1 != 0)
1966 XLAL_ERROR(XLAL_EDOM, "lambda1 = %f. lambda1 should be zero for SEOBNRv4_ROM_NRTidalv2_NSBH", lambda1);
1967 if (lambda2 < 0)
1968 XLAL_ERROR(XLAL_EDOM, "lambda2 = %f. lambda2 should be nonnegative for SEOBNRv4_ROM_NRTidalv2_NSBH", lambda2);
1969 if (lambda2 > 5000)
1970 XLAL_ERROR(XLAL_EDOM, "lambda2 = %f. lambda2 should be < 5000", lambda2);
1971 if (S2z != 0)
1972 XLAL_PRINT_WARNING("WARNING: S2z = %f. SEOBNRv4_ROM_NRTidalv2_NSBH is calibrated to NR data for which the NS spin is zero.", S2z);
1973 if (m2 < 1 * LAL_MSUN_SI)
1974 XLAL_PRINT_WARNING("WARNING: m2=%e MSun. SEOBNRv4_ROM_NRTidalv2_NSBH is calibrated to NR data for which the NS mass is >=1 solar mass.", m2 / LAL_MSUN_SI);
1975 if (m2 > 3 * LAL_MSUN_SI)
1976 XLAL_ERROR(XLAL_EDOM, "m2=%e Msun. NS Mass should be <=3 solar masses", m2 / LAL_MSUN_SI);
1977 if (m1 / m2 > 100)
1978 XLAL_ERROR(XLAL_EDOM, "m1/m2=%e mass ratio should be < 100", m1 / m2);
1979
1980 ret = XLALSimIMRSEOBNRv4ROMNRTidal(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, lambda1, lambda2, params, NRTidalv2NSBH_V);
1981 break;
1982
1984 /* Waveform-specific sanity checks */
1986 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1987 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1988 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
1989
1990 ret = XLALSimIMRSEOBNRv4TSurrogate(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, lambda1, lambda2, SEOBNRv4TSurrogate_CUBIC);
1991 break;
1992
1994
1995 /* Waveform-specific sanity checks */
1997 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
1998 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
1999 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2000 if (lambda1 < 0 || lambda2 < 0)
2001 XLAL_ERROR(XLAL_EFUNC, "lambda1 = %f, lambda2 = %f. Both should be greater than zero for SEOBNRv5_ROM_NRTidal", lambda1, lambda2);
2003 XLAL_CHECK(XLAL_SUCCESS == ret, ret, "Failed to set QuadMon from Lambdas for SEOBNRv5_ROM_NRTidal");
2004 ret = XLALSimIMRSEOBNRv5ROMNRTidal(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, S2z, lambda1, lambda2, params, NRTidalv3_V);
2005 break;
2006
2008 /* Waveform-specific sanity checks */
2010 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2011 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
2012 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2013 ret = XLALSimIMRLackeyTidal2013(hptilde, hctilde, phiRef, deltaF, f_min, f_max, f_ref, distance, inclination, m1, m2, S1z, lambda2);
2014 break;
2015
2016 case IMRPhenomP:
2017 /* Waveform-specific sanity checks */
2019 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag."); /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2020 if (!XLALSimInspiralWaveformParamsModesChoiceIsDefault( /* Default is (2,2) or l=2 modes. */ params))
2021 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2022 if (!checkTidesZero(lambda1, lambda2))
2023 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2024 /* Tranform to model parameters */
2025 if (f_ref == 0.0)
2026 f_ref = f_min; /* Default reference frequency is minimum frequency */
2027 XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(&chi1_l, &chi2_l, &chip, &thetaJN, &alpha0, &phi_aligned, &zeta_polariz, m1, m2, f_ref, phiRef, inclination, S1x, S1y, S1z, S2x, S2y, S2z, IMRPhenomPv1_V);
2028 /* Call the waveform driver routine */
2029 ret = XLALSimIMRPhenomP(hptilde, hctilde, chi1_l, chi2_l, chip, thetaJN, m1, m2, distance, alpha0, phi_aligned, deltaF, f_min, f_max, f_ref, IMRPhenomPv1_V, NoNRT_V, params);
2030 if (ret == XLAL_FAILURE)
2032 for (UINT4 idx = 0; idx < (*hptilde)->data->length; idx++) {
2033 PhPpolp = (*hptilde)->data->data[idx];
2034 PhPpolc = (*hctilde)->data->data[idx];
2035 (*hptilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolp + sin(2. * zeta_polariz) * PhPpolc;
2036 (*hctilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolc - sin(2. * zeta_polariz) * PhPpolp;
2037 }
2038 break;
2039
2040 case IMRPhenomPv2:
2041 /* Waveform-specific sanity checks */
2043 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag."); /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2044 if (!XLALSimInspiralWaveformParamsModesChoiceIsDefault( /* Default is (2,2) or l=2 modes. */ params))
2045 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2046 if (!checkTidesZero(lambda1, lambda2))
2047 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2048 /* Tranform to model parameters */
2049 if (f_ref == 0.0)
2050 f_ref = f_min; /* Default reference frequency is minimum frequency */
2051 XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(&chi1_l, &chi2_l, &chip, &thetaJN, &alpha0, &phi_aligned, &zeta_polariz, m1, m2, f_ref, phiRef, inclination, S1x, S1y, S1z, S2x, S2y, S2z, IMRPhenomPv2_V);
2052 /* Call the waveform driver routine */
2053 ret = XLALSimIMRPhenomP(hptilde, hctilde, chi1_l, chi2_l, chip, thetaJN, m1, m2, distance, alpha0, phi_aligned, deltaF, f_min, f_max, f_ref, IMRPhenomPv2_V, NoNRT_V, params);
2054 if (ret == XLAL_FAILURE)
2056 for (UINT4 idx = 0; idx < (*hptilde)->data->length; idx++) {
2057 PhPpolp = (*hptilde)->data->data[idx];
2058 PhPpolc = (*hctilde)->data->data[idx];
2059 (*hptilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolp + sin(2. * zeta_polariz) * PhPpolc;
2060 (*hctilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolc - sin(2. * zeta_polariz) * PhPpolp;
2061 }
2062 break;
2063
2065 /* Waveform-specific sanity checks */
2067 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag."); /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2068 if (!XLALSimInspiralWaveformParamsModesChoiceIsDefault( /* Default is (2,2) or l=2 modes. */ params))
2069 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2070 /* Tranform to model parameters */
2071 if (f_ref == 0.0)
2072 f_ref = f_min; /* Default reference frequency is minimum frequency */
2073 XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(&chi1_l, &chi2_l, &chip, &thetaJN, &alpha0, &phi_aligned, &zeta_polariz, m1, m2, f_ref, phiRef, inclination, S1x, S1y, S1z, S2x, S2y, S2z, IMRPhenomPv2NRTidal_V);
2074 /* Call the waveform driver routine */
2075 ret = XLALSimIMRPhenomP(hptilde, hctilde, chi1_l, chi2_l, chip, thetaJN, m1, m2, distance, alpha0, phi_aligned, deltaF, f_min, f_max, f_ref, IMRPhenomPv2NRTidal_V, NRTidal_V, params);
2076 if (ret == XLAL_FAILURE)
2078 for (UINT4 idx = 0; idx < (*hptilde)->data->length; idx++) {
2079 PhPpolp = (*hptilde)->data->data[idx];
2080 PhPpolc = (*hctilde)->data->data[idx];
2081 (*hptilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolp + sin(2. * zeta_polariz) * PhPpolc;
2082 (*hctilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolc - sin(2. * zeta_polariz) * PhPpolp;
2083 }
2084 break;
2086 /* Waveform-specific sanity checks */
2088 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag."); /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2089 if (!XLALSimInspiralWaveformParamsModesChoiceIsDefault( /* Default is (2,2) or l=2 modes. */ params))
2090 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2091 /* Tranform to model parameters */
2092 if (f_ref == 0.0)
2093 f_ref = f_min; /* Default reference frequency is minimum frequency */
2094 XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(&chi1_l, &chi2_l, &chip, &thetaJN, &alpha0, &phi_aligned, &zeta_polariz, m1, m2, f_ref, phiRef, inclination, S1x, S1y, S1z, S2x, S2y, S2z, IMRPhenomPv2NRTidal_V);
2095 /* Call the waveform driver routine */
2096 ret = XLALSimIMRPhenomP(hptilde, hctilde, chi1_l, chi2_l, chip, thetaJN, m1, m2, distance, alpha0, phi_aligned, deltaF, f_min, f_max, f_ref, IMRPhenomPv2NRTidal_V, NRTidalv2_V, params);
2097 if (ret == XLAL_FAILURE)
2099 for (UINT4 idx = 0; idx < (*hptilde)->data->length; idx++) {
2100 PhPpolp = (*hptilde)->data->data[idx];
2101 PhPpolc = (*hctilde)->data->data[idx];
2102 (*hptilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolp + sin(2. * zeta_polariz) * PhPpolc;
2103 (*hctilde)->data->data[idx] = cos(2. * zeta_polariz) * PhPpolc - sin(2. * zeta_polariz) * PhPpolp;
2104 }
2105 break;
2106
2107 case IMRPhenomPv3:
2108 /* Waveform-specific sanity checks */
2110 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag."); /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2111 if (!XLALSimInspiralWaveformParamsModesChoiceIsDefault( /* Default is (2,2) or l=2 modes. */ params))
2112 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2113 if (!checkTidesZero(lambda1, lambda2))
2114 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2115 /* Tranform to model parameters */
2116 if (f_ref == 0.0)
2117 f_ref = f_min; /* Default reference frequency is minimum frequency */
2119 freqspv3->data[0] = f_min;
2120 freqspv3->data[1] = f_max;
2121 ret = XLALSimIMRPhenomPv3(hptilde, hctilde, freqspv3, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, deltaF, f_ref, params);
2122 if (ret == XLAL_FAILURE)
2124 XLALDestroyREAL8Sequence(freqspv3);
2125 break;
2126
2127 case IMRPhenomPv3HM:
2128 /* Waveform-specific sanity checks */
2130 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag."); /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2131 if (!XLALSimInspiralWaveformParamsModesChoiceIsDefault( /* Default is (2,2) or l=2 modes. */ params))
2132 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2133 if (!checkTidesZero(lambda1, lambda2))
2134 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2135 /* Tranform to model parameters */
2136 if (f_ref == 0.0)
2137 f_ref = f_min; /* Default reference frequency is minimum frequency */
2138
2139 REAL8Sequence *freqspv3hm = XLALCreateREAL8Sequence(2);
2140 freqspv3hm->data[0] = f_min;
2141 freqspv3hm->data[1] = f_max;
2142 ret = XLALSimIMRPhenomPv3HMGetHplusHcross(hptilde, hctilde, freqspv3hm, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, deltaF, f_ref, params);
2143
2144 if (ret == XLAL_FAILURE)
2146 XLALDestroyREAL8Sequence(freqspv3hm);
2147
2148 break;
2149
2151 /* Waveform-specific sanity checks */
2153 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2155 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2156 spin1x = S1x;
2157 spin1y = S1y;
2158 spin1z = S1z;
2159 spin2x = S2x;
2160 spin2y = S2y;
2161 spin2z = S2z;
2162 ROTATEY(inclination, spin1x, spin1y, spin1z);
2163 ROTATEY(inclination, spin2x, spin2y, spin2z);
2164 LNhatx = sin(inclination);
2165 LNhaty = 0.;
2166 LNhatz = cos(inclination);
2167 E1x = 0.;
2168 E1y = 1.;
2169 E1z = 0.;
2170 // default kMax = 3
2171 kMax = 3;
2172 // default v0 = 1
2173 v0 = 1.;
2174 // default fStart = 0.9*fMin
2175 fStart = 0.9 * f_min;
2176 phiRefAtEnd = 0;
2177 // if f_ref = 0, set it to f_min, and tell the driver routine that we came from there
2178 if (f_ref == 0) {
2179 f_ref = f_min;
2180 phiRefAtEnd = 1;
2181 }
2182 // default quadparams are for black holes. Replace by ~2-12 for neutron stars
2183 /* Call the waveform driver routine */
2184 ret = XLALSimInspiralSpinTaylorT4Fourier(hptilde, hctilde,
2185 f_min, f_max, deltaF, kMax, phiRef, v0, m1, m2, fStart, f_ref, distance, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, LNhatx, LNhaty, LNhatz, E1x, E1y, E1z, lambda1, lambda2, quadparam1, quadparam2,
2186 params, phaseO, amplitudeO, phiRefAtEnd);
2187 if (ret == XLAL_FAILURE)
2189 break;
2190
2192 /* Waveform-specific sanity checks */
2194 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2196 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2197 spin1x = S1x;
2198 spin1y = S1y;
2199 spin1z = S1z;
2200 spin2x = S2x;
2201 spin2y = S2y;
2202 spin2z = S2z;
2203 ROTATEY(inclination, spin1x, spin1y, spin1z);
2204 ROTATEY(inclination, spin2x, spin2y, spin2z);
2205 LNhatx = sin(inclination);
2206 LNhaty = 0.;
2207 LNhatz = cos(inclination);
2208 E1x = 0.;
2209 E1y = 1.;
2210 E1z = 0.;
2211 // default kMax = 3
2212 kMax = 3;
2213 // default v0 = 1
2214 v0 = 1.;
2215 // default fStart = 0.9*fMin
2216 fStart = 0.9 * f_min;
2217 phiRefAtEnd = 0;
2218 // if f_ref = 0, set it to f_min, and tell the driver routine that we came from there
2219 if (f_ref == 0) {
2220 f_ref = f_min;
2221 phiRefAtEnd = 1;
2222 }
2223 // default quadparams are for black holes. Replace by ~2-12 for neutron stars
2224 /* Call the waveform driver routine */
2225 ret = XLALSimInspiralSpinTaylorT5Fourier(hptilde, hctilde,
2226 f_min, f_max, deltaF, kMax, phiRef, v0, m1, m2, fStart, f_ref, distance, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, LNhatx, LNhaty, LNhatz, E1x, E1y, E1z, lambda1, lambda2, quadparam1, quadparam2,
2227 params, phaseO, amplitudeO, phiRefAtEnd);
2228 if (ret == XLAL_FAILURE)
2230 break;
2231
2232
2233 case NRSur4d2s:
2234
2235 ret = XLALSimNRSur4d2s(hptilde, hctilde, phiRef, deltaF, f_min, f_max, distance, inclination, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z);
2236 if (ret == XLAL_FAILURE)
2238 break;
2239
2240 case IMRPhenomXAS:
2241 {
2242 /* Waveform-specific sanity checks */
2244 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2245 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
2246 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2247 if (!checkTidesZero(lambda1, lambda2))
2248 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2249
2250 /* This is the factor that comes from Y_22star + (-1)^l * Y_2-2 without the dependence in inclination, that is included in pfac and cfac */
2251 /* Ylm(inclination, beta), with beta = PI/2 - phiRef. phiRef is included in the individual mode */
2252 COMPLEX16 Ylmfactor = 2.0 * sqrt(5.0 / (64.0 * LAL_PI)) * cexp(-I * 2 * (LAL_PI_2));
2253 /* The factor for hc is the same but opposite sign */
2254
2255 /* Call the waveform driver routine. */
2256 /* It returns h_2-2(f) for positive frequencies. h_2-2 is zero for negative frequencies. */
2257 /* h_22(f) is zero for positive frequencies. For negatives frequencies h_22(f) = Conjugate[h_2-2(-f)] */
2258 /* We returns h2_-2 because it is the mode with the positive frequencies,
2259 and we need this mode because XLALSimInspiralTDFromFD assumes that the input array is in the positive frequencies regime. */
2260 ret = XLALSimIMRPhenomXASGenerateFD(hptilde, m1, m2, S1z, S2z, distance, f_min, f_max, deltaF, phiRef, f_ref, params);
2261 if (ret == XLAL_FAILURE)
2263
2264 /* Produce both polarizations for positive frequencies */
2265 *hctilde = XLALCreateCOMPLEX16FrequencySeries("FD hcross", &((*hptilde)->epoch), (*hptilde)->f0, (*hptilde)->deltaF, &((*hptilde)->sampleUnits), (*hptilde)->data->length);
2266 for (j = 0; j < (*hptilde)->data->length; j++) {
2267 (*hctilde)->data->data[j] = -I * cfac * (*hptilde)->data->data[j] * Ylmfactor;
2268 (*hptilde)->data->data[j] *= pfac * Ylmfactor;
2269 }
2270 break;
2271 }
2272
2274 {
2275 /* Waveform-specific sanity checks */
2277 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2278 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
2279 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2280
2281 LALDict *LALparams_aux;
2282 if (params == NULL)
2283 LALparams_aux = XLALCreateDict();
2284 else
2285 LALparams_aux = XLALDictDuplicate(params);
2286
2287 /* PhenomXTidalFlag maps to the NRTidalv* version used: 2-> NRTidalv2 */
2289
2290 /* to employ multibanding, we need to call XHM: hence, we activate a reduced mode array */
2291 LALValue *ModeArray = XLALSimInspiralCreateModeArray();
2292 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
2293 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
2294 XLALSimInspiralWaveformParamsInsertModeArray(LALparams_aux, ModeArray);
2295
2296 ret = XLALSimIMRPhenomXHM(hptilde, hctilde, m1, m2, S1z, S2z, f_min, f_max, deltaF, distance, inclination, phiRef, f_ref, LALparams_aux);
2297
2298 XLALDestroyValue(ModeArray);
2299
2300 if (ret == XLAL_FAILURE)
2302
2303 XLALDestroyDict(LALparams_aux);
2304
2305 break;
2306 }
2307
2309 {
2310 /* Waveform-specific sanity checks */
2312 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2313 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
2314 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2315
2316 LALDict *LALparams_aux;
2317 if (params == NULL)
2318 LALparams_aux = XLALCreateDict();
2319 else
2320 LALparams_aux = XLALDictDuplicate(params);
2321
2322 /* PhenomXTidalFlag maps to the NRTidalv* version used: 3-> NRTidalv3 */
2324
2325 /* to employ multibanding, we need to call XHM: hence, we activate a reduced mode array */
2326 LALValue *ModeArray = XLALSimInspiralCreateModeArray();
2327 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
2328 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
2329 XLALSimInspiralWaveformParamsInsertModeArray(LALparams_aux, ModeArray);
2330
2331 ret = XLALSimIMRPhenomXHM(hptilde, hctilde, m1, m2, S1z, S2z, f_min, f_max, deltaF, distance, inclination, phiRef, f_ref, LALparams_aux);
2332
2333 XLALDestroyValue(ModeArray);
2334
2335 if (ret == XLAL_FAILURE)
2337
2338 XLALDestroyDict(LALparams_aux);
2339
2340 break;
2341 }
2342
2343 case IMRPhenomXHM:
2344 /* Waveform-specific sanity checks */
2346 XLAL_ERROR(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2347 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
2348 XLAL_ERROR(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2349 if (!checkTidesZero(lambda1, lambda2))
2350 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2351
2352 /* Activate or not the debug info. */
2353#ifndef PHENOMXHMDEBUG // Defined at compilation time. ./configure --prefix=... CFLAGS='-g -D PHENOMXHMDEBUG'
2354#define DEBUG 0
2355#else
2356#define DEBUG 1 //print debugging info
2357#endif
2358
2359 /* Return hp and hc for positive frequencies. Only negatives modes contribute to positive frequencies. */
2360 /* The negative frquencies contribution is the complex conjugate of the positive one. */
2361
2362 /* Take input/default value for the threshold of the Multibanding. If = 0 then do not use Multibanding. */
2364
2365 /* If total mass is very high (>500 solar masses), we only have a few points in the ringdown, interpolation is not efficient, do not use Multibanding */
2366 REAL8 Mtot = (m1 + m2) / LAL_MSUN_SI;
2367 if (resTest != 0 && Mtot > 500) {
2368 resTest = 0.;
2369 }
2370
2371 if (resTest == 0.) { //Do not use multibanding
2372 ret = XLALSimIMRPhenomXHM2(hptilde, hctilde, m1, m2, S1z, S2z, f_min, f_max, deltaF, distance, inclination, phiRef, f_ref, params);
2373 } else { // Use multibanding
2374 ret = XLALSimIMRPhenomXHM(hptilde, hctilde, m1, m2, S1z, S2z, f_min, f_max, deltaF, distance, inclination, phiRef, f_ref, params);
2375 }
2376
2377 if (ret == XLAL_FAILURE)
2379
2380#if DEBUG == 1
2381 printf("\n\n**********Leaving ChooseFDWaveform *********************\n\n");
2382#endif
2383
2384 break;
2385
2386 case IMRPhenomXP:
2387 /* Waveform-specific sanity checks */
2389 /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2390 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2391 }
2393 /* Default is (2,2) or l=2 modes. */
2394 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2395 }
2396 if (!checkTidesZero(lambda1, lambda2)) {
2397 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2398 }
2399 if (f_ref == 0.0) {
2400 /* Default reference frequency is minimum frequency */
2401 f_ref = f_min;
2402 }
2403
2404 /* Call the main waveform driver. Note that we pass the full spin vectors
2405 with XLALSimIMRPhenomXPCalculateModelParametersFromSourceFrame being
2406 effectively called in the initialization of the pPrec struct
2407 */
2408 ret = XLALSimIMRPhenomXPGenerateFD(hptilde, hctilde, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, f_min, f_max, deltaF, f_ref, params);
2409 if (ret == XLAL_FAILURE) {
2411 }
2412
2413 break;
2414
2415
2417
2418 {
2419
2420 /* Waveform-specific sanity checks */
2422 {
2423 /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2424 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2425 }
2427 {
2428 /* Default is (2,2) or l=2 modes. */
2429 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2430 }
2431
2432 LALDict *LALparams_aux;
2433 if (params == NULL) LALparams_aux = XLALCreateDict();
2434 else LALparams_aux = XLALDictDuplicate(params);
2435
2436 /* PhenomXTidalFlag maps to the NRTidalv* version used: 2-> NRTidalv2 */
2438
2439 /* to employ multibanding, we need to call XPHM: hence, we activate a reduced mode array */
2440 LALValue *ModeArray = XLALSimInspiralCreateModeArray();
2441 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
2442 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
2443 XLALSimInspiralWaveformParamsInsertModeArray(LALparams_aux, ModeArray);
2444
2445 // Insert quadrupole parameters for use in twisting up
2446 ret = XLALSimInspiralSetQuadMonParamsFromLambdas(LALparams_aux);
2447 XLAL_CHECK(XLAL_SUCCESS == ret, ret, "Failed to set quadrupole parameters from lambdas for IMRPhenomXP_NRTidalv2");
2448
2449 if(f_ref==0.0)
2450 {
2451 /* Default reference frequency is minimum frequency */
2452 f_ref = f_min;
2453 }
2454
2455 ret = XLALSimIMRPhenomXPHM(hptilde, hctilde, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination,phiRef, f_min, f_max, deltaF, f_ref, LALparams_aux);
2456
2457 XLALDestroyValue(ModeArray);
2458
2459 if (ret == XLAL_FAILURE) XLAL_ERROR(XLAL_EFUNC);
2460
2461 XLALDestroyDict(LALparams_aux);
2462
2463 }
2464 break;
2465
2467
2468 {
2469
2470 /* Waveform-specific sanity checks */
2472 {
2473 /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2474 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2475 }
2477 {
2478 /* Default is (2,2) or l=2 modes. */
2479 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2480 }
2481
2482 LALDict *LALparams_aux;
2483 if (params == NULL) LALparams_aux = XLALCreateDict();
2484 else LALparams_aux = XLALDictDuplicate(params);
2485
2486 /* PhenomXTidalFlag maps to the NRTidalv* version used: 3-> NRTidalv3 */
2488
2489 /* to employ multibanding, we need to call XPHM: hence, we activate a reduced mode array */
2490 LALValue *ModeArray = XLALSimInspiralCreateModeArray();
2491 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
2492 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
2493 XLALSimInspiralWaveformParamsInsertModeArray(LALparams_aux, ModeArray);
2494
2495 // Insert quadrupole parameters for use in twisting up
2496 ret = XLALSimInspiralSetQuadMonParamsFromLambdas(LALparams_aux);
2497 XLAL_CHECK(XLAL_SUCCESS == ret, ret, "Failed to set quadrupole parameters from lambdas for IMRPhenomXP_NRTidalv3");
2498
2499 if(f_ref==0.0)
2500 {
2501 /* Default reference frequency is minimum frequency */
2502 f_ref = f_min;
2503 }
2504
2505 ret = XLALSimIMRPhenomXPHM(hptilde, hctilde, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination,phiRef, f_min, f_max, deltaF, f_ref, LALparams_aux);
2506
2507 XLALDestroyValue(ModeArray);
2508
2509 if (ret == XLAL_FAILURE) XLAL_ERROR(XLAL_EFUNC);
2510
2511 XLALDestroyDict(LALparams_aux);
2512
2513 }
2514 break;
2515
2516 case IMRPhenomXPHM:
2517 /* Waveform-specific sanity checks */
2519 /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2520 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2521 }
2523 /* Default is (2,2) or l=2 modes. */
2524 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2525 }
2526 if (!checkTidesZero(lambda1, lambda2)) {
2527 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2528 }
2529 if (f_ref == 0.0) {
2530 /* Default reference frequency is minimum frequency */
2531 f_ref = f_min;
2532 }
2533
2534 /* Call the main waveform driver. Note that we pass the full spin vectors
2535 with XLALSimIMRPhenomXPCalculateModelParametersFromSourceFrame being
2536 effectively called in the initialization of the pPrec struct
2537 */
2539
2540 if (usemodes == 0) {
2541 ret = XLALSimIMRPhenomXPHM(hptilde, hctilde, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, f_min, f_max, deltaF, f_ref, params);
2542 } else {
2543 ret = XLALSimIMRPhenomXPHMFromModes(hptilde, hctilde, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, distance, inclination, phiRef, f_min, f_max, deltaF, f_ref, params);
2544 }
2545
2546 if (ret == XLAL_FAILURE) {
2548 }
2549
2550 break;
2551
2552 case IMRPhenomXO4a:
2553 {
2554 LALDict *params_aux;
2555 if (params == NULL){
2556 params_aux = XLALCreateDict();
2557 }
2558 else{
2559 params_aux = XLALDictDuplicate(params);
2560 }
2561
2562 /* XO4 uses previous version of XHM */
2564
2565 /* Waveform-specific sanity checks */
2567 {
2568 /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2569 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2570 }
2572 {
2573 /* Default is (2,2) or l=2 modes. */
2574 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2575 }
2576 if( !checkTidesZero(lambda1, lambda2) )
2577 {
2578 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2579 }
2580 if(f_ref==0.0)
2581 {
2582 /* Default reference frequency is minimum frequency */
2583 f_ref = f_min;
2584 }
2585
2586 /* Call the main waveform driver. Note that we pass the full spin vectors
2587 with XLALSimIMRPhenomXPCalculateModelParametersFromSourceFrame being
2588 effectively called in the initialization of the pPrec struct
2589 */
2590
2591 /* Toggle on PNR angles */
2592 if(!XLALDictContains(params_aux, "PNRUseTunedAngles")){
2594 }
2595
2596 /* Toggle on tuned coprecessing strain */
2597 if(!XLALDictContains(params_aux, "PNRUseTunedCoprec")){
2599 }
2600 if(!XLALDictContains(params_aux, "PNRForceXHMAlignment")){
2602 }
2603
2604 /* Toggle on antisymmetric contributions */
2605 if(!XLALDictContains(params_aux, "AntisymmetricWaveform")){
2607 }
2608
2610 {
2612 {
2613 XLAL_ERROR(XLAL_EFUNC,"Error: Antisymmetric waveform generation not supported without PNR angles, please turn on PNR angles to produce waveform with asymmetries in the (2,2) and (2,-2) modes \n");
2614 }
2615 }
2616
2617 /* Toggle on reviewed PrecVersion and FinalSpinMod */
2618 if(!XLALDictContains(params_aux, "PrecVersion")){
2620 }
2621
2623
2624 if(usemodes == 0){
2626 hptilde, hctilde,
2627 m1, m2,
2628 S1x, S1y, S1z,
2629 S2x, S2y, S2z,
2630 distance, inclination,
2631 phiRef, f_min, f_max, deltaF, f_ref, params_aux
2632 );
2633 }
2634 else{
2636 hptilde, hctilde,
2637 m1, m2,
2638 S1x, S1y, S1z,
2639 S2x, S2y, S2z,
2640 distance, inclination,
2641 phiRef, f_min, f_max, deltaF, f_ref, params_aux
2642 );
2643 }
2644
2645 XLALDestroyDict(params_aux);
2646
2647
2648 if (ret == XLAL_FAILURE)
2649 {
2651 }
2652
2653 break;
2654 }
2655
2656 case IMRPhenomXPNR:
2657 {
2658 LALDict *params_aux;
2659 if (params == NULL){
2660 params_aux = XLALCreateDict();
2661 }
2662 else{
2663 params_aux = XLALDictDuplicate(params);
2664 }
2665
2666 /* XO4 uses previous version of XHM */
2668
2669 /* Waveform-specific sanity checks */
2671 {
2672 /* Default is LAL_SIM_INSPIRAL_FRAME_AXIS_ORBITAL_L : z-axis along direction of orbital angular momentum. */
2673 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2674 }
2676 {
2677 /* Default is (2,2) or l=2 modes. */
2678 XLAL_ERROR(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2679 }
2680 if( !checkTidesZero(lambda1, lambda2) )
2681 {
2682 XLAL_ERROR(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2683 }
2684 if(f_ref==0.0)
2685 {
2686 /* Default reference frequency is minimum frequency */
2687 f_ref = f_min;
2688 }
2689
2690 /* Call the main waveform driver. Note that we pass the full spin vectors
2691 with XLALSimIMRPhenomXPCalculateModelParametersFromSourceFrame being
2692 effectively called in the initialization of the pPrec struct
2693 */
2694
2695 /* Toggle on PNR angles */
2696 if(!XLALDictContains(params_aux, "PNRUseTunedAngles")){
2698 }
2699
2700 /* Toggle on tuned coprecessing strain */
2701 if(!XLALDictContains(params_aux, "PNRUseTunedCoprec")){
2703 }
2704 if(!XLALDictContains(params_aux, "PNRForceXHMAlignment")){
2706 }
2707
2708 /* Toggle on antisymmetric contributions */
2709 if(!XLALDictContains(params_aux, "AntisymmetricWaveform")){
2711 }
2712
2714 {
2716 {
2717 XLAL_ERROR(XLAL_EFUNC,"Error: Antisymmetric waveform generation not supported without PNR angles, please turn on PNR angles to produce waveform with asymmetries in the (2,2) and (2,-2) modes \n");
2718 }
2719 }
2720
2721 /* Toggle on reviewed PrecVersion and FinalSpinMod */
2722 if(!XLALDictContains(params_aux, "PrecVersion")){
2724 }
2725
2726 if(!XLALDictContains(params_aux, "FinalSpinMod")){
2728 }
2729
2730 /* Toggle the conditional precession multibanding */
2731 if(!XLALDictContains(params_aux, "MBandPrecVersion")){
2733 }
2734
2736
2737 if(usemodes == 0){
2739 hptilde, hctilde,
2740 m1, m2,
2741 S1x, S1y, S1z,
2742 S2x, S2y, S2z,
2743 distance, inclination,
2744 phiRef, f_min, f_max, deltaF, f_ref, params_aux
2745 );
2746 }
2747 else{
2749 hptilde, hctilde,
2750 m1, m2,
2751 S1x, S1y, S1z,
2752 S2x, S2y, S2z,
2753 distance, inclination,
2754 phiRef, f_min, f_max, deltaF, f_ref, params_aux
2755 );
2756 }
2757
2758 XLALDestroyDict(params_aux);
2759
2760
2761 if (ret == XLAL_FAILURE)
2762 {
2764 }
2765
2766 break;
2767 }
2768
2769 default:
2770 XLALPrintError("FD version of approximant not implemented in lalsimulation\n");
2772 }
2773
2774 REAL8 polariz = longAscNodes;
2775 if (polariz) {
2776 COMPLEX16 tmpP, tmpC;
2777 for (UINT4 idx = 0; idx < (*hptilde)->data->length; idx++) {
2778 tmpP = (*hptilde)->data->data[idx];
2779 tmpC = (*hctilde)->data->data[idx];
2780 (*hptilde)->data->data[idx] = cos(2. * polariz) * tmpP + sin(2. * polariz) * tmpC;
2781 (*hctilde)->data->data[idx] = cos(2. * polariz) * tmpC - sin(2. * polariz) * tmpP;
2782 }
2783 }
2784
2785 if (ret == XLAL_FAILURE)
2788 ret = XLALSimLorentzInvarianceViolationTerm(hptilde, hctilde, m1 / LAL_MSUN_SI, m2 / LAL_MSUN_SI, distance, params);
2789 if (ret == XLAL_FAILURE)
2791
2792 return ret;
2793}
2794
2795/**
2796 * Copy of the old code of XLALSimInspiralChooseTDModes(). The new version of XLALSimInspiralChooseTDModes() is just a wrapper over XLALSimInspiralGenerateTDModes().
2797 * XLALSimInspiralGenerateTDModes() internally calls this function for legacy approximants.
2798 */
2800 REAL8 phiRef, /* reference orbital phase (rad). This variable is not used and only kept here for backwards compatibility */
2801 REAL8 deltaT, /* sampling interval (s) */
2802 REAL8 m1, /* mass of companion 1 (kg) */
2803 REAL8 m2, /* mass of companion 2 (kg) */
2804 REAL8 S1x, /* x-component of the dimensionless spin of object 1 */
2805 REAL8 S1y, /* y-component of the dimensionless spin of object 1 */
2806 REAL8 S1z, /* z-component of the dimensionless spin of object 1 */
2807 REAL8 S2x, /* x-component of the dimensionless spin of object 2 */
2808 REAL8 S2y, /* y-component of the dimensionless spin of object 2 */
2809 REAL8 S2z, /* z-component of the dimensionless spin of object 2 */
2810 REAL8 f_min, /* starting GW frequency (Hz) */
2811 REAL8 f_ref, /* reference GW frequency (Hz) */
2812 REAL8 r, /* distance of source (m) */
2813 LALDict *LALpars, /* LAL dictionary containing accessory parameters */
2814 int lmax, /* generate all modes with l <= lmax */
2815 Approximant approximant /* post-Newtonian approximant to use for waveform production */
2816)
2817{
2818 XLALPrintWarning("WARNING: The phiRef argument in XLALSimInspiralChooseTDModes will be removed in the future and is currently not used. \n");
2819 REAL8 v0 = 1.;
2820 SphHarmTimeSeries *hlm = NULL;
2821 INT4 errCode = 0;
2822
2823 /* SEOBNR flag for precessing model version. 3 for SEOBNRv3, 300 for SEOBNRv3_opt, 401 for SEOBNRv4P, 402 for SEOBNRv4PHM */
2824 UINT4 PrecEOBversion;
2825 REAL8 spin1[3], spin2[3];
2826
2827 /* General sanity checks that will abort */
2828 /*
2829 * If non-GR approximants are added, change the below to
2830 * if( nonGRparams && approximant != nonGR1 && approximant != nonGR2 )
2831 */
2833 XLALPrintError("XLAL Error - %s: Passed in non-NULL pointer to LALSimInspiralTestGRParam for an approximant that does not use LALSimInspiralTestGRParam\n", __func__);
2835 }
2836
2837 /* General sanity check the input parameters - only give warnings! */
2838 if (deltaT > 1.)
2839 XLALPrintWarning("XLAL Warning - %s: Large value of deltaT = %e requested.\nPerhaps sample rate and time step size were swapped?\n", __func__, deltaT);
2840 if (deltaT < 1. / 16385.)
2841 XLALPrintWarning("XLAL Warning - %s: Small value of deltaT = %e requested.\nCheck for errors, this could create very large time series.\n", __func__, deltaT);
2842 if (m1 < 0.09 * LAL_MSUN_SI)
2843 XLALPrintWarning("XLAL Warning - %s: Small value of m1 = %e (kg) = %e (Msun) requested.\nPerhaps you have a unit conversion error?\n", __func__, m1, m1 / LAL_MSUN_SI);
2844 if (m2 < 0.09 * LAL_MSUN_SI)
2845 XLALPrintWarning("XLAL Warning - %s: Small value of m2 = %e (kg) = %e (Msun) requested.\nPerhaps you have a unit conversion error?\n", __func__, m2, m2 / LAL_MSUN_SI);
2846 if (m1 + m2 > 1000. * LAL_MSUN_SI)
2847 XLALPrintWarning("XLAL Warning - %s: Large value of total mass m1+m2 = %e (kg) = %e (Msun) requested.\nSignal not likely to be in band of ground-based detectors.\n", __func__, m1 + m2, (m1 + m2) / LAL_MSUN_SI);
2848 if (S1x * S1x + S1y * S1y + S1z * S1z > 1.000001)
2849 XLALPrintWarning("XLAL Warning - %s: S1 = (%e,%e,%e) with norm > 1 requested.\nAre you sure you want to violate the Kerr bound?\n", __func__, S1x, S1y, S1z);
2850 if (S2x * S2x + S2y * S2y + S2z * S2z > 1.000001)
2851 XLALPrintWarning("XLAL Warning - %s: S2 = (%e,%e,%e) with norm > 1 requested.\nAre you sure you want to violate the Kerr bound?\n", __func__, S2x, S2y, S2z);
2852 if (f_min < 1.)
2853 XLALPrintWarning("XLAL Warning - %s: Small value of fmin = %e requested.\nCheck for errors, this could create a very long waveform.\n", __func__, f_min);
2854 if (f_min > 40.000001)
2855 XLALPrintWarning("XLAL Warning - %s: Large value of fmin = %e requested.\nCheck for errors, the signal will start in band.\n", __func__, f_min);
2856
2861 UINT4 l;
2862
2863 switch (approximant) {
2864 case TaylorT1:
2865 /* Waveform-specific sanity checks */
2866 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
2867 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
2869 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2871 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2872 /* Call the waveform driver routine */
2873 hlm = XLALSimInspiralTaylorT1PNModes(v0, deltaT, m1, m2, f_min, f_ref, r, lambda1, lambda2, XLALSimInspiralWaveformParamsLookupPNTidalOrder(LALpars), amplitudeO, phaseO, lmax);
2874 break;
2875 case TaylorT2:
2876 /* Waveform-specific sanity checks */
2877 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
2878 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
2880 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2882 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2883 /* Call the waveform driver routine */
2884 hlm = XLALSimInspiralTaylorT2PNModes(v0, deltaT, m1, m2, f_min, f_ref, r, lambda1, lambda2, XLALSimInspiralWaveformParamsLookupPNTidalOrder(LALpars), amplitudeO, phaseO, lmax);
2885 break;
2886 case TaylorT3:
2887 /* Waveform-specific sanity checks */
2888 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
2889 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
2891 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2893 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2894 /* Call the waveform driver routine */
2895 hlm = XLALSimInspiralTaylorT3PNModes(v0, deltaT, m1, m2, f_min, f_ref, r, lambda1, lambda2, 0, amplitudeO, phaseO, lmax);
2896 break;
2897 case TaylorT4:
2898 /* Waveform-specific sanity checks */
2899 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
2900 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
2902 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2904 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2905 /* Call the waveform driver routine */
2906 hlm = XLALSimInspiralTaylorT4PNModes(v0, deltaT, m1, m2, f_min, f_ref, r, lambda1, lambda2, 0, amplitudeO, phaseO, lmax);
2907 break;
2908 case EOBNRv2:
2909 case EOBNRv2HM:
2910 /* Waveform-specific sanity checks */
2911 if (!checkSpinsZero(S1x, S1y, S1z, S2x, S2y, S2z))
2912 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero spins were given, but this is a non-spinning approximant.");
2914 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralFrameAxis provided, but this approximant does not use that flag.");
2916 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default LALSimInspiralModesChoice provided, but this approximant does not use that flag.");
2917 /* Call the waveform driver routine */
2918 hlm = XLALSimIMREOBNRv2Modes(deltaT, m1, m2, f_min, r);
2919 // EOB driver only outputs modes with m>0, add m<0 modes by symmetry
2920 size_t j;
2921 int m;
2922 for (l = 2; l <= XLALSphHarmTimeSeriesGetMaxL(hlm); l++) {
2923 for (m = -l; m < 0; m++) {
2925 if (!inmode)
2926 continue;
2927 COMPLEX16TimeSeries *tmpmode = XLALCutCOMPLEX16TimeSeries(inmode, 0, inmode->data->length);
2928 for (j = 0; j < tmpmode->data->length; j++) {
2929 tmpmode->data->data[j] = cpow(-1, l)
2930 * conj(tmpmode->data->data[j]);
2931 }
2932 hlm = XLALSphHarmTimeSeriesAddMode(hlm, tmpmode, l, m);
2934 }
2935 }
2936 break;
2937
2938 case NRSur7dq2:
2939 /* Waveform-specific sanity checks */
2941 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2942 if (!checkTidesZero(lambda1, lambda2))
2943 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2944 /* Call the waveform driver routine */
2945 hlm = XLALSimInspiralPrecessingNRSurModes(deltaT, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, f_min, f_ref, r, LALpars, approximant);
2946 break;
2947
2948 case NRSur7dq4:
2949 /* Waveform-specific sanity checks */
2951 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2952 if (!checkTidesZero(lambda1, lambda2))
2953 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2954 /* Call the waveform driver routine */
2955 hlm = XLALSimInspiralPrecessingNRSurModes(deltaT, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, f_min, f_ref, r, LALpars, approximant);
2956 break;
2957
2958 case NRHybSur3dq8:
2959 /* Waveform-specific sanity checks */
2961 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2962 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
2963 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2964 if (!checkTidesZero(lambda1, lambda2))
2965 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2966
2967 /* Call the waveform driver routine */
2968 hlm = XLALSimIMRNRHybSur3dq8Modes(deltaT, m1, m2, S1z, S2z, f_min, f_ref, r, LALpars);
2969 break;
2970
2971 case IMRPhenomTHM:
2972 /* Waveform-specific sanity checks */
2974 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2975 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
2976 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
2977 if (!checkTidesZero(lambda1, lambda2))
2978 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2979
2980 /* Call the waveform driver routine */
2981 hlm = XLALSimIMRPhenomTHM_Modes(m1, m2, S1z, S2z, r, deltaT, f_min, f_ref, phiRef, LALpars);
2982
2983 break;
2984
2985 case IMRPhenomTPHM:
2986 /* Waveform-specific sanity checks */
2987 /* FIXME: CHECK XPHM CHECKS */
2989 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
2990 if (!checkTidesZero(lambda1, lambda2))
2991 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
2992 /* Call the waveform driver routine. */
2993 hlm = XLALSimIMRPhenomTPHM_ChooseTDModes(m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, r, deltaT, f_min, f_ref, LALpars);
2994 break;
2995
2996 case SEOBNRv4HM_PA:
2997 case pSEOBNRv4HM_PA:
2998 /* Waveform-specific sanity checks */
3000 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3001 if (!checkTidesZero(lambda1, lambda2))
3002 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3003 if (f_ref != 0.)
3004 XLALPrintWarning("XLAL Warning - %s: This approximant does not use f_ref. The reference phase will be defined at coalescence.\n", __func__);
3005
3006 UINT4 SpinAlignedEOBversion;
3007 if (approximant == SEOBNRv4HM_PA) SpinAlignedEOBversion = 4111;
3008 if (approximant == pSEOBNRv4HM_PA) SpinAlignedEOBversion = 4112;
3009
3010 REAL8Vector *dynamics = NULL;
3011 REAL8Vector *dynamicsHi = NULL;
3012
3013 REAL8 lambda2Tidal1 = 0.0;
3014 REAL8 lambda2Tidal2 = 0.0;
3015 REAL8 omega02Tidal1 = 0.0;
3016 REAL8 omega02Tidal2 = 0.0;
3017 REAL8 lambda3Tidal1 = 0.0;
3018 REAL8 lambda3Tidal2 = 0.0;
3019 REAL8 omega03Tidal1 = 0.0;
3020 REAL8 omega03Tidal2 = 0.0;
3021 REAL8 quadparam1 = 1.0;
3022 REAL8 quadparam2 = 1.0;
3023 REAL8Vector *nqcCoeffsInput = NULL;
3024 INT4 nqcFlag = 0;
3025
3026 LALDict *PAParams = XLALCreateDict();
3027 XLALDictInsertUINT4Value(PAParams, "PAFlag", 1);
3028 XLALDictInsertUINT4Value(PAParams, "PAOrder", 8);
3029 XLALDictInsertREAL8Value(PAParams, "rFinal", 1.8);
3030 XLALDictInsertREAL8Value(PAParams, "rSwitch", 1.8);
3031 XLALDictInsertUINT2Value(PAParams, "analyticFlag", 1);
3032
3033 LALDict *TGRParams = XLALCreateDict();
3034 REAL8 domega220 = 0.0;
3035 REAL8 dtau220 = 0.0;
3036 REAL8 domega210 = 0.0;
3037 REAL8 dtau210 = 0.0;
3038 REAL8 domega330 = 0.0;
3039 REAL8 dtau330 = 0.0;
3040 REAL8 domega440 = 0.0;
3041 REAL8 dtau440 = 0.0;
3042 REAL8 domega550 = 0.0;
3043 REAL8 dtau550 = 0.0;
3044
3055
3056 UINT2 TGRflag = 0;
3057 if (approximant == pSEOBNRv4HM_PA) TGRflag = 1;
3058
3069
3070 XLALDictInsertUINT2Value(TGRParams, "TGRflag", TGRflag);
3071
3073 &hlm,
3074 &dynamics, &dynamicsHi,
3075 deltaT,
3076 m1, m2,
3077 f_min,
3078 r,
3079 S1z, S2z,
3080 SpinAlignedEOBversion,
3081 lambda2Tidal1, lambda2Tidal2,
3082 omega02Tidal1, omega02Tidal2,
3083 lambda3Tidal1, lambda3Tidal2,
3084 omega03Tidal1, omega03Tidal2,
3085 quadparam1, quadparam2,
3086 nqcCoeffsInput, nqcFlag,
3087 PAParams,
3088 TGRParams) == XLAL_FAILURE
3089 ){
3091 };
3092
3093 if(dynamics) XLALDestroyREAL8Vector(dynamics);
3094 if(dynamicsHi) XLALDestroyREAL8Vector(dynamicsHi);
3095 XLALDestroyDict(PAParams);
3096 XLALDestroyDict(TGRParams);
3097
3098 UINT4 i;
3099 UINT4 modeArrayCreated = 0;
3100
3102 LALpars
3103 );
3104
3105 if (modeArray == NULL) {
3106 modeArray = XLALSimInspiralCreateModeArray();
3107 modeArrayCreated = 1;
3108
3109 XLALSimInspiralModeArrayActivateMode(modeArray, 2, 2);
3110 XLALSimInspiralModeArrayActivateMode(modeArray, 2, 1);
3111 XLALSimInspiralModeArrayActivateMode(modeArray, 3, 3);
3112 XLALSimInspiralModeArrayActivateMode(modeArray, 4, 4);
3113 XLALSimInspiralModeArrayActivateMode(modeArray, 5, 5);
3114 }
3115
3116 SphHarmTimeSeries *modes = hlm;
3117 COMPLEX16TimeSeries *tmpMode = NULL;
3118 char modeName[40];
3119
3120 while (modes) {
3122 modeArray, modes->l, -modes->m
3123 ) == 1) {
3124 sprintf(modeName, "h%dm%d", modes->l, modes->m);
3125
3127 modeName,
3128 &modes->mode->epoch,
3129 0,
3130 deltaT,
3132 modes->mode->data->length
3133 );
3134
3135 for (i = 0; i < modes->mode->data->length; i++) {
3136 tmpMode->data->data[i] = pow(-1, modes->l) * conj(- modes->mode->data->data[i]);
3137 }
3138
3139 hlm = XLALSphHarmTimeSeriesAddMode(hlm, tmpMode, modes->l, -(modes->m));
3140 }
3141
3143 modeArray, modes->l, modes->m
3144 ) == 1) {
3145
3146 for (i = 0; i < modes->mode->data->length; i++)
3147 modes->mode->data->data[i] *= -1;
3148 }
3149
3150 modes = modes->next;
3151 }
3152
3153 if (modeArrayCreated) {
3154 XLALDestroyValue(modeArray);
3155 }
3156
3158
3159 break;
3160
3161 case SEOBNRv4P:
3162 /* Waveform-specific sanity checks */
3164 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3165 if (!checkTidesZero(lambda1, lambda2))
3166 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3167 if (f_ref != 0.)
3168 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
3169
3170 spin1[0] = S1x;
3171 spin1[1] = S1y;
3172 spin1[2] = S1z;
3173 spin2[0] = S2x;
3174 spin2[1] = S2y;
3175 spin2[2] = S2z;
3176 PrecEOBversion = 401;
3177 hlm = XLALSimIMRSpinPrecEOBModes(deltaT, m1, m2, f_min, r, spin1, spin2, PrecEOBversion, LALpars);
3178 break;
3179
3180 case SEOBNRv4PHM:
3181 /* Waveform-specific sanity checks */
3183 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3184 if (!checkTidesZero(lambda1, lambda2))
3185 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3186 if (f_ref != 0.)
3187 XLALPrintWarning("XLAL Warning - %s: This approximant does use f_ref. The reference phase will be defined at coalescence.\n", __func__);
3188
3189 spin1[0] = S1x;
3190 spin1[1] = S1y;
3191 spin1[2] = S1z;
3192 spin2[0] = S2x;
3193 spin2[1] = S2y;
3194 spin2[2] = S2z;
3195 PrecEOBversion = 402;
3196 hlm = XLALSimIMRSpinPrecEOBModes(deltaT, m1, m2, f_min, r, spin1, spin2, PrecEOBversion, LALpars);
3197 break;
3198
3199 case SpinTaylorT1:
3200 case SpinTaylorT5:
3201 case SpinTaylorT4:
3202 if (lmax > 4)
3203 XLALPrintError("XLAL ERROR - %s: maximum l implemented for SpinTaylors is 4, = %d requested.\n", __func__, lmax);
3204
3205 REAL8TimeSeries *V = NULL;
3206 REAL8TimeSeries *Phi = NULL;
3207 REAL8TimeSeries *Spin1x = NULL;
3208 REAL8TimeSeries *Spin1y = NULL;
3209 REAL8TimeSeries *Spin1z = NULL;
3210 REAL8TimeSeries *Spin2x = NULL;
3211 REAL8TimeSeries *Spin2y = NULL;
3212 REAL8TimeSeries *Spin2z = NULL;
3213 REAL8TimeSeries *LNhx = NULL;
3214 REAL8TimeSeries *LNhy = NULL;
3215 REAL8TimeSeries *LNhz = NULL;
3216 REAL8TimeSeries *E1x = NULL;
3217 REAL8TimeSeries *E1y = NULL;
3218 REAL8TimeSeries *E1z = NULL;
3219
3220 /* Here we start dynamics with L//z and e1//x
3221 * which is not the standard case for SpinTaylor
3222 */
3223 REAL8 lnhx = 0.;
3224 REAL8 lnhy = 0.;
3225 REAL8 lnhz = 1.;
3226 REAL8 e1x = 1.;
3227 REAL8 e1y = 0.;
3228 REAL8 e1z = 0.;
3229 //phi_ref is added later
3230 errCode +=
3231 XLALSimInspiralSpinTaylorDriver(NULL, NULL, &V, &Phi, &Spin1x, &Spin1y, &Spin1z, &Spin2x, &Spin2y, &Spin2z, &LNhx, &LNhy, &LNhz, &E1x, &E1y, &E1z, 0., deltaT, m1, m2, f_min, f_ref, r, S1x, S1y, S1z, S2x, S2y, S2z, lnhx, lnhy, lnhz, e1x, e1y,
3232 e1z, LALpars, approximant);
3233 INT4 ma_needs_destroy = 0;
3234 LALValue *modearray = XLALSimInspiralWaveformParamsLookupModeArray(LALpars);
3235 if (modearray == NULL) {
3236 modearray = XLALSimInspiralCreateModeArray();
3237 ma_needs_destroy = 1;
3238 for (l = 2; l <= (UINT4) lmax; l++)
3240 }
3241 errCode += XLALSimInspiralSpinTaylorHlmModesFromOrbit(&hlm, V, Phi, LNhx, LNhy, LNhz, E1x, E1y, E1z, Spin1x, Spin1y, Spin1z, Spin2x, Spin2y, Spin2z, m1, m2, r, XLALSimInspiralWaveformParamsLookupPNAmplitudeOrder(LALpars), modearray);
3242
3257 if (ma_needs_destroy)
3258 XLALDestroyValue(modearray);
3259 break;
3260
3261 default:
3262 XLALPrintError("Cannot generate modes for this approximant\n");
3264 }
3265 if (errCode || !(hlm))
3267
3268 return hlm;
3269}
3270
3271/**
3272 * Copy of the old code of XLALSimInspiralChooseFDModes(). The new version of XLALSimInspiralChooseFDModes() is just a wrapper over XLALSimInspiralGenerateFDModes().
3273 * XLALSimInspiralGeenrateFDModes() internally calls this function for legacy approximants.
3274 */
3276 REAL8 m1, /* mass of companion 1 (kg) */
3277 REAL8 m2, /* mass of companion 2 (kg) */
3278 REAL8 S1x, /* x-component of the dimensionless spin of object 1 */
3279 REAL8 S1y, /* y-component of the dimensionless spin of object 1 */
3280 REAL8 S1z, /* z-component of the dimensionless spin of object 1 */
3281 REAL8 S2x, /* x-component of the dimensionless spin of object 2 */
3282 REAL8 S2y, /* y-component of the dimensionless spin of object 2 */
3283 REAL8 S2z, /* z-component of the dimensionless spin of object 2 */
3284 REAL8 deltaF, /* sampling interval (s) */
3285 REAL8 f_min, /* starting GW frequency (Hz) */
3286 REAL8 f_max, /* ending GW frequency (Hz) */
3287 REAL8 f_ref, /* reference GW frequency (Hz) */
3288 REAL8 phiRef, /* reference phase (rad) */
3289 REAL8 distance, /* distance of source (m) */
3290 REAL8 inclination, /* inclination of source (rad) */
3291 LALDict *params, /* LAL dictionary containing accessory parameters (optional mode array) */
3292 Approximant approximant /* approximant to use for waveform production */
3293)
3294{
3295
3298
3299 /* General sanity checks that will abort
3300 *
3301 * If non-GR approximants are added, include them in
3302 * XLALSimInspiralApproximantAcceptTestGRParams()
3303 */
3305 XLALPrintError("XLAL Error - %s: Passed in non-NULL pointer to LALSimInspiralTestGRParam for an approximant that does not use LALSimInspiralTestGRParam\n", __func__);
3307 }
3308
3309 /* General sanity check the input parameters - only give warnings! */
3310 if (deltaF > 1.)
3311 XLALPrintWarning("XLAL Warning - %s: Large value of deltaF = %e requested...This corresponds to a very short TD signal (with padding). Consider a smaller value.\n", __func__, deltaF);
3312 if (deltaF < 1. / 4096.)
3313 XLALPrintWarning("XLAL Warning - %s: Small value of deltaF = %e requested...This corresponds to a very long TD signal. Consider a larger value.\n", __func__, deltaF);
3314 if (m1 < 0.09 * LAL_MSUN_SI)
3315 XLALPrintWarning("XLAL Warning - %s: Small value of m1 = %e (kg) = %e (Msun) requested...Perhaps you have a unit conversion error?\n", __func__, m1, m1 / LAL_MSUN_SI);
3316 if (m2 < 0.09 * LAL_MSUN_SI)
3317 XLALPrintWarning("XLAL Warning - %s: Small value of m2 = %e (kg) = %e (Msun) requested...Perhaps you have a unit conversion error?\n", __func__, m2, m2 / LAL_MSUN_SI);
3318 if (m1 + m2 > 1000. * LAL_MSUN_SI)
3319 XLALPrintWarning("XLAL Warning - %s: Large value of total mass m1+m2 = %e (kg) = %e (Msun) requested...Signal not likely to be in band of ground-based detectors.\n", __func__, m1 + m2, (m1 + m2) / LAL_MSUN_SI);
3320 if (S1x * S1x + S1y * S1y + S1z * S1z > 1.000001)
3321 XLALPrintWarning("XLAL Warning - %s: S1 = (%e,%e,%e) with norm > 1 requested...Are you sure you want to violate the Kerr bound?\n", __func__, S1x, S1y, S1z);
3322 if (S2x * S2x + S2y * S2y + S2z * S2z > 1.000001)
3323 XLALPrintWarning("XLAL Warning - %s: S2 = (%e,%e,%e) with norm > 1 requested...Are you sure you want to violate the Kerr bound?\n", __func__, S2x, S2y, S2z);
3324 if (f_min < 1.)
3325 XLALPrintWarning("XLAL Warning - %s: Small value of fmin = %e requested...Check for errors, this could create a very long waveform.\n", __func__, f_min);
3326 if (f_min > 40.000001)
3327 XLALPrintWarning("XLAL Warning - %s: Large value of fmin = %e requested...Check for errors, the signal will start in band.\n", __func__, f_min);
3328
3329 /* Adjust the reference frequency for certain precessing approximants:
3330 * if that approximate interprets f_ref==0 to be f_min, set f_ref=f_min;
3331 * otherwise do nothing */
3333
3334 /* Output object, structure with the individual modes required.
3335 The values of each mode are returned both for positive and negative frequencies to be consistent with the precessing models. */
3336 SphHarmFrequencySeries *hlms = NULL;
3337
3338 /* Frequency array of each mode. It will have both positive and negative values. */
3339 REAL8Sequence *freqsSphH = NULL;
3340
3341
3342 /* The following variables are only used for PhenomHM and SEOBNRv4HM_ROM since some extra operations are needed for them. */
3343
3344 /* Input ModeArray. If not specified in the LAL dictionary, it will return all the available modes in the model. */
3345 LALValue *ModeArray = NULL;
3346 LALDict *params_aux;
3347 /* This is an auxiliar, easy to read list with the modes in the ModeArray option.
3348 E.g. if (2,-2), (3,-3) are activated, the it would be (2, -2, 3, -3). */
3349 INT2Sequence *modeseq;
3350 /* Variable for the number of modes in the ModeArray */
3351 UINT4 nmodes;
3352 /* Variable for the length of individual modes in half the frequency spectrum. */
3353 INT4 length;
3354 /* Auxiliar variable to store the individual modes computed from the internal functions of each model which later we will
3355 apply some operations to be consistent with LAL conventions. */
3357 *hlms_tmp = NULL;
3358
3359 INT4 retcode;
3360
3361 switch (approximant) {
3362 case IMRPhenomXHM:
3363 /* Waveform-specific sanity checks */
3365 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3366 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
3367 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
3368 if (!checkTidesZero(lambda1, lambda2))
3369 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3370
3371 /* Compute individual modes from IMRPhenomXHM */
3372 XLALSimIMRPhenomXHMModes(&hlms, m1, m2, S1z, S2z, deltaF, f_min, f_max, f_ref, phiRef, distance, params);
3373 break;
3374
3375 case IMRPhenomXPHM:
3376 /* Waveform-specific sanity checks */
3378 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3379 if (!checkTidesZero(lambda1, lambda2))
3380 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3381
3382 /* Compute individual modes in the J-frame from IMRPhenomXPHM */
3383 XLALSimIMRPhenomXPHMModes(&hlms, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, deltaF, f_min, f_max, f_ref, phiRef, distance, inclination, params);
3384 break;
3385
3386 case IMRPhenomXO4a:
3387 if (params == NULL){
3388 params_aux = XLALCreateDict();
3389 }
3390 else{
3391 params_aux = XLALDictDuplicate(params);
3392 }
3393
3394 /* XO4 uses previous version of XHM */
3396
3397 /* Waveform-specific sanity checks */
3399 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3400 if( !checkTidesZero(lambda1, lambda2) )
3401 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3402
3403 /* Toggle on PNR angles */
3404 if(!XLALDictContains(params_aux, "PNRUseTunedAngles")){
3406 }
3407
3408 /* Toggle on tuned coprecessing strain */
3409 if(!XLALDictContains(params_aux, "PNRUseTunedCoprec")){
3411 }
3412
3413 /* Ensure that 33 tuning is set to preferred value */
3414 if(!XLALDictContains(params_aux, "PNRUseTunedCoprec33")){
3416 }
3417 if(!XLALDictContains(params_aux, "PNRForceXHMAlignment")){
3419 }
3420
3421 /* Toggle on antisymmetric contributions */
3422 if(!XLALDictContains(params_aux, "AntisymmetricWaveform")){
3424 }
3425
3427 {
3429 {
3430 XLAL_ERROR_NULL(XLAL_EFUNC,"Error: Antisymmetric waveform generation not supported without PNR angles, please turn on PNR angles to produce waveform with asymmetries in the (2,2) and (2,-2) modes \n");
3431 }
3432 }
3433
3434 /* Toggle on reviewed PrecVersion and FinalSpinMod */
3435 if(!XLALDictContains(params_aux, "PrecVersion")){
3437 }
3438
3439 /* Compute individual modes in the J-frame from IMRPhenomXPHM */
3440 XLALSimIMRPhenomXPHMModes(&hlms, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, deltaF, f_min, f_max, f_ref, phiRef, distance, inclination, params_aux);
3441
3442 XLALDestroyDict(params_aux);
3443
3444 break;
3445
3446
3447 case IMRPhenomXPNR:
3448 if (params == NULL){
3449 params_aux = XLALCreateDict();
3450 }
3451 else{
3452 params_aux = XLALDictDuplicate(params);
3453 }
3454
3455 /* XO4 uses previous version of XHM */
3457
3458 /* Waveform-specific sanity checks */
3460 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3461 if( !checkTidesZero(lambda1, lambda2) )
3462 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3463
3464 /* Toggle on PNR angles */
3465 if(!XLALDictContains(params_aux, "PNRUseTunedAngles")){
3467 }
3468
3469 /* Toggle on tuned coprecessing strain */
3470 if(!XLALDictContains(params_aux, "PNRUseTunedCoprec")){
3472 }
3473
3474 /* Ensure that 33 tuning is set to preferred value */
3475 if(!XLALDictContains(params_aux, "PNRUseTunedCoprec33")){
3477 }
3478 if(!XLALDictContains(params_aux, "PNRForceXHMAlignment")){
3480 }
3481
3482 /* Toggle on antisymmetric contributions */
3483 if(!XLALDictContains(params_aux, "AntisymmetricWaveform")){
3485 }
3486
3488 {
3490 {
3491 XLAL_ERROR_NULL(XLAL_EFUNC,"Error: Antisymmetric waveform generation not supported without PNR angles, please turn on PNR angles to produce waveform with asymmetries in the (2,2) and (2,-2) modes \n");
3492 }
3493 }
3494
3495 /* Toggle on reviewed PrecVersion and FinalSpinMod */
3496 if(!XLALDictContains(params_aux, "PrecVersion")){
3498 }
3499
3500 if(!XLALDictContains(params_aux, "FinalSpinMod")){
3502 }
3503
3504 /* Toggle the conditional precession multibanding */
3505 if(!XLALDictContains(params_aux, "MBandPrecVersion")){
3507 }
3508
3509 /* Compute individual modes in the J-frame from IMRPhenomXPHM */
3510 XLALSimIMRPhenomXPHMModes(&hlms, m1, m2, S1x, S1y, S1z, S2x, S2y, S2z, deltaF, f_min, f_max, f_ref, phiRef, distance, inclination, params_aux);
3511
3512 XLALDestroyDict(params_aux);
3513
3514 break;
3515
3516
3517 case SEOBNRv4HM_ROM:
3518 /* Waveform-specific sanity checks */
3520 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3521 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
3522 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
3523 if (!checkTidesZero(lambda1, lambda2))
3524 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3525
3526 /* First we define the mode array of the output SphHarmFrequencySeries.
3527 Although the user can choose this array, the model computes internally all the modes
3528 and then we just pick those specified by the user.
3529 The only exception is when only the 2,-2 mode is required, in such case SEOBNRv4_ROM is called.
3530 */
3531 if (params == NULL) {
3532 params_aux = XLALCreateDict();
3533 } else {
3534 params_aux = XLALDictDuplicate(params);
3535 }
3536 ModeArray = XLALSimInspiralWaveformParamsLookupModeArray(params_aux);
3537 if (ModeArray == NULL) {
3538 /* If not specified, fill array with default modes of IMRPhenomHM */
3539 ModeArray = XLALSimInspiralCreateModeArray();
3540 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
3541 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -1);
3542 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, -3);
3543 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, -4);
3544 XLALSimInspiralModeArrayActivateMode(ModeArray, 5, -5);
3545 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
3546 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 1);
3547 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, 3);
3548 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, 4);
3549 XLALSimInspiralModeArrayActivateMode(ModeArray, 5, 5);
3550
3551 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3552
3553 XLALDestroyValue(ModeArray);
3554 nmodes = modeseq->length / 2;
3555 } else // This is just to avoid killing the kernel when you ask for a mode that is not available.
3556 {
3557 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3558 XLALDestroyValue(ModeArray);
3559 nmodes = modeseq->length / 2;
3560
3561 /* Check that there are not unavailable modes. */
3562 LALValue *DefaultModeArray = XLALSimInspiralCreateModeArray();
3563 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -2);
3564 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -1);
3565 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, -3);
3566 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, -4);
3567 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 5, -5);
3568 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 2);
3569 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 1);
3570 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, 3);
3571 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, 4);
3572 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 5, 5);
3573
3574 for (UINT4 i = 0; i < nmodes; i++) {
3575 INT2 l, m;
3576 l = modeseq->data[2 * i];
3577 m = modeseq->data[2 * i + 1];
3578 if (XLALSimInspiralModeArrayIsModeActive(DefaultModeArray, l, m) == 0) {
3579 XLALDestroyValue(DefaultModeArray);
3580 XLALDestroyINT2Sequence(modeseq);
3581 XLALFree(hlms_tmp);
3582 XLAL_ERROR_NULL(XLAL_EINVAL, "Mode (%i,%i) is not available in SEOBNRv4HM_ROM.\n", l, m);
3583 }
3584 }
3585 XLALDestroyValue(DefaultModeArray);
3586 }
3587 XLALDestroyDict(params_aux);
3588
3589 UINT2 eobmodes = 5;
3590 if (nmodes == 1 && modeseq->data[0] == 2 && abs(modeseq->data[0]) == 2) {
3591 eobmodes = 1; // This will internally call SEOBNRv4_ROM instead of all the modes, therefore saving time.
3592 }
3593
3594 /* Compute individual modes of SEOBNRv4HM_ROM */
3595 retcode = XLALSimIMRSEOBNRv4HMROM_Modes(hlms_tmp, phiRef, deltaF, f_min, f_max, f_ref, distance, m1, m2, S1z, S2z, -1, eobmodes, 1);
3596 if (retcode != XLAL_SUCCESS) {
3597 XLALFree(hlms_tmp);
3599 }
3600
3601
3602 /* This is the length of half of the frequency spectrum.
3603 Later we will resize series to add the negative frequency regime. */
3604 length = (*hlms_tmp)->mode->data->length - 1;
3605
3606
3607 /* Loop over modes in the SphHarmFrequencySeries. Resize each mode. */
3608 for (UINT4 i = 0; i < nmodes; i++) {
3609 INT2 l, m;
3610 l = modeseq->data[2 * i];
3611 m = modeseq->data[2 * i + 1];
3612
3614
3615
3616 if (m < 0) {
3617 /* Resize series to add the negative frequency regime */
3618 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, -length, 2 * length + 1);
3619 } else {
3620 /* Use equatorial symmetry to transform negative to positive mode. */
3621 INT4 minus1l = -1;
3622 if (l % 2 == 0) {
3623 minus1l = 1;
3624 }
3625 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, 0, 2 * length + 1);
3626 for (INT4 j = 0; j < length; j++) {
3627 hlm->data->data[j] = minus1l * conj(hlm->data->data[hlm->data->length - 1 - j]);
3628 hlm->data->data[hlm->data->length - 1 - j] = 0.;
3629 }
3630 }
3631
3632 hlms = XLALSphHarmFrequencySeriesAddMode(hlms, hlm, l, m);
3633 }
3634 XLALDestroyINT2Sequence(modeseq);
3636
3637 /* Add frequency array to SphHarmFrequencySeries */
3638 freqsSphH = XLALCreateREAL8Sequence(2 * length + 1);
3639 for (INT4 i = -length; i <= length; i++) {
3640 freqsSphH->data[i + length] = i * deltaF;
3641 }
3642 XLALSphHarmFrequencySeriesSetFData(hlms, freqsSphH);
3643 break;
3644
3645 case SEOBNRv5_ROM:
3646 /* Waveform-specific sanity checks */
3648 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3649 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
3650 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
3651 if( !checkTidesZero(lambda1, lambda2) )
3652 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3653
3654 if(params == NULL){
3655 params_aux = XLALCreateDict();
3656 }
3657 else{
3658 params_aux = XLALDictDuplicate(params);
3659 }
3660 ModeArray = XLALSimInspiralWaveformParamsLookupModeArray(params_aux);
3661 if(ModeArray == NULL)
3662 {
3663 /* If not specified, fill array with default modes of SEOBNRv5_ROM */
3664 ModeArray = XLALSimInspiralCreateModeArray();
3665 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
3666 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
3667
3668 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3669
3670 XLALDestroyValue(ModeArray);
3671 nmodes = modeseq->length/2;
3672 }
3673 else // This is just to avoid killing the kernel when you ask for a mode that is not available.
3674 {
3675 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3676 XLALDestroyValue(ModeArray);
3677 nmodes = modeseq->length/2;
3678
3679 /* Check that there are not unavailable modes. */
3680 LALValue *DefaultModeArray = XLALSimInspiralCreateModeArray();
3681 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -2);
3682 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 2);
3683
3684 for(UINT4 i=0; i<nmodes; i++)
3685 {
3686 INT2 l, m;
3687 l = modeseq->data[2*i];
3688 m = modeseq->data[2*i+1];
3689 if(XLALSimInspiralModeArrayIsModeActive(DefaultModeArray, l, m) == 0){
3690 XLALDestroyValue(DefaultModeArray);
3691 XLALDestroyINT2Sequence(modeseq);
3692 XLALFree(hlms_tmp);
3693 XLAL_ERROR_NULL(XLAL_EINVAL, "Mode (%i,%i) is not available in SEOBNRv5_ROM.\n", l, m);
3694 }
3695 }
3696 XLALDestroyValue(DefaultModeArray);
3697 }
3698 XLALDestroyDict(params_aux);
3699
3700 UINT2 eobmodesv5 = 1;
3701
3702 /* Compute individual modes of SEOBNRv5_ROM */
3703 retcode = XLALSimIMRSEOBNRv5HMROM_Modes(hlms_tmp, phiRef, deltaF, f_min, f_max, f_ref, distance, m1, m2, S1z, S2z, -1, eobmodesv5, true, params, NoNRT_V);
3704 if( retcode != XLAL_SUCCESS){
3705 XLALFree(hlms_tmp);
3707 }
3708
3709
3710 /* This is the length of half of the frequency spectrum.
3711 Later we will resize series to add the negative frequency regime. */
3712 length = (*hlms_tmp)->mode->data->length -1;
3713
3714
3715 /* Loop over modes in the SphHarmFrequencySeries. Resize each mode. */
3716 for(UINT4 i=0; i<nmodes; i++)
3717 {
3718 INT2 l, m;
3719 l = modeseq->data[2*i];
3720 m = modeseq->data[2*i+1];
3721
3723
3724
3725 if(m<0){
3726 /* Resize series to add the negative frequency regime */
3727 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, -length, 2*length+1);
3728 }
3729 else{
3730 /* Use equatorial symmetry to transform negative to positive mode. */
3731 INT4 minus1l = -1;
3732 if (l%2 == 0){
3733 minus1l = 1;
3734 }
3735 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, 0, 2*length+1);
3736 for(INT4 j=0; j<length; j++)
3737 {
3738 hlm->data->data[j] = minus1l * conj(hlm->data->data[hlm->data->length -1 - j]);
3739 hlm->data->data[hlm->data->length -1 - j] = 0.;
3740 }
3741 }
3742
3743 hlms = XLALSphHarmFrequencySeriesAddMode(hlms, hlm, l, m);
3744 }
3745 XLALDestroyINT2Sequence(modeseq);
3747
3748 /* Add frequency array to SphHarmFrequencySeries */
3749 freqsSphH = XLALCreateREAL8Sequence(2*length+1);
3750 for (INT4 i = -length; i<=length; i++)
3751 {
3752 freqsSphH->data[i+length] = i*deltaF;
3753 }
3754 XLALSphHarmFrequencySeriesSetFData(hlms, freqsSphH);
3755 break;
3756
3757 case SEOBNRv5HM_ROM:
3758 /* Waveform-specific sanity checks */
3760 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3761 if( !checkTransverseSpinsZero(S1x, S1y, S2x, S2y) )
3762 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
3763 if( !checkTidesZero(lambda1, lambda2) )
3764 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3765
3766 if(params == NULL){
3767 params_aux = XLALCreateDict();
3768 }
3769 else{
3770 params_aux = XLALDictDuplicate(params);
3771 }
3772 ModeArray = XLALSimInspiralWaveformParamsLookupModeArray(params_aux);
3773 if(ModeArray == NULL)
3774 {
3775 /* If not specified, fill array with default modes of SEOBNRv5HM_ROM */
3776 ModeArray = XLALSimInspiralCreateModeArray();
3777 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
3778 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -1);
3779 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, -3);
3780 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, -4);
3781 XLALSimInspiralModeArrayActivateMode(ModeArray, 5, -5);
3782 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, -2);
3783 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, -3);
3784 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
3785 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 1);
3786 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, 3);
3787 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, 4);
3788 XLALSimInspiralModeArrayActivateMode(ModeArray, 5, 5);
3789 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, 2);
3790 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, 3);
3791
3792
3793 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3794
3795 XLALDestroyValue(ModeArray);
3796 nmodes = modeseq->length/2;
3797 }
3798 else // This is just to avoid killing the kernel when you ask for a mode that is not available.
3799 {
3800 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3801 XLALDestroyValue(ModeArray);
3802 nmodes = modeseq->length/2;
3803
3804 /* Check that there are not unavailable modes. */
3805 LALValue *DefaultModeArray = XLALSimInspiralCreateModeArray();
3806 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -2);
3807 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -1);
3808 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, -3);
3809 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, -4);
3810 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 5, -5);
3811 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, -2);
3812 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, -3);
3813 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 2);
3814 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 1);
3815 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, 3);
3816 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, 4);
3817 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 5, 5);
3818 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, 2);
3819 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, 3);
3820
3821 for(UINT4 i=0; i<nmodes; i++)
3822 {
3823 INT2 l, m;
3824 l = modeseq->data[2*i];
3825 m = modeseq->data[2*i+1];
3826 if(XLALSimInspiralModeArrayIsModeActive(DefaultModeArray, l, m) == 0){
3827 XLALDestroyValue(DefaultModeArray);
3828 XLALDestroyINT2Sequence(modeseq);
3829 XLALFree(hlms_tmp);
3830 XLAL_ERROR_NULL(XLAL_EINVAL, "Mode (%i,%i) is not available in SEOBNRv5HM_ROM.\n", l, m);
3831 }
3832 }
3833 XLALDestroyValue(DefaultModeArray);
3834 }
3835 XLALDestroyDict(params_aux);
3836
3837 UINT2 eobmodesv5hm = 7;
3838 if(nmodes == 1 && modeseq->data[0]==2 && abs(modeseq->data[1])==2)
3839 {
3840 eobmodesv5hm = 1; // This will internally call SEOBNRv5_ROM instead of all the modes, therefore saving time.
3841 }
3842
3843 /* If asking for a subset of modes in the proper order only those are computed, and not all 7 */
3844 if (
3845 nmodes == 2 &&
3846 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
3847 modeseq->data[2] == 3 && abs(modeseq->data[3]) == 3)
3848 {
3849 eobmodesv5hm = 2;
3850 }
3851 if (
3852 nmodes == 3 &&
3853 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
3854 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
3855 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1)
3856 {
3857 eobmodesv5hm = 3;
3858 }
3859 if (
3860 nmodes == 4 &&
3861 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
3862 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
3863 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1 &&
3864 modeseq->data[6] == 4 && abs(modeseq->data[7]) == 4)
3865 {
3866 eobmodesv5hm = 4;
3867 }
3868 if (
3869 nmodes == 5 &&
3870 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
3871 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
3872 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1 &&
3873 modeseq->data[6] == 4 && abs(modeseq->data[7]) == 4 &&
3874 modeseq->data[8] == 5 && abs(modeseq->data[9]) == 5)
3875 {
3876 eobmodesv5hm = 5;
3877 }
3878 if (
3879 nmodes == 6 &&
3880 modeseq->data[0] == 2 && abs(modeseq->data[1]) == 2 &&
3881 modeseq->data[4] == 3 && abs(modeseq->data[5]) == 3 &&
3882 modeseq->data[2] == 2 && abs(modeseq->data[3]) == 1 &&
3883 modeseq->data[8] == 4 && abs(modeseq->data[9]) == 4 &&
3884 modeseq->data[10] == 5 && abs(modeseq->data[11]) == 5 &&
3885 modeseq->data[6] == 3 && abs(modeseq->data[7]) == 2)
3886 {
3887 eobmodesv5hm = 6;
3888 }
3889 /* Compute individual modes of SEOBNRv5HM_ROM */
3890 retcode = XLALSimIMRSEOBNRv5HMROM_Modes(hlms_tmp, phiRef, deltaF, f_min, f_max, f_ref, distance, m1, m2, S1z, S2z, -1, eobmodesv5hm, true, params, NoNRT_V);
3891 if( retcode != XLAL_SUCCESS){
3892 XLALFree(hlms_tmp);
3894 }
3895
3896
3897 /* This is the length of half of the frequency spectrum.
3898 Later we will resize series to add the negative frequency regime. */
3899 length = (*hlms_tmp)->mode->data->length -1;
3900
3901
3902 /* Loop over modes in the SphHarmFrequencySeries. Resize each mode. */
3903 for(UINT4 i=0; i<nmodes; i++)
3904 {
3905 INT2 l, m;
3906 l = modeseq->data[2*i];
3907 m = modeseq->data[2*i+1];
3908
3910
3911
3912 if(m<0){
3913 /* Resize series to add the negative frequency regime */
3914 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, -length, 2*length+1);
3915 }
3916 else{
3917 /* Use equatorial symmetry to transform negative to positive mode. */
3918 INT4 minus1l = -1;
3919 if (l%2 == 0){
3920 minus1l = 1;
3921 }
3922 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, 0, 2*length+1);
3923 for(INT4 j=0; j<length; j++)
3924 {
3925 hlm->data->data[j] = minus1l * conj(hlm->data->data[hlm->data->length -1 - j]);
3926 hlm->data->data[hlm->data->length -1 - j] = 0.;
3927 }
3928 }
3929
3930 hlms = XLALSphHarmFrequencySeriesAddMode(hlms, hlm, l, m);
3931 }
3932 XLALDestroyINT2Sequence(modeseq);
3934
3935 /* Add frequency array to SphHarmFrequencySeries */
3936 freqsSphH = XLALCreateREAL8Sequence(2*length+1);
3937 for (INT4 i = -length; i<=length; i++)
3938 {
3939 freqsSphH->data[i+length] = i*deltaF;
3940 }
3941 XLALSphHarmFrequencySeriesSetFData(hlms, freqsSphH);
3942 break;
3943
3944 case IMRPhenomHM:
3945 /* Waveform-specific sanity checks */
3947 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-default flags given, but this approximant does not support this case.");
3948 if (!checkTransverseSpinsZero(S1x, S1y, S2x, S2y))
3949 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero transverse spins were given, but this is a non-precessing approximant.");
3950 if (!checkTidesZero(lambda1, lambda2))
3951 XLAL_ERROR_NULL(XLAL_EINVAL, "Non-zero tidal parameters were given, but this is approximant doe not have tidal corrections.");
3952
3953
3954 /* First we define the mode array of the output SphHarmFrequencySeries.
3955 PhenomHM only computes those modes specified in this array.
3956 We use an auxiliary LALDictionary params_I */
3957 if (params == NULL) {
3958 params_aux = XLALCreateDict();
3959 } else {
3960 params_aux = XLALDictDuplicate(params);
3961 }
3962 ModeArray = XLALSimInspiralWaveformParamsLookupModeArray(params_aux);
3963 if (ModeArray == NULL) {
3964 /* If not specified, fill array with default modes of IMRPhenomHM */
3965 ModeArray = XLALSimInspiralCreateModeArray();
3966 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 2);
3967 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, 1);
3968 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, 3);
3969 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, 2);
3970 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, 4);
3971 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, 3);
3972
3973 XLALSimInspiralWaveformParamsInsertModeArray(params_aux, ModeArray);
3974
3975 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -2);
3976 XLALSimInspiralModeArrayActivateMode(ModeArray, 2, -1);
3977 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, -3);
3978 XLALSimInspiralModeArrayActivateMode(ModeArray, 3, -2);
3979 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, -4);
3980 XLALSimInspiralModeArrayActivateMode(ModeArray, 4, -3);
3981
3982 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3983 nmodes = modeseq->length / 2;
3984 } else // This is to avoid killing the kernel when you ask for a mode that is not available.
3985 {
3986 modeseq = XLALSimInspiralModeArrayReadModes(ModeArray);
3987 nmodes = modeseq->length / 2;
3988
3989 /* Modes supported by IMRPhenomHM */
3990 LALValue *DefaultModeArray = XLALSimInspiralCreateModeArray();
3991 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 2);
3992 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, 1);
3993 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, 3);
3994 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, 2);
3995 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, 4);
3996 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, 3);
3997 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -2);
3998 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 2, -1);
3999 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, -3);
4000 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 3, -2);
4001 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, -4);
4002 XLALSimInspiralModeArrayActivateMode(DefaultModeArray, 4, -3);
4003
4004 /* Check if there is any mode not supported */
4005 for (UINT4 i = 0; i < nmodes; i++) {
4006 INT2 l, m;
4007 l = modeseq->data[2 * i];
4008 m = modeseq->data[2 * i + 1];
4009
4010 if (XLALSimInspiralModeArrayIsModeActive(DefaultModeArray, l, m) == 0) {
4011 XLALDestroyValue(ModeArray);
4012 XLALDestroyValue(DefaultModeArray);
4013 XLALDestroyINT2Sequence(modeseq);
4014 XLALFree(hlms_tmp);
4015 XLAL_ERROR_NULL(XLAL_EINVAL, "Mode (%i,%i) is not available in IMRPhenomHM.\n", l, m);
4016 }
4017 /* For the internal function of IMRPhenomHM we must pass an array only with positive modes */
4018 if (m < 0) {
4020 XLALSimInspiralModeArrayActivateMode(ModeArray, l, abs(m));
4021 }
4022 }
4023 XLALSimInspiralWaveformParamsInsertModeArray(params_aux, ModeArray);
4024 XLALDestroyValue(DefaultModeArray);
4025 }
4026
4027 /* Build structure for minimum and maximum frequencies */
4029 freqs->data[0] = f_min;
4030 freqs->data[1] = f_max;
4031
4032
4033 /* Call individual modes of PhenomHM */
4034 retcode = XLALSimIMRPhenomHMGethlmModes(hlms_tmp, freqs, m1, m2, 0., 0., S1z, 0., 0., S2z, phiRef, deltaF, f_ref, params_aux);
4036 if (retcode != XLAL_SUCCESS) {
4037 XLALFree(hlms_tmp);
4039 }
4040
4041
4042 /* This is the length of half of the frequency spectrum.
4043 Later we will resize series to add the negative frequency regime. */
4044 length = (*hlms_tmp)->mode->data->length - 1;
4045
4046
4047 /* PhenomHM returns the modes in geometrical units, we need to multiply them by amp0 to obtain physical units. */
4048 const REAL8 Mtot_Msun = (m1 + m2) / LAL_MSUN_SI;
4049 const REAL8 amp0 = Mtot_Msun * LAL_MRSUN_SI * Mtot_Msun * LAL_MTSUN_SI / distance;
4050
4051 /* PhenomHM neglects the LAL convention that the azimuthal angle of the spherical harmonics Ylm is PI/2 - phiRef.
4052 Here we compesate by this factor so it is consistent with the polarizations construction. */
4053 COMPLEX16 extra_phase = cexp(-I * (LAL_PI_2 - phiRef));
4054
4055 /* Loop over modes in the SphHarmFrequencySeries.
4056 We add the previous factors and resize the series. */
4057 for (UINT4 i = 0; i < nmodes; i++) {
4058 INT2 l, m; // Indexes of mode
4059 l = modeseq->data[2 * i];
4060 m = modeseq->data[2 * i + 1];
4061
4062 /* Get one individual mode.
4063 Either if m is positive or negative we read the same mode and transform accordingly later. */
4065
4066 INT4 minus1l = -1;
4067 if (l % 2 == 0)
4068 minus1l = 1;
4069
4070 /* Incorporate correct units and */
4071 COMPLEX16 extra_factor_lm = minus1l * amp0 * cpow(extra_phase, m);
4072
4073 if (m < 0) {
4074 for (UINT4 j = 0; j < hlm->data->length; j++) {
4075 hlm->data->data[j] = hlm->data->data[j] * extra_factor_lm;
4076 }
4077 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, -length, 2 * length + 1);
4078 } else {
4079 if (XLALSimInspiralModeArrayIsModeActive(ModeArray, l, -m) == 1) {
4080 extra_factor_lm = minus1l;
4081 } else {
4082 extra_factor_lm = minus1l * extra_factor_lm;
4083 }
4084 hlm = XLALResizeCOMPLEX16FrequencySeries(hlm, 0, 2 * length + 1);
4085 for (INT4 j = 0; j < length; j++) {
4086 hlm->data->data[j] = conj(hlm->data->data[hlm->data->length - 1 - j]) * extra_factor_lm;
4087 hlm->data->data[hlm->data->length - 1 - j] = 0.;
4088 }
4089 }
4090
4091 /* Add the mode to the SphHarmFrequencySeries */
4092 hlms = XLALSphHarmFrequencySeriesAddMode(hlms, hlm, l, m);
4093
4094 }
4095 XLALDestroyINT2Sequence(modeseq);
4097 XLALDestroyValue(ModeArray);
4098 XLALDestroyDict(params_aux);
4099
4100 /* Add frequency array to SphHarmFrequencySeries */
4101 /* Here we build the whole frequency regime (negative and positive). */
4102 freqsSphH = XLALCreateREAL8Sequence(hlms->mode->data->length);
4103 for (INT4 i = -length; i <= length; i++) {
4104 freqsSphH->data[i + length] = i * deltaF;
4105 }
4106 XLALSphHarmFrequencySeriesSetFData(hlms, freqsSphH);
4107
4108 break;
4109 default:
4110 XLALPrintError("XLAL ERROR - %s approximant not supported by ChooseFDModes.\n", XLALSimInspiralGetStringFromApproximant(approximant));
4112 }
4113 XLALFree(hlms_tmp);
4114
4115 if (!(hlms))
4117
4118 return hlms;
4119}
int XLALDictContains(const LALDict *dict, const char *key)
void XLALDestroyDict(LALDict *dict)
LALDict * XLALDictDuplicate(const LALDict *orig)
LALDict * XLALCreateDict(void)
int XLALDictInsertUINT4Value(LALDict *dict, const char *key, UINT4 value)
int XLALDictInsertUINT2Value(LALDict *dict, const char *key, UINT2 value)
int XLALDictInsertREAL8Value(LALDict *dict, const char *key, REAL8 value)
INT4 XLALDictLookupINT4Value(const LALDict *dict, const char *key)
int XLALSimIMRPhenomHM(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8Sequence *freqs, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1z, REAL8 chi2z, const REAL8 distance, const REAL8 inclination, const REAL8 phiRef, const REAL8 deltaF, REAL8 f_ref, LALDict *extraParams)
int XLALSimIMRPhenomXPHMModes(SphHarmFrequencySeries **hlms, REAL8 m1_SI, REAL8 m2_SI, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 deltaF, REAL8 f_min, REAL8 f_max, REAL8 f_ref, REAL8 phiRef, REAL8 distance, REAL8 inclination, LALDict *LALparams)
Function to obtain a SphHarmFrequencySeries with the individual modes h_lm.
int XLALSimIMRPhenSpinInspiralRDGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phi0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 f_ref, REAL8 r, REAL8 iota, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, int phaseO, int ampO, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, LALDict *LALparams)
int XLALSimIMRPhenomPv3(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8Sequence *freqs, REAL8 m1_SI, REAL8 m2_SI, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, const REAL8 distance, const REAL8 inclination, const REAL8 phiRef, const REAL8 deltaF, const REAL8 f_ref, LALDict *extraParams)
Driver routine to compute the precessing inspiral-merger-ringdown phenomenological waveform IMRPhenom...
int XLALSimIMRSEOBNRv4HMROM_Modes(SphHarmFrequencySeries **hlm, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, UINT4 nModes, bool use_hybridization)
int XLALSimIMRPhenomPv3HMGetHplusHcross(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8Sequence *freqs, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, const REAL8 distance, const REAL8 inclination, const REAL8 phiRef, const REAL8 deltaF, REAL8 f_ref, LALDict *extraParams)
int XLALSimIMRTEOBResumS(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiRef, const REAL8 deltaT, const REAL8 m1, const REAL8 m2, const REAL8 S1x, const REAL8 S1y, const REAL8 S1z, const REAL8 S2x, const REAL8 S2y, const REAL8 S2z, const REAL8 lambda1, const REAL8 lambda2, const REAL8 distance, const REAL8 inclination, const REAL8 longAscNodes, LALDict *LALparams, const REAL8 eccentricity, const REAL8 meanPerAno, const REAL8 f_min, const REAL8 f_ref)
int XLALSimIMRPhenomHMGethlmModes(SphHarmFrequencySeries **hlms, REAL8Sequence *freqs, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, const REAL8 phiRef, const REAL8 deltaF, REAL8 f_ref, LALDict *extraParams)
int XLALSimInspiralNRWaveformGetHplusHcross(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 inclination, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 r, REAL8 fStart, REAL8 fRef, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, const char *NRDataFile, LALValue *ModeArray)
int XLALSimIMRSEOBNRv5HMROM(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, UINT4 nModes, bool use_hybridization, LALDict *LALParams, NRTidal_version_type NRTidal_version)
int XLALSimIMREOBNRv2HMROM(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, const int higherModesFlag)
int XLALSimSpinInspiralGenerator(REAL8TimeSeries **hPlus, REAL8TimeSeries **hCross, REAL8 phi_start, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 f_ref, REAL8 r, REAL8 iota, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, int phaseO, int ampO, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, LALDict *LALparams)
int XLALSimIMRSpinEOBWaveform(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 inc, const REAL8 spin1[], const REAL8 spin2[], const UINT4 PrecEOBversion)
Standard interface for SEOBNRv3 waveform generator: calls XLALSimIMRSpinEOBWaveformAll.
int XLALSimIMRSEOBNRv4HMROM(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, UINT4 nModes, bool use_hybridization, LALDict *LALParams)
int XLALSimIMRSEOBNRv5HMROM_Modes(SphHarmFrequencySeries **hlm, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, UINT4 nModes, bool use_hybridization, LALDict *LALParams, NRTidal_version_type NRTidal_version)
int XLALSimIMRSpinPrecEOBWaveform(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 inc, const REAL8 INspin1[], const REAL8 INspin2[], const UINT4 PrecEOBversion, LALDict *LALParams)
SphHarmTimeSeries * XLALSimIMRSpinPrecEOBModes(const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 INspin1[], const REAL8 INspin2[], const UINT4 PrecEOBversion, LALDict *LALParams)
SphHarmTimeSeries * XLALSimIMRNRHybSur3dq8Modes(REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 chi1z, REAL8 chi2z, REAL8 fMin, REAL8 fRef, REAL8 distance, LALDict *LALparams)
Reference: arxiv:1812.07865.
INT4 XLALSimIMRNRHybSur3dq8Polarizations(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 inclination, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 distance, REAL8 fMin, REAL8 fRef, REAL8 chi1z, REAL8 chi2z, LALDict *LALparams)
Reference: arxiv:1812.07865.
int XLALSimNRSur4d2s(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z)
Compute waveform in LAL format for the NRSur4d2s_FDROM NR surrogate model.
#define ROTATEY(angle, vx, vy, vz)
int XLALSimInspiralApproximantAcceptTestGRParams(Approximant approx)
const char * XLALSimInspiralGetStringFromApproximant(Approximant approximant)
Returns a string associated with an Approximant enum value.
int XLALSimInspiralSetQuadMonParamsFromLambdas(LALDict *LALparams)
if you do NOT provide a quadparam[1,2] term and you DO provide lamdba[1,2] then we calculate quad-mon...
int XLALSimLorentzInvarianceViolationTerm(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1, REAL8 m2, REAL8 r, LALDict *LALparams)
int XLALSimInspiralEFD(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, const REAL8 phiRef, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 fStart, const REAL8 fEnd, const REAL8 i, const REAL8 r, const REAL8 inclination_azimuth, const REAL8 e_min, int phaseO)
SphHarmTimeSeries * XLALSimInspiralTaylorT3PNModes(REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO, int lmax)
SphHarmTimeSeries * XLALSimInspiralTaylorT2PNModes(REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO, int lmax)
int XLALSimInspiralSpinTaylorDriver(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8TimeSeries **Vout, REAL8TimeSeries **Phiout, REAL8TimeSeries **S1xout, REAL8TimeSeries **S1yout, REAL8TimeSeries **S1zout, REAL8TimeSeries **S2xout, REAL8TimeSeries **S2yout, REAL8TimeSeries **S2zout, REAL8TimeSeries **LNhxout, REAL8TimeSeries **LNhyout, REAL8TimeSeries **LNhzout, REAL8TimeSeries **E1xout, REAL8TimeSeries **E1yout, REAL8TimeSeries **E1zout, REAL8 phiRef, REAL8 deltaT, REAL8 m1_SI, REAL8 m2_SI, REAL8 fStart, REAL8 fRef, REAL8 r, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 e1x, REAL8 e1y, REAL8 e1z, LALDict *LALparams, Approximant approx)
Driver function to generate any of SpinTaylorT1/T5/T4 If the output entries are not null the relative...
SphHarmTimeSeries * XLALSimInspiralTaylorT1PNModes(REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO, int lmax)
int XLALSimInspiralGeneratorAddConditioningForApproximant(LALSimInspiralGenerator *generator, int approximant)
int XLALSimInspiralTaylorT2PNGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 i, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO)
int XLALSimInspiralTEOBResumROM(REAL8TimeSeries **hPlus, REAL8TimeSeries **hCross, REAL8 phiRef, REAL8 deltaT, REAL8 fLow, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 lambda1, REAL8 lambda2)
INT4 XLALSimInspiralSpinTaylorHlmModesFromOrbit(SphHarmTimeSeries **hlm, REAL8TimeSeries *V, REAL8TimeSeries *Phi, REAL8TimeSeries *LNhx, REAL8TimeSeries *LNhy, REAL8TimeSeries *LNhz, REAL8TimeSeries *e1x, REAL8TimeSeries *e1y, REAL8TimeSeries *e1z, REAL8TimeSeries *S1x, REAL8TimeSeries *S1y, REAL8TimeSeries *S1z, REAL8TimeSeries *S2x, REAL8TimeSeries *S2y, REAL8TimeSeries *S2z, REAL8 m1_SI, REAL8 m2_SI, REAL8 distance, int ampO, LALValue *modearray)
int XLALSimInspiralTaylorT4PNGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 i, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO)
int XLALSimInspiralSpinDominatedWaveformInterfaceTD(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 fStart, REAL8 fRef, REAL8 D, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 incl, int phaseO, int amplitudeO, REAL8 phiRef)
Interface routine, calculating the prefered variables for the Spin-dominated waveforms.
SphHarmTimeSeries * XLALSimInspiralTaylorT4PNModes(REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO, int lmax)
static int generate_fd_waveform(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
Fourier domain polarizations.
static int generate_fd_modes(SphHarmFrequencySeries **hlm, LALDict *params, LALSimInspiralGenerator *myself)
Define waveform generator methods to generate polarizations or modes in time or Fourier domain for le...
static int generate_td_waveform(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
Time domain polarizations.
static int XLALSimInspiralChooseTDWaveform_legacy(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 distance, REAL8 inclination, REAL8 phiRef, REAL8 longAscNodes, REAL8 eccentricity, REAL8 meanPerAno, REAL8 deltaT, REAL8 f_min, REAL8 f_ref, LALDict *params, Approximant approximant)
Copy of the old code of XLALSimInspiralChooseTDWaveform().
static int generate_td_modes(SphHarmTimeSeries **hlm, LALDict *params, LALSimInspiralGenerator *myself)
Time domain modes.
#define DEFINE_GENERATOR_TEMPLATE(approx, fd_modes, fd_waveform, td_modes, td_waveform)
Define which methods are supported by every legacy approximant.
static int initialize(LALSimInspiralGenerator *myself, LALDict *params)
Method to initialize generator.
static SphHarmFrequencySeries * XLALSimInspiralChooseFDModes_legacy(REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 deltaF, REAL8 f_min, REAL8 f_max, REAL8 f_ref, REAL8 phiRef, REAL8 distance, REAL8 inclination, LALDict *params, Approximant approximant)
Copy of the old code of XLALSimInspiralChooseFDModes().
static SphHarmTimeSeries * XLALSimInspiralChooseTDModes_legacy(REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 f_min, REAL8 f_ref, REAL8 r, LALDict *LALpars, int lmax, Approximant approximant)
Copy of the old code of XLALSimInspiralChooseTDModes().
static int XLALSimInspiralChooseFDWaveform_legacy(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 distance, REAL8 inclination, REAL8 phiRef, REAL8 longAscNodes, REAL8 eccentricity, REAL8 meanPerAno, REAL8 deltaF, REAL8 f_min, REAL8 f_max, REAL8 f_ref, LALDict *params, Approximant approximant)
LALValue * XLALSimInspiralWaveformParamsLookupModeArray(LALDict *params)
int XLALSimInspiralWaveformParamsInsertModeArray(LALDict *params, LALValue *value)
REAL8 XLALSimInspiralWaveformParamsLookupDOmega220(LALDict *params)
int XLALSimInspiralWaveformParamsInsertDTau220(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertDOmega440(LALDict *params, REAL8 value)
REAL8 XLALSimInspiralWaveformParamsLookupDTau220(LALDict *params)
int XLALSimInspiralWaveformParamsInsertTidalQuadrupolarFMode1(LALDict *params, REAL8 value)
INT4 XLALSimInspiralWaveformParamsLookupEnableLIV(LALDict *params)
int XLALSimInspiralWaveformParamsInsertDTau440(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertPhenomXPNRUseTunedCoprec33(LALDict *params, INT4 value)
int XLALSimInspiralWaveformParamsInsertEccentricityFreq(LALDict *params, REAL8 value)
REAL8 XLALSimInspiralWaveformParamsLookupDOmega550(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupDTau550(LALDict *params)
int XLALSimInspiralWaveformParamsInsertPhenomXPNRUseTunedAngles(LALDict *params, INT4 value)
REAL8 XLALSimInspiralWaveformParamsLookupdQuadMon1(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupFrameAxis(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupTidalLambda2(LALDict *params)
int XLALSimInspiralWaveformParamsInsertDOmega330(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertDOmega550(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertTidalOctupolarFMode1(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertDTau330(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertDOmega210(LALDict *params, REAL8 value)
REAL8 XLALSimInspiralWaveformParamsLookupDTau330(LALDict *params)
int XLALSimInspiralWaveformParamsInsertPhenomXAntisymmetricWaveform(LALDict *params, INT4 value)
REAL8 XLALSimInspiralWaveformParamsLookupDOmega210(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupEccentricityFreq(LALDict *params)
int XLALSimInspiralWaveformParamsInsertTidalOctupolarLambda1(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertTidalOctupolarFMode2(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertPhenomXPNRForceXHMAlignment(LALDict *params, INT4 value)
INT4 XLALSimInspiralWaveformParamsLookupPhenomXPHMUseModes(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupTidalLambda1(LALDict *params)
int XLALSimInspiralWaveformParamsInsertPhenomXPFinalSpinMod(LALDict *params, INT4 value)
int XLALSimInspiralWaveformParamsInsertDOmega220(LALDict *params, REAL8 value)
const char * XLALSimInspiralWaveformParamsLookupNumRelData(LALDict *params)
int XLALSimInspiralWaveformParamsInsertPhenomXHMReleaseVersion(LALDict *params, INT4 value)
REAL8 XLALSimInspiralWaveformParamsLookupDOmega440(LALDict *params)
int XLALSimInspiralWaveformParamsInsertPhenomXPNRUseTunedCoprec(LALDict *params, INT4 value)
REAL8 XLALSimInspiralWaveformParamsLookupPhenomXHMThresholdMband(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupDTau210(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNPhaseOrder(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNAmplitudeOrder(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupDOmega330(LALDict *params)
int XLALSimInspiralWaveformParamsModesChoiceIsDefault(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPhenomXPNRUseTunedAngles(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupdQuadMon2(LALDict *params)
int XLALSimInspiralWaveformParamsInsertDTau550(LALDict *params, REAL8 value)
INT4 XLALSimInspiralWaveformParamsLookupPhenomXAntisymmetricWaveform(LALDict *params)
INT4 XLALSimInspiralWaveformParamsLookupPNTidalOrder(LALDict *params)
int XLALSimInspiralWaveformParamsInsertDTau210(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertdQuadMon2(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertTidalOctupolarLambda2(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertPhenomXTidalFlag(LALDict *params, INT4 value)
int XLALSimInspiralWaveformParamsInsertTidalQuadrupolarFMode2(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertdQuadMon1(LALDict *params, REAL8 value)
int XLALSimInspiralWaveformParamsInsertPhenomXPHMMBandVersion(LALDict *params, INT4 value)
int XLALSimInspiralWaveformParamsInsertPhenomXPrecVersion(LALDict *params, INT4 value)
int XLALSimInspiralWaveformParamsPNSpinOrderIsDefault(LALDict *params)
int XLALSimInspiralWaveformParamsFrameAxisIsDefault(LALDict *params)
REAL8 XLALSimInspiralWaveformParamsLookupDTau440(LALDict *params)
REAL8 XLALSimUniversalRelationlambda3TidalVSlambda2Tidal(REAL8 lambda2bar)
Eq.
REAL8 XLALSimUniversalRelationomega03TidalVSlambda3Tidal(REAL8 lambda3bar)
Eq.
REAL8 XLALSimUniversalRelationQuadMonVSlambda2Tidal(REAL8 lambda2bar)
REAL8 XLALSimUniversalRelationomega02TidalVSlambda2Tidal(REAL8 lambda2bar)
Eq.
void XLALDestroyValue(LALValue *value)
static REAL8 pfac(int n)
REAL8 tmp1
int l
Definition: bh_qnmode.c:135
double i
Definition: bh_ringdown.c:118
double e
Definition: bh_ringdown.c:117
#define checkCOSpinZero(s2x, s2y, s2z)
#define checkTransverseSpinsZero(s1x, s1y, s2x, s2y)
#define checkAlignedSpinsEqual(s1z, s2z)
#define checkSpinsZero(s1x, s1y, s1z, s2x, s2y, s2z)
#define checkTidesZero(lambda1, lambda2)
#define FIX_REFERENCE_FREQUENCY(f_ref, f_min, approximant)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
COMPLEX16FrequencySeries * XLALResizeCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series, int first, size_t length)
#define LAL_PI_2
#define LAL_MSUN_SI
#define LAL_PI
#define LAL_MTSUN_SI
#define LAL_MRSUN_SI
double complex COMPLEX16
double REAL8
int16_t INT2
uint16_t UINT2
uint32_t UINT4
int32_t INT4
void * XLALMalloc(size_t n)
void XLALFree(void *p)
@ IMRPhenomPv1_V
version 1: based on IMRPhenomC
Definition: LALSimIMR.h:74
@ IMRPhenomPv2_V
version 2: based on IMRPhenomD
Definition: LALSimIMR.h:75
@ IMRPhenomPv2NRTidal_V
version Pv2_NRTidal: based on IMRPhenomPv2; NRTides added before precession; can be used with both NR...
Definition: LALSimIMR.h:76
@ SEOBNRv4TSurrogate_CUBIC
use cubic splines in frequency
Definition: LALSimIMR.h:91
@ NRTidalv3_V
version NRTidalv3
Definition: LALSimIMR.h:83
@ NRTidal_V
version NRTidal: based on https://arxiv.org/pdf/1706.02969.pdf
Definition: LALSimIMR.h:81
@ NoNRT_V
special case for PhenomPv2 BBH baseline
Definition: LALSimIMR.h:87
@ NRTidalv2NSBH_V
version NRTidalv2: https://arxiv.org/abs/1905.06011 with amplitude corrections for NSBH (used for SEO...
Definition: LALSimIMR.h:86
@ NRTidalv2_V
version NRTidalv2: https://arxiv.org/abs/1905.06011
Definition: LALSimIMR.h:82
int XLALSimIMREOBNRv2AllModes(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fLower, const REAL8 distance, const REAL8 inclination)
This function generates the plus and cross polarizations for the EOBNRv2 approximant with all availab...
SphHarmTimeSeries * XLALSimIMREOBNRv2Modes(const REAL8 deltaT, const REAL8 m1, const REAL8 m2, const REAL8 fLower, const REAL8 distance)
Wrapper function to generate the -2 spin-weighted spherical harmonic modes (as opposed to generating ...
int XLALSimIMREOBNRv2DominantMode(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, const REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fLower, const REAL8 distance, const REAL8 inclination)
This function generates the plus and cross polarizations for the dominant (2,2) mode of the EOBNRv2 a...
int XLALSimIMRPhenomBGenerateFD(COMPLEX16FrequencySeries **htilde, const REAL8 phiPeak, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi, const REAL8 f_min, const REAL8 f_max, const REAL8 distance)
Driver routine to compute the spin-aligned, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomP(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, const REAL8 chi1_l, const REAL8 chi2_l, const REAL8 chip, const REAL8 thetaJ, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 distance, const REAL8 alpha0, const REAL8 phic, const REAL8 deltaF, const REAL8 f_min, const REAL8 f_max, const REAL8 f_ref, IMRPhenomP_version_type IMRPhenomP_version, NRTidal_version_type NRTidal_version, LALDict *extraParams)
Driver routine to compute the precessing inspiral-merger-ringdown phenomenological waveform IMRPhenom...
int XLALSimIMRPhenomDGenerateFD(COMPLEX16FrequencySeries **htilde, const REAL8 phi0, const REAL8 fRef, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi1, const REAL8 chi2, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, LALDict *extraParams, NRTidal_version_type NRTidal_version)
Driver routine to compute the spin-aligned, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomPCalculateModelParametersFromSourceFrame(REAL8 *chi1_l, REAL8 *chi2_l, REAL8 *chip, REAL8 *thetaJN, REAL8 *alpha0, REAL8 *phi_aligned, REAL8 *zeta_polariz, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 f_ref, const REAL8 phiRef, const REAL8 incl, const REAL8 s1x, const REAL8 s1y, const REAL8 s1z, const REAL8 s2x, const REAL8 s2y, const REAL8 s2z, IMRPhenomP_version_type IMRPhenomP_version)
Function to map LAL parameters (masses, 6 spin components, phiRef and inclination at f_ref) (assumed ...
double XLALSimIMRPhenomBComputeChi(const REAL8 m1, const REAL8 m2, const REAL8 s1z, const REAL8 s2z)
Compute the dimensionless, spin-aligned parameter chi as used in the IMRPhenomB waveform.
int XLALSimIMRPhenomAGenerateFD(COMPLEX16FrequencySeries **htilde, const REAL8 phiPeak, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 f_min, const REAL8 f_max, const REAL8 distance)
Driver routine to compute the non-spinning, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomAGenerateTD(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiPeak, const REAL8 deltaT, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, const REAL8 inclination)
Driver routine to compute the non-spinning, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomCGenerateTD(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiPeak, const REAL8 deltaT, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, const REAL8 inclination, LALDict *extraParams)
Driver routine to compute the spin-aligned, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomCGenerateFD(COMPLEX16FrequencySeries **htilde, const REAL8 phiPeak, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, LALDict *extraParams)
Driver routine to compute the spin-aligned, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomNSBH(COMPLEX16FrequencySeries **htilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 mBH_SI, REAL8 mNS_SI, REAL8 chi_BH, REAL8 chi_NS, LALDict *extraParams)
Driver routine to compute the single-spin, non-precessing, neutron-star-black-hole,...
int XLALSimIMRPhenomBGenerateTD(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiPeak, const REAL8 deltaT, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, const REAL8 inclination)
Driver routine to compute the spin-aligned, inspiral-merger-ringdown phenomenological waveform IMRPhe...
int XLALSimIMRPhenomTHM(REAL8TimeSeries **hp, REAL8TimeSeries **hc, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, REAL8 distance, REAL8 inclination, REAL8 deltaT, REAL8 fmin, REAL8 fRef, REAL8 phiRef, LALDict *lalparams)
Routine to compute time domain polarisations for IMRPhenomTHM model.
SphHarmTimeSeries * XLALSimIMRPhenomTHM_Modes(REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, REAL8 distance, REAL8 deltaT, REAL8 fmin, REAL8 fRef, REAL8 phiRef, LALDict *lalParams)
Routine to compute time domain Spin-Weighted Spherical Harmonic modes for IMRPhenomTHM model.
int XLALSimIMRPhenomT(REAL8TimeSeries **hp, REAL8TimeSeries **hc, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, REAL8 distance, REAL8 inclination, REAL8 deltaT, REAL8 fmin, REAL8 fRef, REAL8 phiRef, LALDict *lalParams)
Routine to compute time domain polarisations for IMRPhenomT model.
int XLALSimIMRPhenomTPHM(REAL8TimeSeries **hp, REAL8TimeSeries **hc, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, REAL8 distance, REAL8 inclination, REAL8 deltaT, REAL8 fmin, REAL8 fRef, REAL8 phiRef, LALDict *lalParams)
Routine to compute time-domain polarizations for the IMRPhenomTPHM model.
SphHarmTimeSeries * XLALSimIMRPhenomTPHM_ChooseTDModes(REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, REAL8 distance, REAL8 deltaT, REAL8 fmin, REAL8 fRef, LALDict *lalParams)
Routine to be used by ChooseTDModes, it returns a list of the time-domain modes of the IMRPhenomTPHM ...
int XLALSimIMRPhenomTP(REAL8TimeSeries **hp, REAL8TimeSeries **hc, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, REAL8 distance, REAL8 inclination, REAL8 deltaT, REAL8 fmin, REAL8 fRef, REAL8 phiRef, LALDict *lalParams)
Routine to compute time-domain polarizations for the IMRPhenomTP model.
int XLALSimIMRPhenomXPHMFromModes(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, const REAL8 distance, const REAL8 inclination, const REAL8 phiRef, REAL8 f_min, REAL8 f_max, const REAL8 deltaF, REAL8 fRef_In, LALDict *lalParams)
Returns hptilde and hctilde of the multimode precessing waveform for positive frequencies in an equal...
int XLALSimIMRPhenomXASGenerateFD(COMPLEX16FrequencySeries **htilde22, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, REAL8 distance, REAL8 f_min, REAL8 f_max, REAL8 deltaF, REAL8 phiRef, REAL8 fRef_In, LALDict *lalParams)
Driver routine to calculate an IMRPhenomX aligned-spin, inspiral-merger-ringdown phenomenological wav...
int XLALSimIMRPhenomXHMModes(SphHarmFrequencySeries **hlms, REAL8 m1_SI, REAL8 m2_SI, REAL8 S1z, REAL8 S2z, REAL8 deltaF, REAL8 f_min, REAL8 f_max, REAL8 f_ref, REAL8 phiRef, REAL8 distance, LALDict *LALparams)
Function to obtain a SphHarmFrequencySeries with the individual modes h_lm.
int XLALSimIMRPhenomXHM(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1z, REAL8 chi2z, REAL8 f_min, REAL8 f_max, REAL8 deltaF, REAL8 distance, REAL8 inclination, REAL8 phiRef, REAL8 fRef_In, LALDict *lalParams)
Returns the hptilde and hctilde of the multimode waveform for positive frequencies.
int XLALSimIMRPhenomXPGenerateFD(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, const REAL8 distance, const REAL8 inclination, const REAL8 phiRef, REAL8 f_min, REAL8 f_max, const REAL8 deltaF, REAL8 fRef_In, LALDict *lalParams)
int XLALSimIMRPhenomXPHM(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1x, REAL8 chi1y, REAL8 chi1z, REAL8 chi2x, REAL8 chi2y, REAL8 chi2z, REAL8 distance, REAL8 inclination, REAL8 phiRef, REAL8 f_min, REAL8 f_max, REAL8 deltaF, REAL8 fRef_In, LALDict *lalParams)
Returns hptilde and hctilde of the multimode precessing waveform for positive frequencies in an equal...
int XLALSimIMRPhenomXHM2(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, REAL8 distance, REAL8 f_min, REAL8 f_max, REAL8 deltaF, REAL8 inclination, REAL8 phiRef, REAL8 fRef_In, LALDict *lalParams)
Returns the hptilde and hctilde of the multimode waveform for positive frequencies.
int XLALSimIMRSEOBNRv4ROM(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format for the SEOBNRv4_ROM model.
int XLALSimIMRSEOBNRv2ROMDoubleSpin(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2)
Compute waveform in LAL format for the SEOBNRv2_ROM_DoubleSpin model.
int XLALSimIMRSEOBNRv2ROMDoubleSpinHI(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, INT4 nk_max)
Compute waveform in LAL format for the SEOBNRv2_ROM_DoubleSpin_HI model.
int XLALSimIMRSEOBNRv1ROMEffectiveSpin(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi)
Compute waveform in LAL format for the SEOBNRv1_ROM_EffectiveSpin model.
int XLALSimIMRSEOBNRv2ROMEffectiveSpin(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi)
Compute waveform in LAL format for the SEOBNRv2_ROM_EffectiveSpin model.
int XLALSimIMRSEOBNRv1ROMDoubleSpin(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2)
Compute waveform in LAL format for the SEOBNRv1_ROM_DoubleSpin model.
int XLALSimIMRSEOBNRv4TSurrogate(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, REAL8 lambda1, REAL8 lambda2, SEOBNRv4TSurrogate_spline_order spline_order)
Compute waveform in LAL format for the SEOBNRv4T_surrogate model.
int XLALSimIMRSpinAlignedEOBModes(SphHarmTimeSeries **hlmmode, REAL8Vector **dynamics_out, REAL8Vector **dynamicsHi_out, REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 spin1z, const REAL8 spin2z, UINT4 SpinAlignedEOBversion, const REAL8 lambda2Tidal1, const REAL8 lambda2Tidal2, const REAL8 omega02Tidal1, const REAL8 omega02Tidal2, const REAL8 lambda3Tidal1, const REAL8 lambda3Tidal2, const REAL8 omega03Tidal1, const REAL8 omega03Tidal2, const REAL8 quadparam1, const REAL8 quadparam2, REAL8Vector *nqcCoeffsInput, const INT4 nqcFlag, LALDict *PAParams, LALDict *TGRParams)
This function generates spin-aligned SEOBNRv1,2,2opt,4,4opt,2T,4T,4HM complex modes hlm.
int XLALSimIMRSpinAlignedEOBWaveform(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, const REAL8 phiC, REAL8 deltaT, const REAL8 m1SI, const REAL8 m2SI, const REAL8 fMin, const REAL8 r, const REAL8 inc, const REAL8 spin1z, const REAL8 spin2z, UINT4 SpinAlignedEOBversion, LALDict *LALparams)
int XLALSimIMRSEOBNRv5ROMNRTidal(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 chi2, REAL8 Lambda1, REAL8 Lambda2, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format for the SEOBNRv5_ROM_NRTidal tidal model based on SEOBNRv5_ROM.
int XLALSimIMRPhenomDNRTidal(COMPLEX16FrequencySeries **htilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 chi2, REAL8 lambda1, REAL8 lambda2, LALDict *extraParams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format for the IMRPhenomD_NRTidal tidal model based on IMRPhenomD.
int XLALSimIMRSEOBNRv4ROMNRTidal(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1, REAL8 chi2, REAL8 Lambda1, REAL8 Lambda2, LALDict *LALparams, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format for the SEOBNRv4_ROM_NRTidal tidal model based on SEOBNRv4_ROM.
int XLALSimIMRLackeyTidal2013(struct tagCOMPLEX16FrequencySeries **hptilde, struct tagCOMPLEX16FrequencySeries **hctilde, REAL8 phiRef, REAL8 deltaF, REAL8 fLow, REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 inclination, REAL8 mBH_SI, REAL8 mNS_SI, REAL8 chi_BH, REAL8 Lambda)
Compute waveform in LAL format for the Lackey et al (2013) tidal model based on SEOBNRv2_ROM_DoubleSp...
void XLALSimInspiralParseDictionaryToChooseTDWaveform(REAL8 *m1, REAL8 *m2, REAL8 *S1x, REAL8 *S1y, REAL8 *S1z, REAL8 *S2x, REAL8 *S2y, REAL8 *S2z, REAL8 *distance, REAL8 *inclination, REAL8 *phiRef, REAL8 *longAscNodes, REAL8 *eccentricity, REAL8 *meanPerAno, REAL8 *deltaT, REAL8 *f_min, REAL8 *f_ref, LALDict *params)
Insert all the input arguments needed by XALSimInspiralChooseTDWaveform() into a laldictionary.
void XLALSimInspiralParseDictionaryToChooseTDModes(REAL8 *phiRef, REAL8 *deltaT, REAL8 *m1, REAL8 *m2, REAL8 *S1x, REAL8 *S1y, REAL8 *S1z, REAL8 *S2x, REAL8 *S2y, REAL8 *S2z, REAL8 *f_min, REAL8 *f_ref, REAL8 *distance, INT4 *lmax, LALDict *params)
Insert all the input arguments needed by XLALSimInspiralChooseTDModes() into a laldictionary.
void XLALSimInspiralParseDictionaryToChooseFDWaveform(REAL8 *m1, REAL8 *m2, REAL8 *S1x, REAL8 *S1y, REAL8 *S1z, REAL8 *S2x, REAL8 *S2y, REAL8 *S2z, REAL8 *distance, REAL8 *inclination, REAL8 *phiRef, REAL8 *longAscNodes, REAL8 *eccentricity, REAL8 *meanPerAno, REAL8 *deltaF, REAL8 *f_min, REAL8 *f_max, REAL8 *f_ref, LALDict *params)
Insert all the input arguments needed by XLALSimInspiralChooseFDWaveform() into a laldictionary.
void XLALSimInspiralParseDictionaryToChooseFDModes(REAL8 *m1, REAL8 *m2, REAL8 *S1x, REAL8 *S1y, REAL8 *S1z, REAL8 *S2x, REAL8 *S2y, REAL8 *S2z, REAL8 *deltaF, REAL8 *f_min, REAL8 *f_max, REAL8 *f_ref, REAL8 *phiRef, REAL8 *distance, REAL8 *inclination, LALDict *params)
Insert all the input arguments needed by XLALSimInspiralChooseFDModes() into a laldictionary.
int XLALSimInspiralTDFromFD(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 distance, REAL8 inclination, REAL8 phiRef, REAL8 longAscNodes, REAL8 eccentricity, REAL8 meanPerAno, REAL8 deltaT, REAL8 f_min, REAL8 f_ref, LALDict *LALparams, Approximant approximant)
Helper routines for XLALSimInspiralTD(): performs conditioning of a FD waveform and transforms it to ...
Approximant
Enum that specifies the PN approximant to be used in computing the waveform.
@ TaylorR2F4
A frequency domain model closely related to TaylorT4.
@ EOBNRv2HM
UNDOCUMENTED.
@ SpinTaylorT4
Spinning case T4 models (lalsimulation's equivalent of SpinTaylorFrameless).
@ IMRPhenomPv3
Frequency domain (generic spins) inspiral-merger-ringdown templates of Hannam et al....
@ TaylorF2RedSpinTidal
TaylorF2 waveforms for non-precessing spins, defined in terms of a single (reduced-spin) parameter [A...
@ TaylorEt
UNDOCUMENTED.
@ SpinTaylorT5Fourier
Frequency domain (generic spins) inspiral only waveforms based on TaylorT5, , (the paper refers to S...
@ SEOBNRv4HM_PA
@ SEOBNRv2_ROM_DoubleSpin_HI
High resolution low-mass double-spin frequency domain reduced order model of spin-aligned EOBNR model...
@ SEOBNRv4_ROM_NRTidal
Low-mass double-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv4 [Bohe ...
@ IMRPhenomXAS_NRTidalv2
Spin non-precessing EOBNR model v4 with higher modes post-adiabatic dynamics (time domain) and TGR ri...
@ SEOBNRv2
Spin-aligned EOBNR model v2.
@ IMRPhenomTPHM
Time domain, precessing phenomenological IMR waveform model for L=2 sector ([arXiv: 20XY....
@ IMRPhenomP
Frequency domain (generic spins) inspiral-merger-ringdown templates of Hannam et al....
@ SEOBNRv4_ROM_NRTidalv2
based on NRTidalv2; https://arxiv.org/abs/1905.06011.
@ IMRPhenomXP
Frequency domain, precessing phenomenological IMR waveform model.
@ SEOBNRv2_opt
Optimized Spin-aligned EOBNR model v2.
@ SEOBNRv3_opt_rk4
USE RK4 Optimized Spin precessing EOBNR model v3.
@ IMRPhenomC
Frequency domain (non-precessing spins) inspiral-merger-ringdown templates of Santamaria et al [Santa...
@ SEOBNRv4HM_ROM
Low-mass double-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv4hm.
@ IMRPhenomPv2_NRTidal
Frequency domain tidal version of IMRPhenomPv2, using NRTidal framework from arXiv:1706....
@ IMRPhenomXP_NRTidalv3
Tidal extension of IMRPhenomXP based on NRTidalv3.
@ SEOBNRv3_pert
Perturbed [m1 -> m1*(1+1e-15)] Spin precessing EOBNR model v3.
@ SEOBNRv1
Spin-aligned EOBNR model.
@ IMRPhenomT
@ Lackey_Tidal_2013_SEOBNRv2_ROM
Frequency domain tidal model based on reduced order model of SEOBNRv2.
@ NRHybSur3dq8
Time domain, aligned-spin, higher modes, hybridized.
@ HGimri
Time domain inspiral-merger-ringdown waveform for quasi-circular intermediate mass-ratio inspirals [H...
@ SEOBNRv4
Spin nonprecessing EOBNR model v4.
@ SEOBNRv3
Spin precessing EOBNR model v3.
@ EOBNRv2
UNDOCUMENTED.
@ IMRPhenomXO4a
Frequency domain, precessing with subdominant modes phenomenological IMR waveform model with NR-tuned...
@ TEOBResum_ROM
Time domain reduced order model of EOB with tidal effects.
@ IMRPhenomNSBH
NSBH Tidal model.
@ IMRPhenomXPHM
Frequency domain, precessing with subdominant modes phenomenological IMR waveform model.
@ IMRPhenomD
Frequency domain (non-precessing spins) inspiral-merger-ringdown templates of Husa et al,...
@ IMRPhenomXHM
Frequency domain, non-precessing phenomenological IMR waveform model with subdominant modes ([arXiv:2...
@ EccentricFD
Frequency domain waveform in the SPA to describe low eccentricity systems.
@ SEOBNRv2_ROM_EffectiveSpin
Single-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv2.
@ SEOBNRv4P
Spin precessing EOBNR model based on SEOBNRv4.
@ NRSur7dq4
q=4 extension of NRSur7dq2, arxiv: 1905.09300
@ IMRPhenomD_NRTidal
Uses arxiv:1706.02969 to upgrad IMRPhenomD to a tidal approximant.
@ IMRPhenomXAS_NRTidalv3
Tidal extension of IMRPhenomXAS based on NRTidalv3.
@ TaylorF2RedSpin
TaylorF2 waveforms for non-precessing spins, defined in terms of a single (reduced-spin) parameter [A...
@ IMRPhenomXPNR
Frequency domain, precessing with subdominant modes phenomenological IMR waveform model with SpinTayl...
@ NR_hdf5
Time domain, NR waveform from HDF file.
@ SEOBNRv1_ROM_EffectiveSpin
Single-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv1 See [Purrer:201...
@ TaylorF2NLTides
The standard stationary phase approximation including a phenomenological model of nonlinear tidal eff...
@ IMRPhenomTP
Time domain, non-precessing phenomenological IMR waveform model with subdominant modes ([arXiv: 20XY....
@ IMRPhenomD_NRTidalv2
NRTidalv2; https://arxiv.org/abs/1905.06011.
@ IMRPhenomA
Time domain (non-spinning) inspiral-merger-ringdown waveforms generated from the inverse FFT of IMRPh...
@ IMRPhenomHM
Frequency domain with higher modes (non-precessing spins) inspiral-merger-ringdown templates,...
@ TaylorF2Ecc
The standard stationary phase approximation with eccentricity; Outputs a frequency-domain wave.
@ SEOBNRv4PHM
Spin precessing EOBNR model based on SEOBNRv4HM.
@ SpinTaylorT4Fourier
Frequency domain (generic spins) inspiral only waveforms based on TaylorT4, arXiv: 1408....
@ SpinDominatedWf
Time domain, inspiral only, 1 spin, precessing waveform, Tapai et al, arXiv: 1209....
@ IMRPhenomPv2
Frequency domain (generic spins) inspiral-merger-ringdown templates of Hannam et al....
@ IMRPhenomPv2_NRTidalv2
Frequency domain tidal version; based on https://arxiv.org/abs/1905.06011.
@ NRSur7dq2
Time domain, fully precessing NR surrogate model with up to ell=4 modes, arxiv: 1705....
@ TaylorT3
Time domain Taylor approximant in which phase is explicitly given as a function of time; outputs a ti...
@ SpinTaylorF2
Spinning case F2 models (single spin only).
@ NRSur4d2s
@ EOBNRv2HM_ROM
Frequency domain reduced order model of model EOBNRv2HM, no spin but with higher modes.
@ IMRPhenomXAS
Frequency domain, non-precessing phenomenological IMR waveform model ([arXiv:2001....
@ EOBNRv2_ROM
Frequency domain reduced order model of model EOBNRv2HM, no spin neither higher modes.
@ SpinTaylorT5
Spinning case T5 models, which is a variant of the spinning version of the original TaylorT2 (see ) d...
@ SEOBNRv5_ROM_NRTidalv3
based on NRTidalv3 (arXiv:2311.07456);
@ PhenSpinTaylor
Inspiral part of the PhenSpinTaylorRD.
@ TaylorT4
UNDOCUMENTED.
@ SEOBNRv4_ROM_NRTidalv2_NSBH
NSBH model based on SEOBNRv4_ROM_NRTidalv2.
@ SEOBNRv1_ROM_DoubleSpin
Double-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv1 See [Purrer:201...
@ SEOBNRv4HM
Spin nonprecessing EOBNR model v4 with higher modes, PhysRevD.98.084028 [arXiv:1803....
@ TaylorF2
The standard stationary phase approximation; Outputs a frequency-domain wave.
@ SEOBNRv4_ROM
Low-mass double-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv4.
@ SEOBNRv2_ROM_DoubleSpin
Double-spin frequency domain reduced order model of spin-aligned EOBNR model SEOBNRv2.
@ IMRPhenomB
Time domain (non-precessing spins) inspiral-merger-ringdown waveforms generated from the inverse FFT ...
@ PhenSpinTaylorRD
Phenomenological waveforms, interpolating between a T4 spin-inspiral and the ringdown.
@ SEOBNRv2T
Tidal EOB model.
@ IMRPhenomTHM
Time domain, non-precessing phenomenological IMR waveform model for the dominant (2,...
@ IMRPhenomPv3HM
Frequency domain (generic spins) inspiral-merger-ringdown templates of Khan et al.
@ pSEOBNRv4HM_PA
Spin non-precessing EOBNR model v4 with higher modes post-adiabatic dynamics (time domain),...
@ SEOBNRv4T
Tidal EOB model.
@ TaylorT1
Time domain Taylor approximant in which the energy and flux are both kept as Taylor expansions and a ...
@ SEOBNRv5_ROM
Time domain, precessing phenomenological IMR waveform model with subdominant modes ([arXiv: 20XY....
@ EccentricTD
Time domain Taylor T4 approximant including orbital eccentricity effects.
@ SEOBNRv3_opt
Optimized Spin precessing EOBNR model v3.
@ SpinTaylorT1
Spinning case T1 models.
@ IMRPhenomXP_NRTidalv2
Tidal extension of IMRPhenomXP based on [arXiv:1905.06011].
@ TEOBResumS
Resummed Spin-aligned Tidal EOB.
@ SEOBNRv5HM_ROM
External Python model.
@ TaylorT2
Time domain Taylor approximant in which the phase evolution is obtained by iteratively solving post-...
@ SEOBNRv4T_surrogate
Double-spin frequency domain surrogate model of spin-aligned tidal EOBNR model SEOBNRv4T.
@ SEOBNRv4_opt
Optimized Spin-aligned EOBNR model v4.
@ LAL_SIM_INSPIRAL_TESTGR_PARAMS
These approximants cannot accept testGR params as input params.
int XLALSimInspiralEccentricTDPNGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 i, REAL8 e_min, int amplitudeO, int phaseO)
Driver routine to compute the post-Newtonian inspiral waveform.
int XLALHGimriGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 r, REAL8 i, REAL8 S1z)
int XLALSimInspiralSpinTaylorT5Fourier(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 fMin, REAL8 fMax, REAL8 deltaF, INT4 kMax, REAL8 phiRef, REAL8 v0, REAL8 m1, REAL8 m2, REAL8 fStart, REAL8 fRef, REAL8 r, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 e1x, REAL8 e1y, REAL8 e1z, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, LALDict *LALparams, INT4 phaseO, INT4 amplitudeO, INT4 phiRefAtEnd)
Driver routine to compute a precessing post-Newtonian inspiral waveform in the Fourier domain with ph...
int XLALSimInspiralSpinTaylorT5(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 fStart, REAL8 fRef, REAL8 r, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 e1x, REAL8 e1y, REAL8 e1z, LALDict *LALparams)
Driver routine to compute a precessing post-Newtonian inspiral waveform with phasing computed from en...
int XLALSimInspiralInitialConditionsPrecessingApproxs(REAL8 *inc, REAL8 *S1x, REAL8 *S1y, REAL8 *S1z, REAL8 *S2x, REAL8 *S2y, REAL8 *S2z, const REAL8 inclIn, const REAL8 S1xIn, const REAL8 S1yIn, const REAL8 S1zIn, const REAL8 S2xIn, const REAL8 S2yIn, const REAL8 S2zIn, const REAL8 m1, const REAL8 m2, const REAL8 fRef, const REAL8 phiRef, LALSimInspiralFrameAxis axisChoice)
Function to specify the desired orientation of the spin components of a precessing binary.
int XLALSimInspiralSpinTaylorT4(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 fStart, REAL8 fRef, REAL8 r, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 e1x, REAL8 e1y, REAL8 e1z, LALDict *LALParams)
int XLALSimInspiralSpinTaylorF2(COMPLEX16FrequencySeries **hplus_out, COMPLEX16FrequencySeries **hcross_out, REAL8 phi_ref, REAL8 deltaF, REAL8 m1_SI, REAL8 m2_SI, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, const REAL8 fStart, const REAL8 fEnd, const REAL8 f_ref, const REAL8 r, LALDict *moreParams, INT4 phaseO, INT4 amplitudeO)
Computes the stationary phase approximation to the Fourier transform of a chirp waveform with phase g...
int XLALSimInspiralSpinTaylorT1(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 fStart, REAL8 fRef, REAL8 r, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 e1x, REAL8 e1y, REAL8 e1z, LALDict *LALparams)
int XLALSimInspiralSpinTaylorT4Fourier(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 fMin, REAL8 fMax, REAL8 deltaF, INT4 kMax, REAL8 phiRef, REAL8 v0, REAL8 m1, REAL8 m2, REAL8 fStart, REAL8 fRef, REAL8 r, REAL8 s1x, REAL8 s1y, REAL8 s1z, REAL8 s2x, REAL8 s2y, REAL8 s2z, REAL8 lnhatx, REAL8 lnhaty, REAL8 lnhatz, REAL8 e1x, REAL8 e1y, REAL8 e1z, REAL8 lambda1, REAL8 lambda2, REAL8 quadparam1, REAL8 quadparam2, LALDict *LALparams, INT4 phaseO, INT4 amplitudeO, INT4 phiRefAtEnd)
Driver routine to compute a precessing post-Newtonian inspiral waveform in the Fourier domain with ph...
int XLALSimInspiralTaylorF2Ecc(COMPLEX16FrequencySeries **htilde, const REAL8 phi_ref, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 S1z, const REAL8 S2z, const REAL8 fStart, const REAL8 fEnd, const REAL8 f_ref, const REAL8 r, const REAL8 eccentricity, LALDict *LALparams)
Computes the stationary phase approximation to the Fourier transform of a chirp waveform with eccentr...
int XLALSimInspiralTaylorF2ReducedSpinTidal(COMPLEX16FrequencySeries **htilde, const REAL8 phic, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi, const REAL8 lam1, const REAL8 lam2, const REAL8 fStart, const REAL8 fEnd, const REAL8 r, const INT4 phaseO, const INT4 ampO)
Generate the "reduced-spin templates" proposed in http://arxiv.org/abs/1107.1267 Add the tidal phase ...
int XLALSimInspiralTaylorF2ReducedSpin(COMPLEX16FrequencySeries **htilde, const REAL8 phic, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi, const REAL8 fStart, const REAL8 fEnd, const REAL8 r, const INT4 phaseO, const INT4 ampO)
Driver routine to compute a non-precessing post-Newtonian inspiral waveform in the frequency domain,...
REAL8 XLALSimInspiralTaylorF2ReducedSpinComputeChi(const REAL8 m1, const REAL8 m2, const REAL8 s1z, const REAL8 s2z)
Compute the dimensionless, aligned-spin parameter chi as used in the TaylorF2RedSpin waveform.
int XLALSimInspiralTaylorEtPNGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phic, REAL8 x0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 r, REAL8 i, int amplitudeO, int phaseO)
Driver routine to compute the post-Newtonian inspiral waveform.
int XLALSimInspiralTaylorT1PNGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 i, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO)
Driver routine to compute the post-Newtonian inspiral waveform.
int XLALSimInspiralTaylorF2(COMPLEX16FrequencySeries **htilde, const REAL8 phi_ref, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 S1z, const REAL8 S2z, const REAL8 fStart, const REAL8 fEnd, const REAL8 f_ref, const REAL8 r, LALDict *LALpars)
Computes the stationary phase approximation to the Fourier transform of a chirp waveform.
int XLALSimInspiralTaylorT3PNGenerator(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 v0, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 f_min, REAL8 fRef, REAL8 r, REAL8 i, REAL8 lambda1, REAL8 lambda2, LALSimInspiralTidalOrder tideO, int amplitudeO, int phaseO)
Driver routine to compute the post-Newtonian inspiral waveform.
int XLALSimInspiralTaylorF2NLTides(COMPLEX16FrequencySeries **htilde, const REAL8 phi_ref, const REAL8 deltaF, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 S1z, const REAL8 S2z, const REAL8 fStart, const REAL8 fEnd, const REAL8 f_ref, const REAL8 r, LALDict *LALpars)
Computes the stationary phase approximation to the Fourier transform of a chirp waveform.
int XLALSimInspiralWaveformParamsNonGRAreDefault(LALDict *params)
LALValue * XLALSimInspiralModeArrayDeactivateMode(LALValue *modes, unsigned l, int m)
bool XLALSimInspiralWaveformParamsFlagsAreDefault(LALDict *params)
Returns true if waveFlags is non-NULL and all of its fields have default value; returns false otherwi...
int XLALSimInspiralModeArrayIsModeActive(LALValue *modes, unsigned l, int m)
LALValue * XLALSimInspiralModeArrayActivateMode(LALValue *modes, unsigned l, int m)
INT2Sequence * XLALSimInspiralModeArrayReadModes(LALValue *modes)
LALValue * XLALSimInspiralCreateModeArray(void)
Create a LALValue pointer to store the mode array.
LALValue * XLALSimInspiralModeArrayActivateAllModesAtL(LALValue *modes, unsigned l)
int XLALSimInspiralPrecessingNRSurPolarizations(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 phiRef, REAL8 inclination, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 distnace, 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 t...
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 mod...
COMPLEX16FrequencySeries * XLALSphHarmFrequencySeriesGetMode(SphHarmFrequencySeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode from a SphHarmFrequencySeries linke...
COMPLEX16TimeSeries * XLALSphHarmTimeSeriesGetMode(SphHarmTimeSeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode from a SphHarmTimeSeries linked lis...
SphHarmTimeSeries * XLALSphHarmTimeSeriesAddMode(SphHarmTimeSeries *appended, const COMPLEX16TimeSeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmTimeSeries, or create a new head.
UINT4 XLALSphHarmTimeSeriesGetMaxL(SphHarmTimeSeries *ts)
Get the largest l index of any mode in the SphHarmTimeSeries linked list.
SphHarmFrequencySeries * XLALSphHarmFrequencySeriesAddMode(SphHarmFrequencySeries *appended, const COMPLEX16FrequencySeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmFrequencySeries, or create a new head.
void XLALDestroySphHarmFrequencySeries(SphHarmFrequencySeries *ts)
Delete list from current pointer to the end of the list.
void XLALSphHarmFrequencySeriesSetFData(SphHarmFrequencySeries *ts, REAL8Sequence *fdata)
Set the tdata member for all nodes in the list.
static const INT4 r
static const INT4 m
void XLALDestroyINT2Sequence(INT2Sequence *sequence)
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
void XLALDestroyCOMPLEX16TimeSeries(COMPLEX16TimeSeries *series)
COMPLEX16TimeSeries * XLALCreateCOMPLEX16TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
COMPLEX16TimeSeries * XLALCutCOMPLEX16TimeSeries(const COMPLEX16TimeSeries *series, size_t first, size_t length)
const LALUnit lalStrainUnit
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_ERROR_NULL(...)
#define XLAL_ERROR(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_PRINT_WARNING(...)
#define XLAL_TRY(statement, errnum)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EDOM
XLAL_EINVAL
XLAL_FAILURE
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
string approximant
COMPLEX16Sequence * data
COMPLEX16Sequence * data
COMPLEX16 * data
UINT4 length
INT2 * data
REAL8Sequence * data
LIGOTimeGPS epoch
REAL8 * data
COMPLEX16FrequencySeries * mode
The sequences of sampled data.
Structure to carry a collection of spherical harmonic modes in COMPLEX16 time series.
struct tagSphHarmTimeSeries * next
next pointer
COMPLEX16TimeSeries * mode
The sequences of sampled data.
INT4 m
Node submode m
UINT4 l
Node mode l
Definition: burst.c:245
double V
Definition: unicorn.c:25
double f_min
Definition: unicorn.c:22
double deltaT
Definition: unicorn.c:24
double f_max
Definition: unicorn.c:23