27 #include <lal/LALInspiral.h>
28 #include <lal/SeqFactories.h>
29 #include <lal/TimeSeries.h>
30 #include <lal/FrequencySeries.h>
32 #include <lal/VectorOps.h>
33 #include <lal/TimeFreqFFT.h>
34 #include <lal/GenerateInspiral.h>
35 #include <lal/GenerateInspRing.h>
36 #include <lal/LALStatusMacros.h>
37 #include <lal/LALInference.h>
38 #include <lal/XLALError.h>
39 #include <lal/LIGOMetadataRingdownUtils.h>
40 #include <lal/LALSimInspiral.h>
41 #include <lal/LALInferenceTemplate.h>
42 #include <lal/LALInferenceMultibanding.h>
43 #include <lal/LALSimNeutronStar.h>
44 #include <lal/LALSimInspiralTestingGRCorrections.h>
46 #include <lal/LALSimSphHarmMode.h>
49 #include <lal/LALInferenceBurstRoutines.h>
52 #define PROGRAM_NAME "LALInferenceTemplate.c"
53 #define CVS_ID_STRING "$Id$"
54 #define CVS_REVISION "$Revision$"
55 #define CVS_SOURCE "$Source$"
56 #define CVS_DATE "$Date$"
57 #define CVS_NAME_STRING "$Name$"
60 #define UNUSED __attribute__ ((unused))
66 #define MAX_NONPRECESSING_AMP_PN_ORDER 6
67 #define MAX_PRECESSING_AMP_PN_ORDER 3
69 #define Pi_p2 9.8696044010893586188344909998761511
70 #define Pi_p2by3 2.1450293971110256000774441009412356
71 #define log4 1.3862943611198906188344642429163531
79 const char list_extra_parameters[76][16] = {
"dchiMinus2",
"dchiMinus1",
"dchi0",
"dchi1",
"dchi2",
"dchi3",
"dchi3S",
"dchi3NS",
"dchi4",
"dchi4S",
"dchi4NS",
"dchi5",
"dchi5S",
"dchi5NS",
"dchi5l",
"dchi5lS",
"dchi5lNS",
"dchi6",
"dchi6S",
"dchi6NS",
"dchi6l",
"dchi7",
"dchi7S",
"dchi7NS",
"aPPE",
"alphaPPE",
"bPPE",
"betaPPE",
"betaStep",
"fStep",
"dxi1",
"dxi2",
"dxi3",
"dxi4",
"dxi5",
"dxi6",
"dalpha1",
"dalpha2",
"dalpha3",
"dalpha4",
"dalpha5",
"dbeta1",
"dbeta2",
"dbeta3",
"dsigma1",
"dsigma2",
"dsigma3",
"dsigma4",
"log10lambda_eff",
"lambda_eff",
"nonGR_alpha",
"LIV_A_sign",
"dQuadMon1",
"dQuadMon2",
"dQuadMonS",
"dQuadMonA",
"dchikappaS",
"dchikappaA",
"domega220",
"dtau220",
"domega210",
"dtau210",
"domega330",
"dtau330",
"domega440",
"dtau440",
"domega550",
"dtau550",
"db1",
"db2",
"db3",
"db4",
"dc1",
"dc2",
"dc4",
"dcl"};
83 const char list_FTA_parameters[26][16] = {
"dchiMinus2",
"dchiMinus1",
"dchi0",
"dchi1",
"dchi2",
"dchi3",
"dchi3S",
"dchi3NS",
"dchi4",
"dchi4S",
"dchi4NS",
"dchi5",
"dchi5S",
"dchi5NS",
"dchi5l",
"dchi5lS",
"dchi5lNS",
"dchi6",
"dchi6S",
"dchi6NS",
"dchi6l",
"dchi7",
"dchi7S",
"dchi7NS",
"dchikappaS",
"dchikappaA"};
98 double ll = log(lambdav);
99 double ai = .194, bi = .0936, ci = 0.0474, di = -4.21e-3, ei = 1.23e-4;
100 double ln_quad_moment = ai + bi*ll + ci*ll*ll + di*pow(ll,3.0) + ei*pow(ll,4.0);
101 return(exp(ln_quad_moment) - 1.0);
110 memset(d, 0,
sizeof(*(d))*
j);
115 double startpsi = carg(
src->data->data[
i]);
116 double startamp = cabs(
src->data->data[
i]);
117 double endpsi = carg(
src->data->data[
i+1]);
118 double endamp = cabs(
src->data->data[
i+1]);
120 double startf=freqs->
data[
i];
121 double endf=freqs->
data[
i+1];
123 double df = endf - startf;
126 double dpsi = (endpsi - startpsi);
135 double dpsidf = dpsi/
df;
136 double dampdf = (endamp - startamp)/
df;
138 double damp = dampdf *
deltaF;
140 const double dim = sin(dpsidf*
deltaF);
141 const double dre = 2.0*sin(dpsidf*
deltaF*0.5)*sin(dpsidf*
deltaF*0.5);
144 double newRe,newIm,f,re,im,
a;
146 re = cos(startpsi), im = sin(startpsi),
152 newRe = re - dre*re-dim*im,
153 newIm = im + re*dim-dre*im,
154 re=newRe, im = newIm,
157 d[
j] =
a * (re + I*im);
160 memset(&(d[
j]), 0,
sizeof(d[
j])*(
dest->data->length -
j));
173 XLALPrintError(
" ERROR in templateNullFreqdomain(): encountered unallocated 'freqModelhPlus/-Cross'.\n");
194 XLALPrintError(
" ERROR in templateNullTimedomain(): encountered unallocated 'timeModelhPlus/-Cross'.\n");
217 double root = sqrt(0.25-
eta);
218 double fraction = (0.5+root) / (0.5-root);
219 *
m2 =
mc * (pow(1+fraction,0.2) / pow(fraction,0.6));
220 *
m1 =
mc * (pow(1+1.0/fraction,0.2) / pow(1.0/fraction,0.6));
229 *
m1 =
mc * pow(
q, -3.0/5.0) * pow(
q+1, 1.0/5.0);
241 model->
roq->hptildeLinear=NULL, model->
roq->hctildeLinear=NULL;
242 model->
roq->hptildeQuadratic=NULL, model->
roq->hctildeQuadratic=NULL;
251 XLALPrintError(
" ERROR in templateLALGenerateInspiral(): (INT4) \"LAL_APPROXIMANT\" parameter not provided!\n");
258 XLALPrintError(
" ERROR in templateLALGenerateInspiral(): (INT4) \"LAL_PNORDER\" parameter not provided!\n");
294 fprintf(stderr,
"No mass parameters found!");
358 &
inclination, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z,
359 thetaJN, phiJL,
tilt1,
tilt2,
phi12, a_spin1, a_spin2,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, fTemp, phi0), errnum);
362 XLALPrintError(
" ERROR in XLALSimInspiralTransformPrecessingNewInitialConditions(): error converting angles. errnum=%d\n",errnum );
389 REAL8 sym_mass_ratio_eta = 0.;
433 REAL8 gamma[] = {SDgamma0,SDgamma1,SDgamma2,SDgamma3};
462 char PPEparam[64]=
"";
463 const char *PPEnames[]={
"aPPE",
"alphaPPE",
"bPPE",
"betaPPE",NULL};
464 for(
UINT4 idx=0;PPEnames[idx];idx++)
466 for(
UINT4 ppeidx=0;;ppeidx++)
468 sprintf(PPEparam,
"%s%d",PPEnames[idx],ppeidx);
480 spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, f_ref, corrected_distance,
inclination, model->
LALpars,
approximant, (model->
roq->frequencyNodesLinear)), errnum);
483 spin1x, spin1y, spin1z, spin2x, spin2y, spin2z, f_ref, corrected_distance,
inclination, model->
LALpars,
approximant, (model->
roq->frequencyNodesQuadratic)), errnum);
520 fprintf(stderr,
" ERROR in templateSineGaussian(): zero or negative \"sigma\" parameter (sigma=%e).\n", sigma);
524 fprintf(stderr,
" WARNING in templateSineGaussian(): negative \"frequency\" parameter (f=%e).\n", f);
526 fprintf(stderr,
" WARNING in templateSineGaussian(): negative \"amplitude\" parameter (a=%e).\n",
a);
528 t = ((double)
i)*model->
deltaT + (epochGPS-endtime);
530 if (fabs(tsigma) < 5.0)
567 fprintf(stderr,
" ERROR in templateDampedSinusoid(): zero or negative \"tau\" parameter (tau=%e).\n", tau);
571 fprintf(stderr,
" WARNING in templateDampedSinusoid(): negative \"frequency\" parameter (f=%e).\n", f);
573 t = ((double)
i)*model->
deltaT + (epochGPS-endtime);
574 if ((t>0.0) && ((ttau=t/tau) < 10.0))
608 double t, sinArg, sinc, twopif =
LAL_TWOPI*f;
612 fprintf(stderr,
" WARNING in templateSinc(): negative \"frequency\" parameter (f=%e).\n", f);
614 t = ((double)
i)*model->
deltaT + (epochGPS-endtime);
616 sinc = (sinArg==0.0) ? 1.0 : sin(sinArg)/sinArg;
640 t = ((double)
i)*model->
deltaT + (epochGPS);
708 INT4 generic_fd_correction;
710 static int sizeWarning = 0;
729 XLALPrintError(
" ERROR in templateLALGenerateInspiral(): (INT4) \"LAL_APPROXIMANT\" parameter not provided!\n");
736 XLALPrintError(
" ERROR in templateLALGenerateInspiral(): (INT4) \"LAL_PNORDER\" parameter not provided!\n");
754 generic_fd_correction = 0;
779 fprintf(stderr,
"No mass parameters found!");
862 &
inclination, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z,
863 thetaJN, phiJL,
tilt1,
tilt2,
phi12, a_spin1, a_spin2,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, fTemp, phi0), errnum);
866 XLALPrintError(
" ERROR in XLALSimInspiralTransformPrecessingNewInitialConditions(): error converting angles. errnum=%d: %s\n",errnum,
XLALErrorString(errnum) );
893 REAL8 sym_mass_ratio_eta = 0.;
911 if(m1<mass_max && m1>mass_min)
918 if(m2<mass_max && m2>mass_min)
940 REAL8 compactness1 = 0.371 - 0.0391 * log_lambda1 + 0.001056 * log_lambda1 * log_lambda1;
941 REAL8 compactness2 = 0.371 - 0.0391 * log_lambda2 + 0.001056 * log_lambda2 * log_lambda2;
946 if (fmax_eos <
f_max)
990 REAL8 gamma[] = {SDgamma0,SDgamma1,SDgamma2,SDgamma3};
1017 char PPEparam[64]=
"";
1018 const char *PPEnames[]={
"aPPE",
"alphaPPE",
"bPPE",
"betaPPE",NULL};
1019 for(
UINT4 idx=0;PPEnames[idx];idx++)
1021 for(
UINT4 ppeidx=0;;ppeidx++)
1023 sprintf(PPEparam,
"%s%d",PPEnames[idx],ppeidx);
1040 if (generic_fd_correction != 1)
1052 LALDictEntry *param;
1060 REAL8 default_GR_value = 0.0;
1066 REAL8 correction_window = 1.;
1070 REAL8 correction_ncycles_taper = 1.;
1075 INT4 generic_fd_correction_hm = 0;
1079 if(generic_fd_correction_hm == 0){
1087 XLAL_TRY(ret =
XLALSimInspiralTestingGRCorrections(hptilde,2,2,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, spin1z, spin2z,
f_start, f_ref, correction_window, correction_ncycles_taper, model->
LALpars), errnum);
1089 XLAL_TRY(ret =
XLALSimInspiralTestingGRCorrections(hctilde,2,2,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, spin1z, spin2z,
f_start, f_ref, correction_window, correction_ncycles_taper, model->
LALpars), errnum);
1094 XLAL_TRY(hlms=
XLALSimInspiralChooseFDModes(
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
deltaF,
f_start,
f_max, f_ref, phi0, corrected_distance, 0., grParams,
approximant), errnum);
1114 XLAL_TRY(ret =
XLALSimInspiralTestingGRCorrections(hlm_mode,hlms_temp->
l,abs(hlms_temp->
m),
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, spin1z, spin2z,
f_start, f_ref, correction_window, correction_ncycles_taper, model->
LALpars), errnum);
1115 hlms_temp = hlms_temp->
next;
1128 memset(hctilde->data->data, 0, npts_wave *
sizeof(
COMPLEX16));
1134 hlms_temp = hlms_temp->
next;
1160 XLAL_ERROR_VOID(errnum,
"%s: Template generation failed in XLALSimInspiralChooseFDWaveformFromCache:\n\
1161 XLALSimInspiralChooseFDWaveformFromCache(&hptilde, &hctilde, \
1162 %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, \
1163 ,model->LALpars,model->waveformCache)\n",__func__,
1164 phi0,
deltaF,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
1169 if (hptilde==NULL || hptilde->
data==NULL || hptilde->
data->
data==NULL ) {
1170 XLALPrintError(
" ERROR in %s: encountered unallocated 'hptilde'.\n",__func__);
1173 if (hctilde==NULL || hctilde->data==NULL || hctilde->data->data==NULL ) {
1174 XLALPrintError(
" ERROR in %s: encountered unallocated 'hctilde'.\n",__func__);
1185 size=hctilde->data->length;
1198 spin2x, spin2y, spin2z,
f_start, f_ref, distance,
1219 XLAL_ERROR_VOID(errnum,
"%s: Template generation failed in XLALSimInspiralChooseTDWaveformFromCache\n\
1220 XLALSimInspiralChooseTDWaveformFromCache(&hplus, &hcross, \
1221 %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, \
1222 model->LALpars,model->waveformCache)\n",__func__,
1223 phi0,
deltaT,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
1277 size_t maxShift = (size_t)lround(4.255e-2/
deltaT);
1281 size_t taperLength = (size_t)lround(0.4/
deltaT);
1285 size_t unsafeLength = taperLength + maxShift;
1291 if (desiredTc < tStart || desiredTc >
tEnd) {
1310 size_t wavePostTc = waveLength - waveTcSample;
1312 size_t bufStartIndex = (tcSample >= waveTcSample ? tcSample - waveTcSample : 0);
1313 size_t bufEndIndex = (wavePostTc + tcSample <= bufLength ? wavePostTc + tcSample : bufLength);
1314 size_t bufWaveLength = bufEndIndex - bufStartIndex;
1315 size_t waveStartIndex = (tcSample >= waveTcSample ? 0 : waveTcSample - tcSample);
1317 if (bufStartIndex < unsafeLength || (bufLength - bufEndIndex) <= unsafeLength) {
1322 fprintf(stderr,
"WARNING: Generated template is too long to guarantee that it will not\n");
1323 fprintf(stderr,
"WARNING: (a) lie in a tapered region of the time-domain buffer\n");
1324 fprintf(stderr,
"WARNING: (b) wrap periodically when timeshifted in likelihood computation\n");
1325 fprintf(stderr,
"WARNING: Either of these may cause differences between the template and the\n");
1326 fprintf(stderr,
"WARNING: correct GW waveform in each detector.\n");
1327 fprintf(stderr,
"WARNING: Parameter estimation will continue, but you should consider\n");
1328 fprintf(stderr,
"WARNING: increasing the data segment length (using the --seglen) option.\n");
1339 hplus->
data->
data + waveStartIndex,
1340 bufWaveLength*
sizeof(
REAL8));
1342 hcross->
data->
data + waveStartIndex,
1343 bufWaveLength*
sizeof(
REAL8));
1416 static int sizeWarning = 0;
1434 XLALPrintError(
" ERROR in templateLALGenerateInspiral(): (INT4) \"LAL_APPROXIMANT\" parameter not provided!\n");
1443 XLALPrintError(
" ERROR in templateLALGenerateInspiral(): (INT4) \"LAL_PNORDER\" parameter not provided!\n");
1460 REAL8 f_ref = 100.0;
1463 REAL8 fTemp = f_ref;
1483 fprintf(stderr,
"No mass parameters found!");
1498 f_low = model->
fLow;
1522 REAL8 a_spin1 = 0.0;
1523 REAL8 a_spin2 = 0.0;
1563 &
inclination, &spin1x, &spin1y, &spin1z, &spin2x, &spin2y, &spin2z,
1564 thetaJN, phiJL,
tilt1,
tilt2,
phi12, a_spin1, a_spin2,
m1*
LAL_MSUN_SI,
m2*
LAL_MSUN_SI, fTemp, phi0), errnum);
1567 XLALPrintError(
" ERROR in XLALSimInspiralTransformPrecessingNewInitialConditions(): error converting angles. errnum=%d: %s\n",errnum,
XLALErrorString(errnum) );
1593 REAL8 dLambdaT = 0.;
1594 REAL8 sym_mass_ratio_eta = 0.;
1635 REAL8 SDgamma0 = 0.;
1636 REAL8 SDgamma1 = 0.;
1637 REAL8 SDgamma2 = 0.;
1638 REAL8 SDgamma3 = 0.;
1646 REAL8 gamma[] = {SDgamma0,SDgamma1,SDgamma2,SDgamma3};
1663 char PPEparam[64]=
"";
1664 const char *PPEnames[]= {
"aPPE",
"alphaPPE",
"bPPE",
"betaPPE",NULL};
1665 for(
UINT4 idx=0; PPEnames[idx]; idx++)
1667 for(
UINT4 ppeidx=0;; ppeidx++)
1669 sprintf(PPEparam,
"%s%d",PPEnames[idx],ppeidx);
1677 double mc_min=1.0/pow(2,0.2);
1710 XLAL_ERROR_VOID(errnum,
"%s: Template generation failed in XLALSimInspiralChooseFDWaveformFromCache:\n\
1711 XLALSimInspiralChooseFDWaveformFromCache(&hptilde, &hctilde, \
1712 %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, %g, \
1713 model->LALpars,%d,model->waveformCache)\n",__func__,
1719 if (hptilde==NULL || hptilde->
data==NULL || hptilde->
data->
data==NULL ) {
1720 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimInspiralChooseWaveform(): encountered unallocated 'hptilde'.\n");
1723 if (hctilde==NULL || hctilde->data==NULL || hctilde->data->data==NULL ) {
1724 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimInspiralChooseWaveform(): encountered unallocated 'hctilde'.\n");
1740 spin2x, spin2y, spin2z,
f_start, f_ref, distance,
1760 XLAL_ERROR_VOID(errnum,
"%s: Template generation failed in XLALSimInspiralChooseTDWaveformFromCache",__func__);
1812 size_t maxShift = (size_t)lround(4.255e-2/
deltaT);
1816 size_t taperLength = (size_t)lround(0.4/
deltaT);
1820 size_t unsafeLength = taperLength + maxShift;
1826 if (desiredTc < tStart || desiredTc >
tEnd) {
1845 size_t wavePostTc = waveLength - waveTcSample;
1847 size_t bufStartIndex = (tcSample >= waveTcSample ? tcSample - waveTcSample : 0);
1848 size_t bufEndIndex = (wavePostTc + tcSample <= bufLength ? wavePostTc + tcSample : bufLength);
1849 size_t bufWaveLength = bufEndIndex - bufStartIndex;
1850 size_t waveStartIndex = (tcSample >= waveTcSample ? 0 : waveTcSample - tcSample);
1852 if (bufStartIndex < unsafeLength || (bufLength - bufEndIndex) <= unsafeLength) {
1857 fprintf(stderr,
"WARNING: Generated template is too long to guarantee that it will not\n");
1858 fprintf(stderr,
"WARNING: (a) lie in a tapered region of the time-domain buffer\n");
1859 fprintf(stderr,
"WARNING: (b) wrap periodically when timeshifted in likelihood computation\n");
1860 fprintf(stderr,
"WARNING: Either of these may cause differences between the template and the\n");
1861 fprintf(stderr,
"WARNING: correct GW waveform in each detector.\n");
1862 fprintf(stderr,
"WARNING: Parameter estimation will continue, but you should consider\n");
1863 fprintf(stderr,
"WARNING: increasing the data segment length (using the --seglen) option.\n");
1874 hplus->
data->
data + waveStartIndex,
1875 bufWaveLength*
sizeof(
REAL8));
1877 hcross->
data->
data + waveStartIndex,
1878 bufWaveLength*
sizeof(
REAL8));
1910 static int sizeWarning = 0;
1925 polar_ecc=1.0,polar_angle=
LAL_PI/2.;
1931 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimBurstChooseWaveform(): (INT4) \"LAL_APPROXIMANT\" parameter not provided!\n");
1975 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimInspiralChooseWaveform(): encountered unallocated 'timeData'.\n");
1982 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimInspiralChooseWaveform(): encountered unallocated 'freqhCross'.\n");
1993 XLAL_TRY(ret=
XLALSimBurstChooseFDWaveformFromCache(&hptilde, &hctilde,
deltaF,
deltaT,freq,quality,
duration,f_low,
f_max,corrected_hrss,polar_angle,polar_ecc,extraParams,
approximant,model->
burstWaveformCache), errnum);
2000 if (hptilde==NULL || hptilde->
data==NULL || hptilde->
data->
data==NULL ) {
2001 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimBurstChooseWaveform: encountered unallocated 'hptilde'.\n");
2004 if (hctilde==NULL || hctilde->data==NULL || hctilde->data->data==NULL ) {
2005 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimBurstChooseWaveform: encountered unallocated 'hctilde'.\n");
2013 if(i < hptilde->
data->length){
2020 dataPtr = hctilde->data->data;
2021 if(i < hctilde->
data->length){
2038 XLAL_TRY(ret=
XLALSimBurstChooseTDWaveformFromCache(&hplus, &hcross,
deltaT,freq,quality,
duration,f_low,
f_max,
hrss,polar_angle,polar_ecc,extraParams,
approximant,model->
burstWaveformCache), errnum);
2040 if (ret ==
XLAL_FAILURE || hplus == NULL || hcross == NULL)
2098 size_t maxShift = (size_t)lround(4.255e-2/hplus->
deltaT);
2103 size_t taperLength = (size_t)lround(
pad/hplus->
deltaT);
2107 size_t unsafeLength = taperLength + maxShift;
2113 if (desiredTc < tStart || desiredTc >
tEnd) {
2132 size_t wavePostTc = waveLength - waveTcSample;
2134 size_t bufStartIndex = (tcSample >= waveTcSample ? tcSample - waveTcSample : 0);
2135 size_t bufEndIndex = (wavePostTc + tcSample <= bufLength ? wavePostTc + tcSample : bufLength);
2136 size_t bufWaveLength = bufEndIndex - bufStartIndex;
2137 size_t waveStartIndex = (tcSample >= waveTcSample ? 0 : waveTcSample - tcSample);
2139 if (bufStartIndex < unsafeLength || (bufLength - bufEndIndex) <= unsafeLength) {
2144 fprintf(stderr,
"WARNING: Generated template is too long to guarantee that it will not\n");
2145 fprintf(stderr,
"WARNING: (a) lie in a tapered region of the time-domain buffer\n");
2146 fprintf(stderr,
"WARNING: (b) wrap periodically when timeshifted in likelihood computation\n");
2147 fprintf(stderr,
"WARNING: Either of these may cause differences between the template and the\n");
2148 fprintf(stderr,
"WARNING: correct GW waveform in each detector.\n");
2149 fprintf(stderr,
"WARNING: Parameter estimation will continue, but you should consider\n");
2150 fprintf(stderr,
"WARNING: increasing the data segment length (using the --seglen) option.\n");
2162 hplus->
data->
data + waveStartIndex,
2163 bufWaveLength*
sizeof(
REAL8));
2165 hcross->
data->
data + waveStartIndex,
2166 bufWaveLength*
sizeof(
REAL8));
2209 quality=0.0,tau=0.0,
2224 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimInspiralChooseWaveform(): encountered unallocated 'timeData'.\n");
2230 XLALPrintError(
" ERROR in LALInferenceTemplateXLALSimInspiralChooseWaveform(): encountered unallocated 'freqhCross'.\n");
2244 if (hptilde==NULL || hptilde->
data==NULL || hptilde->
data->
data==NULL ) {
2245 XLALPrintError(
" ERROR in LALInferenceTemplateXLALInferenceBurstChooseWaveform: encountered unallocated 'hptilde'.\n");
2248 if (hctilde==NULL || hctilde->data==NULL || hctilde->data->data==NULL ) {
2249 XLALPrintError(
" ERROR in LALInferenceTemplateXLALInferenceBurstChooseWaveform: encountered unallocated 'hctilde'.\n");
2252 size_t lower =(size_t) ( hctilde->f0/hctilde->deltaF);
2253 size_t upper= (size_t) ( hctilde->data->length + lower);
2255 COMPLEX16 *dataPtrC = hctilde->data->data;
2256 for (
i=0;
i<lower; ++
i) {
2269 for (
i=lower;
i<upper; ++
i) {
2307 fprintf(
outfile,
"\"f\",\"signalPlusRe\",\"signalPlusIm\",\"signalCrossRe\",\"signalCrossIm\"\n");
2318 fprintf(stdout,
" wrote (frequency-domain) template to CSV file \"%s\".\n",
filename);
2350 fprintf(stdout,
" wrote (time-domain) template to CSV file \"%s\".\n",
filename);
const char * XLALDictEntryGetKey(const LALDictEntry *entry)
int XLALDictInsert(LALDict *dict, const char *key, const void *data, size_t size, LALTYPECODE type)
LALDictEntry * XLALDictIterNext(LALDictIter *iter)
void XLALDictIterInit(LALDictIter *iter, LALDict *dict)
const LALValue * XLALDictEntryGetValue(const LALDictEntry *entry)
int XLALDictInsertValue(LALDict *dict, const char *key, const LALValue *value)
LALDict * XLALCreateDict(void)
int XLALSimBurstChooseFDWaveformFromCache(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 deltaF, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant, LALSimBurstWaveformCache *cache)
Chooses between different approximants when requesting a waveform to be generated Returns the wavefor...
void XLALSimBurstDestroyExtraParam(LALSimBurstExtraParam *parameter)
Function that destroys the whole burst extra params linked list.
int XLALInferenceBurstSineGaussianFFast(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 Q, REAL8 centre_frequency, REAL8 hrss, REAL8 eccentricity, REAL8 phase, REAL8 deltaF, REAL8 deltaT)
int XLALSimBurstChooseTDWaveformFromCache(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant, LALSimBurstWaveformCache *cache)
Chooses between different approximants when requesting a waveform to be generated Returns the wavefor...
BurstApproximant
Enum that specifies the PN approximant to be used in computing the waveform.
REAL8Sequence * LALInferenceMultibandFrequencies(int NBands, double f_min, double f_max, double deltaF0, double mc)
Create a list of frequencies to use in multiband template generation, between f_min and f_max mc is m...
static int InterpolateWaveform(REAL8Vector *freqs, COMPLEX16FrequencySeries *src, COMPLEX16FrequencySeries *dest)
const char list_FTA_parameters[26][16]
static REAL8 dquadmon_from_lambda(REAL8 lambdav)
const char list_extra_parameters[76][16]
static void mc2masses(double mc, double eta, double *m1, double *m2)
const UINT4 N_extra_params
static void q2masses(double mc, double q, double *m1, double *m2)
LALInferenceVariables currentParams
const char * XLALSimInspiralGetStringFromApproximant(Approximant approximant)
REAL8 XLALSimInspiralfLow2fStart(REAL8 fLow, INT4 ampOrder, INT4 approximant)
int XLALSimInspiralTestingGRCorrections(COMPLEX16FrequencySeries *htilde, const UINT4 l, const UINT4 m, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi1z, const REAL8 chi2z, const REAL8 f_low, const REAL8 f_ref, const REAL8 f_window_div_f_Peak, const REAL8 NCyclesStep, LALDict *LALpars)
struct tagLALSimNeutronStarFamily LALSimNeutronStarFamily
COMPLEX16FrequencySeries * XLALResizeCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series, int first, size_t length)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
void LALInferencedQuadMonSdQuadMonA(REAL8 dQuadMonS, REAL8 dQuadMonA, REAL8 *dQuadMon1, REAL8 *dQuadMon2)
Convert from dQuadMonS, dQuadMonA to dQuadMon1, dQuadMon2.
void LALInferenceAddVariable(LALInferenceVariables *vars, const char *name, const void *value, LALInferenceVariableType type, LALInferenceParamVaryType vary)
Add a variable named name to vars with initial value referenced by value.
void LALInferenceLogp1GammasMasses2Lambdas(REAL8 logp1, REAL8 gamma1, REAL8 gamma2, REAL8 gamma3, REAL8 mass1, REAL8 mass2, REAL8 *lambda1, REAL8 *lambda2)
Calculate lambda1,2(m1,2|eos(logp1,gamma1,gamma2,gamma3))
REAL8 LALInferenceGetREAL8Variable(LALInferenceVariables *vars, const char *name)
void LALInferenceExecuteFT(LALInferenceModel *model)
Execute FFT for data in IFOdata.
void LALInferenceLambdaTsEta2Lambdas(REAL8 lambdaT, REAL8 dLambdaT, REAL8 eta, REAL8 *lambda1, REAL8 *lambda2)
Convert from lambdaT, dLambdaT, and eta to lambda1 and lambda2.
void LALInferenceCopyVariables(LALInferenceVariables *origin, LALInferenceVariables *target)
Deep copy the variables from one to another LALInferenceVariables structure.
void LALInferenceSDGammasMasses2Lambdas(REAL8 gamma[], REAL8 mass1, REAL8 mass2, REAL8 *lambda1, REAL8 *lambda2, int size)
Convert from spectral parameters to lambda1, lambda2.
void LALInferenceBinaryLove(LALInferenceVariables *vars, REAL8 *lambda1, REAL8 *lambda2)
Compute Tidal deformabilities following BinaryLove Universal relations.
void * LALInferenceGetVariable(const LALInferenceVariables *vars, const char *name)
Return a pointer to the memory the variable vars is stored in specified by name User must cast this p...
void LALInferenceExecuteInvFT(LALInferenceModel *model)
Execute Inverse FFT for data in IFOdata.
int LALInferenceCheckVariable(LALInferenceVariables *vars, const char *name)
Checks for name being present in vars returns 1(==true) or 0.
void LALInferenceSetVariable(LALInferenceVariables *vars, const char *name, const void *value)
Set a variable named name in vars with a value.
@ LALINFERENCE_PARAM_OUTPUT
A parameter that never changes, functions should respect this.
void LALInferenceROQWrapperForXLALSimInspiralChooseFDWaveformSequence(LALInferenceModel *model)
void LALInferenceTemplateXLALSimBurstSineGaussianF(LALInferenceModel *model)
void LALInferenceTemplateASinOmegaT(LALInferenceModel *model)
Trivial h(t) = A*sin(Omega*t) template.
void LALInferenceTemplateNullFreqdomain(LALInferenceModel *model)
Returns a frequency-domain 'null' template (all zeroes, implying no signal present).
void LALInferenceTemplateXLALSimInspiralChooseWaveformPhaseInterpolated(LALInferenceModel *model)
void LALInferenceDumptemplateFreqDomain(LALInferenceVariables *currentParams, LALInferenceModel *model, const char *filename)
De-bugging function writing a (frequency-domain) signal template to a CSV file.
void LALInferenceDumptemplateTimeDomain(LALInferenceVariables *currentParams, LALInferenceModel *model, const char *filename)
De-bugging function writing a (time-domain) signal template to a CSV file.
void LALInferenceTemplateSineGaussian(LALInferenceModel *model)
Sine-Gaussian (burst) template.
void LALInferenceTemplateXLALSimBurstChooseWaveform(LALInferenceModel *model)
void LALInferenceTemplateXLALSimInspiralChooseWaveform(LALInferenceModel *model)
"XLALSimInspiralChooseWaveform{TD,FD}" wrapper.
void LALInferenceTemplateSinc(LALInferenceModel *model)
Sinc function (burst) template.
void LALInferenceTemplateNullTimedomain(LALInferenceModel *model)
Returns a time-domain 'null' template (all zeroes, implying no signal present).
void LALInferenceTemplateDampedSinusoid(LALInferenceModel *model)
Damped Sinusoid template.
SphHarmFrequencySeries * XLALSimInspiralChooseFDModes(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)
double XLALSimNeutronStarLoveNumberK2(double m, LALSimNeutronStarFamily *fam)
double XLALSimNeutronStarRadius(double m, LALSimNeutronStarFamily *fam)
double XLALSimNeutronStarFamMinimumMass(LALSimNeutronStarFamily *fam)
double XLALSimNeutronStarMaximumMass(LALSimNeutronStarFamily *fam)
int XLALSimAddModeFD(COMPLEX16FrequencySeries *hptilde, COMPLEX16FrequencySeries *hctilde, COMPLEX16FrequencySeries *hlmtilde, REAL8 theta, REAL8 phi, INT4 l, INT4 m, INT4 sym)
COMPLEX16FrequencySeries * XLALSphHarmFrequencySeriesGetMode(SphHarmFrequencySeries *ts, UINT4 l, INT4 m)
void XLALDestroySphHarmFrequencySeries(SphHarmFrequencySeries *ts)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
#define XLAL_ERROR_VOID(...)
const char * XLALErrorString(int errnum)
int XLALSetErrno(int errnum)
#define XLAL_TRY(statement, errnum)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_PRINT_ERROR(...)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
int XLALSimInspiralTransformPrecessingNewInitialConditions(REAL8 *incl, REAL8 *S1x, REAL8 *S1y, REAL8 *S1z, REAL8 *S2x, REAL8 *S2y, REAL8 *S2z, const REAL8 thetaJN, const REAL8 phiJL, const REAL8 theta1, const REAL8 theta2, const REAL8 phi12, const REAL8 chi1, const REAL8 chi2, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 fRef, const REAL8 phiRef)
def Omega(v, m1, m2, S1, S2, Ln)
Preccesion frequency spins Eqs.
Structure to constain a model and its parameters.
COMPLEX16FrequencySeries * freqhPlus
Time series model buffers.
LALSimNeutronStarFamily * eos_fam
Is ROQ enabled.
REAL8 fHigh
Start frequency for waveform generation.
REAL8TimeSeries * timehCross
LALSimBurstWaveformCache * burstWaveformCache
Waveform cache.
LALSimInspiralWaveformCache * waveformCache
REAL8TimeSeries * timehPlus
LALInferenceVariables * params
REAL8 deltaT
End frequency for waveform generation.
COMPLEX16FrequencySeries * freqhCross
LALDict * LALpars
Projected freq series model buffers.
REAL8Window * window
Pre-calculated FFT plans for forward and reverse FFTs.
REAL8 fLow
Array of single-IFO SNRs at params
struct tagLALInferenceROQModel * roq
The padding of the above window.
LALInferenceTemplateFunction templt
Domain of model.
LALSimulationDomain domain
IFO-dependent parameters and buffers.
The LALInferenceVariables structure to contain a set of parameters Implemented as a linked list of LA...
struct tagSphHarmFrequencySeries * next
COMPLEX16FrequencySeries * mode