26 #include <gsl/gsl_spline.h>
46 REAL8 Deltaf, maxfreq;
47 INT4 nCoarseIntervals;
49 Deltaf = fEND - fSTART;
50 nCoarseIntervals = (int)ceil(Deltaf/mydf);
51 maxfreq = fSTART + mydf * nCoarseIntervals;
59 myGrid.
xMax = maxfreq;
61 myGrid.
Length = nCoarseIntervals + 1;
64 printf(
"\nGridComp: fSTART = %.16f",fSTART);
65 printf(
"\nGridComp: xMax = %.16f",maxfreq);
66 printf(
"\nGridComp: Length = %i",nCoarseIntervals+1);
67 printf(
"\nGridComp: x0 = %e : x1 = %e : length = %d : mydf = %e\n", myGrid.
xStart, myGrid.
xMax, myGrid.
Length, mydf);
77 REAL8 MfLorentzianEnd,
88 INT4 index, intdfRatio;
90 INT4 preComputeFirstGrid, nMergerGrid, nRingdownGrid, nDerefineInspiralGrids;
94 coarseGrid.
xMax = fstartIn;
96 REAL8 df0, FrequencyFactor=1, nextfSTART, origLogFreqFact;
97 REAL8 fSTART, mydf = evaldMf, fEND, fEndGrid0 = 0, fStartInspDerefinement, fEndInsp;
101 REAL8 const dfRatio = dfcoefficient * pow(fstartIn, dfpower)/evaldMf;
103 REAL8 df0original = dfRatio*evaldMf;
104 coarseGrid.
deltax = df0original;
107 printf(
"\ndfcoefficient = %.16e", dfcoefficient);
108 printf(
"\nfstartIn = %.16e", fstartIn);
109 printf(
"\ndfpower = %.16e", dfpower);
110 printf(
"\nevaldMf = %.16e", evaldMf);
111 printf(
"\ndfRatio = %.16e\n", dfRatio);
117 printf(
"\n****Adjusting frequency factors!****\n");
119 preComputeFirstGrid = 1;
122 fEndGrid0 = pow(evaldMf/dfcoefficient,1./dfpower);
123 fStartInspDerefinement = fEndGrid0 + 2 * df0;
125 printf(
"\nevaldMf = %.6f\n", fEndGrid0);
126 printf(
"\ndfcoefficient = %.6f\n", dfcoefficient);
127 printf(
"\ndfpower = %.6f\n", dfpower);
128 printf(
"\nfEndGrid0 = %.6f\n", fEndGrid0);
133 printf(
"proceed without preComputeFirstGrid!");
135 preComputeFirstGrid = 0;
136 intdfRatio = (int)floor(dfRatio);
137 fStartInspDerefinement = fstartIn;
140 df0 = evaldMf * intdfRatio;
143 printf(
"\nintdfRatio = %d\n", intdfRatio);
144 printf(
"\nfStartInspDerefinement = %e\n", fStartInspDerefinement );
145 printf(
"\ndf0, df0original, evaldMf = %.6e %.6e %.6e\n", df0, df0original, evaldMf );
149 if (fStartInspDerefinement >= fend) {
150 fEndInsp = fStartInspDerefinement;
151 nDerefineInspiralGrids = 0;
156 FrequencyFactor = pow(2., (1./dfpower));
157 origLogFreqFact =
logbase(FrequencyFactor, fend/fStartInspDerefinement);
159 nDerefineInspiralGrids=(int)(ceil(origLogFreqFact));
160 fEndInsp = fStartInspDerefinement * pow(FrequencyFactor,nDerefineInspiralGrids);
163 printf(
"FrequencyFactor, fend, fStartInspDerefinement, origLogFreqFact: %e : %e : %e :%e\n", FrequencyFactor, fend, fStartInspDerefinement, origLogFreqFact);
164 printf(
"df0/evaldMf = %e\n", df0/evaldMf);
165 printf(
"Factor in frequency between adjacent inspiral grids = %e\n", FrequencyFactor);
166 printf(
"Number of subgrids required = %d : unrounded = : %e\n", nDerefineInspiralGrids, origLogFreqFact);
171 printf(
"\nMfMECO = %.16e\n fEndInsp = %.16e\n MfLorentzianEnd = %.16e\n Mfmax = %.16e\n", fend, fEndInsp, MfLorentzianEnd, Mfmax);
175 if (fEndInsp + evaldMf >= MfLorentzianEnd) {
177 if (fEndInsp + evaldMf >= Mfmax) {
185 if(MfLorentzianEnd > Mfmax){
192 printf(
"nMergerGrid = %d\n", nMergerGrid);
193 printf(
"nRingdownGrid = %d\n", nRingdownGrid);
194 printf(
"fStartInspDerefinement = %e\n", fStartInspDerefinement);
195 printf(
"fEndInsp = %e\n", fEndInsp);
200 if (preComputeFirstGrid > 0) {
205 allGrids[0] = coarseGrid;
208 printf(
"\nAdding preComputeFirstGrid %i\n",preComputeFirstGrid);
209 printf(
"xStart: %.6f\n", allGrids[0].xStart);
210 printf(
"xEnd: %.6f\n", allGrids[0].xEndRequested);
211 printf(
"Length: %i\n", allGrids[0].Length);
212 printf(
"deltax: %.6e\n", allGrids[0].deltax);
213 printf(
"xMax: %.6f\n", allGrids[0].xMax);
216 fStartInspDerefinement = coarseGrid.
xMax;
217 df0 = 2*coarseGrid.
deltax;
218 df0original = 2*df0original;
223 if (nDerefineInspiralGrids > 0) {
225 nextfSTART = fStartInspDerefinement;
227 printf(
"nDerefineInspiralGrids before loop = %d\n", nDerefineInspiralGrids);
230 while (index < nDerefineInspiralGrids) {
231 if(df0original < evaldMf){
233 printf(
"\nAdjusting freq factors!!\n");
239 intdfRatio = (int)floor(df0original/evaldMf);
240 mydf = evaldMf*intdfRatio;
242 if(index + preComputeFirstGrid == 0){
246 fSTART = nextfSTART + mydf;
248 fEND = fSTART * FrequencyFactor;
251 printf(
"\n(index, fSTART, fEND) = (%d, %e, %e, %e)\n", index + preComputeFirstGrid, fSTART, fEND, mydf);
257 printf(
"xStart: %.16e\n", coarseGrid.
xStart);
259 printf(
"Length: %i\n", coarseGrid.
Length);
260 printf(
"deltax: %.16e\n", coarseGrid.
deltax);
261 printf(
"mydf: %.16e\n", mydf);
262 printf(
"xMax: %.16e\n", coarseGrid.
xMax);
263 printf(
"intdfRatio = %i\n", intdfRatio);
266 df0original = 2*df0original;
268 nextfSTART = coarseGrid.
xMax;
270 allGrids[index + preComputeFirstGrid] = coarseGrid;
271 allGrids[index+preComputeFirstGrid].
intdfRatio = intdfRatio;
275 fEndInsp = coarseGrid.
xMax;
279 printf(
"\nSkipping Inspiral Loop %i\n", nDerefineInspiralGrids);
281 if (preComputeFirstGrid > 0){
282 fEndInsp = coarseGrid.
xMax;
287 printf(
"\nfStartInspDerefinement after loop = %e\n", fStartInspDerefinement);
288 printf(
"fEndInsp after loop = %e\n", fEndInsp);
289 printf(
"nDerefineInspiralGrids = %i\n", nDerefineInspiralGrids);
293 if (nMergerGrid > 0) {
294 df0original = dfmerger;
295 if(2*coarseGrid.
deltax < dfmerger){
296 df0original = 2*coarseGrid.
deltax;
298 if(df0original < evaldMf){
300 printf(
"\nAdjusting freq factors!!\n");
306 intdfRatio = (int)floor(df0original/evaldMf);
307 mydf = evaldMf*intdfRatio;
309 fSTART = fEndInsp + mydf;
311 if(fEndInsp == fstartIn){
315 INT4 mergerIndex = 0;
317 if(fSTART > MfLorentzianEnd){
320 printf(
"\nNOT adding merger grid\n");
325 mergerIndex = preComputeFirstGrid + nDerefineInspiralGrids;
327 df0original = 2*df0original;
329 allGrids[mergerIndex] = coarseGrid;
330 allGrids[mergerIndex].
intdfRatio = intdfRatio;
333 printf(
"\nadding merger grid\n");
334 printf(
"fSTART = %.6f\n", fSTART);
335 printf(
"fEND = %.6f\n", coarseGrid.
xMax);
336 printf(
"MfLorentzianEnd = %.6f\n", MfLorentzianEnd);
337 printf(
"mydf = %.16e\n", mydf);
338 printf(
"mergerIndex = %i\n", mergerIndex);
339 printf(
"intdfRatio = %i\n", intdfRatio);
340 printf(
"# fine points float %.16f\n", allGrids[mergerIndex].deltax/evaldMf);
348 if (nRingdownGrid > 0) {
349 df0original = dfringdown;
350 if(df0original < evaldMf){
352 printf(
"\nAdjusting freq factors!!\n");
358 intdfRatio = (int)floor(df0original/evaldMf);
359 mydf = evaldMf*intdfRatio;
361 fSTART = coarseGrid.
xMax + mydf;
362 if(coarseGrid.
xMax == fstartIn){
371 printf(
"\nNOT adding RD grid\n");
377 RDindex = preComputeFirstGrid + nDerefineInspiralGrids + nMergerGrid;
379 df0original = 2*df0original;
381 allGrids[RDindex] = coarseGrid;
385 printf(
"\nadding RD grid\n");
386 printf(
"Mfmax = %e\n", Mfmax);
387 printf(
"fSTART = %.6f\n", fSTART);
388 printf(
"fEND = %.6f\n", coarseGrid.
xMax);
389 printf(
"mydf = %.16e\n", mydf);
390 printf(
"RDIndex = %i\n", RDindex);
391 printf(
"intdfRatio = %i\n", intdfRatio);
392 printf(
"# fine points float %.16f\n", allGrids[RDindex].deltax/evaldMf);
397 INT4 nGridsUsed = preComputeFirstGrid + nDerefineInspiralGrids + nMergerGrid+nRingdownGrid;
399 printf(
"final grid length = %d\n", nGridsUsed);
400 printf(
"intdfRatio = %d\n", intdfRatio);
409 REAL8 phase_coeff = 0, amp_coeff = 0;
411 phase_coeff = pPhase->
alphaL;
464 UINT4 emm = abs(emmIn);
466 printf(
"\nMode %i %i \n",ell,emm);
467 printf(
"fRef_In : %e\n",fRef_In);
468 printf(
"m1_SI : %e\n",m1_SI);
469 printf(
"m2_SI : %e\n",m2_SI);
470 printf(
"chi1L : %e\n",chi1L);
471 printf(
"chi2L : %e\n\n",chi2L);
472 printf(
"Performing sanity checks...\n");
477 if(fRef_In < 0.0) {
XLAL_ERROR(
XLAL_EDOM,
"fRef_In must be positive or set to 0 to ignore.\n"); }
483 if(distance < 0.0) {
XLAL_ERROR(
XLAL_EDOM,
"Distance must be positive and greater than 0.\n"); }
495 mass_ratio = m1_SI / m2_SI;
499 mass_ratio = m2_SI / m1_SI;
501 if(mass_ratio > 20.0 ) {
XLAL_PRINT_INFO(
"Warning: Extrapolating outside of Numerical Relativity calibration domain."); }
502 if(mass_ratio > 1000. && fabs(mass_ratio - 1000) > 1
e-12) {
XLAL_ERROR(
XLAL_EDOM,
"ERROR: Model not valid at mass ratios beyond 1000."); }
503 if(fabs(chi1L) > 0.99 || fabs(chi2L) > 0.99) {
XLAL_PRINT_INFO(
"Warning: Extrapolating to extremal spins, model is not trusted."); }
507 printf(
"\n**********************************************************************\n");
508 printf(
"\n* IMRPhenomXHMMultiBandOneMode %i%i *\n", ell, emm);
509 printf(
"\n**********************************************************************\n");
510 printf(
"\nm1, m2, chi1, chi2 %.16f %.16f %.16f %.16f\n", m1_SI/
LAL_MSUN_SI, m2_SI/
LAL_MSUN_SI, chi1L, chi2L);
526 status =
IMRPhenomXSetWaveformVariables(pWF, m1_SI, m2_SI, chi1L, chi2L, deltaF, fRef_In, phiRef,
f_min,
f_max, distance, 0.0, lalParams, debug);
533 INT4 offset = (size_t) (pWF->
fMin / deltaF);
542 printf(
"\nTransforming to positive m by doing (-1)^l*Conjugate, frequencies must be negatives.\n");
544 for(
UINT4 idx=offset; idx<(*htildelm)->data->length; idx++){
545 (*htildelm)->data->data[idx] = minus1l*conj((*htildelm)->data->data[idx]);
554 lastfreq = pWF->
fMax;
555 XLAL_PRINT_WARNING(
"The input f_max = %.2f Hz is larger than the internal cutoff of Mf=0.3 (%.2f Hz). Array will be filled with zeroes between these two frequencies.\n", pWF->
fMax, pWF->
f_max_prime);
561 size_t n_full =
NextPow2(lastfreq / deltaF) + 1;
562 size_t n = (*htildelm)->data->length;
566 XLAL_CHECK (*htildelm,
XLAL_ENOMEM,
"Failed to resize waveform COMPLEX16FrequencySeries of length %zu (for internal fCut=%f) to new length %zu (for user-requested f_max=%f).", n, pWF->
fCut, n_full, pWF->
fMax );
596 size_t iStart = (size_t) (pWF->
fMin / deltaF);
597 size_t iStop = (size_t) (pWF->
f_max_prime / deltaF) + 1;
599 "minimum freq index %zu and maximum freq index %zu do not fulfill 0<=ind_min<=ind_max<=htilde->data>length=%zu.", iStart, iStop, npts);
602 printf(
"\n***********************\n");
603 printf(
"pWF->fMin, deltaF, iStart = %.16e %.16e %zu", pWF->
fMin, deltaF, iStart);
604 printf(
"\n***********************\n");
608 size_t offset = iStart;
612 if(pWF->
q == 1 && pWF->
chi1L == pWF->
chi2L && emm%2!=0){
614 for(
unsigned int idx = 0; idx < iStop; idx++){
615 ((*htildelm)->data->data)[idx] = 0.;
632 printf(
"\n***** MBAND = %i, resTest = %.16f, ampIntorder = %i\n",
MBAND, resTest, ampinterpolorder);
635 REAL8 dfpower = 11./6.;
640 REAL8 MfMECO, MfLorentzianEnd;
641 REAL8 dfmerger = 0., dfringdown = 0.;
664 if(ell == 2 && emm ==2){
667 printf(
"\nfRING = %e\n",pWF->
fRING);
668 printf(
"fDAMP = %e\n",pWF->
fDAMP);
669 printf(
"alphaL22 = %.16e", pPhase22->
cLovfda/pWF->
eta);
693 MfLorentzianEnd = pWFHM->
fRING + 2*pWFHM->
fDAMP;
695 printf(
"\nfRING = %e\n",pWFHM->
fRING);
696 printf(
"fDAMP = %e\n",pWFHM->
fDAMP);
697 printf(
"alphaL = %.16e", pPhase->
alphaL);
703 UINT4 lengthallGrids = 20;
706 if (allGrids == NULL)
709 printf(
"Malloc of allGrids failed!\n");
715 printf(
"\nMfmin = %.6f\n", Mfmin);
716 printf(
"MfMECO = %.6f\n", MfMECO);
717 printf(
"MfLorentzianEnd = %.6f\n", MfLorentzianEnd);
718 printf(
"Mfmax = %.6f\n", Mfmax);
719 printf(
"evaldMf = %.6e\n", evaldMf);
720 printf(
"dfpower = %.6e\n", dfpower);
721 printf(
"dfcoefficient = %.6e\n", dfcoefficient);
722 printf(
"dfmerger = %.6e\n", dfmerger);
723 printf(
"dfringdown = %.6e\n", dfringdown);
730 printf(
"allGrids[1].Length = %i\n", allGrids[0].Length);
734 INT4 mydfRatio[lengthallGrids];
736 UINT4 actualnumberofGrids = 0;
738 UINT4 lenCoarseArray = 0;
742 for(
UINT4 kk = 0; kk < nGridsUsed; kk++){
743 lenCoarseArray = lenCoarseArray + allGrids[kk].
Length;
744 actualnumberofGrids++;
749 printf(
"\nkk = %i\n",kk);
750 printf(
"xStart: %.6e\n", allGrids[kk].xStart);
751 printf(
"xEnd: %.6e\n", allGrids[kk].xEndRequested);
752 printf(
"Length: %i\n", allGrids[kk].Length);
755 printf(
"xMax: %.16e\n", allGrids[kk].xMax);
756 printf(
"Mfmax: %.16e\n", Mfmax);
757 printf(
"# fine points %i\n", mydfRatio[kk]);
758 printf(
"# fine points float %.16f\n", allGrids[kk].deltax/evaldMf);
761 if(allGrids[kk].xMax + evaldMf >= Mfmax){
767 while(allGrids[actualnumberofGrids-1].xMax < Mfmax){
768 allGrids[actualnumberofGrids-1].
xMax = allGrids[actualnumberofGrids-1].
xMax + allGrids[actualnumberofGrids-1].
deltax;
769 allGrids[actualnumberofGrids-1].
Length = allGrids[actualnumberofGrids-1].
Length + 1;
774 if(ell==2 && emm==2){
779 printf(
"actualnumberofGrids = %i\n", actualnumberofGrids);
780 printf(
"lenCoarseArray = %i\n", lenCoarseArray);
781 printf(
"Last grid.xMax = %.16f", allGrids[actualnumberofGrids-1].xMax);
786 UINT4 lenIntLawpoints = 0;
788 for(
UINT4 kk = 0; kk < actualnumberofGrids; kk++){
789 for(
INT4 ll = 0; ll < allGrids[kk].
Length; ll++){
790 IntLawpoints[lenIntLawpoints] = (allGrids[kk].
xStart + allGrids[kk].
deltax*ll);
797 printf(
"\n******** Coarse frequencies array done ********* \n");
798 printf(
"\nlenIntLawpoints, coarse[0], coarse[-1], Mfmax, M_sec = %i %.16e %.16e %.16e %.16e\n",lenIntLawpoints, IntLawpoints[0], IntLawpoints[lenIntLawpoints-1], Mfmax, pWF->
M_sec);
810 printf(
"\n***** Coarse freqs *****\n");
813 for (
UINT4 ii = 0; ii < lenCoarseArray; ii++)
815 coarseFreqs->
data[ii] = IntLawpoints[ii]*divis;
818 printf(
"\nFirst/Last Coarse freqs *****%.16e %.16e\n", coarseFreqs->
data[0], coarseFreqs->
data[coarseFreqs->
length-1]);
827 if(ell == 2 && emm ==2){
829 printf(
"\n** Computing Amplitude and Phase of PhenomX %i **********\n", lenCoarseArray);
861 double phiTfRef = 0.;
871 REAL8 tshift = -dphi_fmerger;
881 if (NRTidal_version!=
NoNRT_V) {
891 if (NRTidal_version==
NoNRT_V) {
893 for(
UINT4 kk = 0; kk < (coarseFreqs)->length; kk++)
907 for(
UINT4 kk = 0; kk < (coarseFreqs)->length; kk++)
911 double ampTidal = amp_tidal->
data[kk];
912 double window = planck_taper->
data[kk];
948 printf(
"\n******* Computing Coarse Amplitude And Phase ****************\n");
956 printf(
"\n******* Computed Coarse Amp and Phase **************** %i\n", coarseFreqs->
length);
964 for (
UINT4 ii = 0; ii < lenCoarseArray; ii++)
966 ILamplm[ii] = ((amplitude)->
data->data)[ii];
967 ILphaselm[ii] = ((phase)->
data->data)[ii];
974 sprintf(fileSpec0,
"coarseamplitude%i%i.dat", ell,emm);
975 printf(
"\nOutput file: %s\r\n",fileSpec0);
976 file0 = fopen(fileSpec0,
"w");
977 fprintf(file0,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
980 sprintf(fileSpec3,
"coarsephase%i%i.dat", ell,emm);
981 printf(
"\nOutput file: %s\r\n",fileSpec3);
982 file3 = fopen(fileSpec3,
"w");
983 fprintf(file3,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
984 for(
UINT4 idx = 0; idx < lenCoarseArray; idx++)
986 fprintf(file0,
"%.16f %.16e \n", coarseFreqs->
data[idx], ILamplm[idx]);
987 fprintf(file3,
"%.16f %.16e \n", coarseFreqs->
data[idx], ILphaselm[idx]);
1003 for(
UINT4 kk = 0; kk < actualnumberofGrids; kk++){
1004 lenWF = lenWF + (allGrids[kk].
Length -1) * mydfRatio[kk] + 2*mydfRatio[kk];
1006 printf(
"\nmydfRatio[%i] = %i %i %i", kk, mydfRatio[kk],allGrids[kk].Length, (allGrids[kk].Length -1) * mydfRatio[kk] + 2*mydfRatio[kk]);
1007 printf(
"\nlenWF = %i\n\n", lenWF);
1012 int pointsPrecessedSoFar = 0;
1016 if (expphi == NULL){
1021 if (finefreqs == NULL){
1029 for (
UINT4 i = 0;
i<actualnumberofGrids && !stop;
i++){
1031 printf(
"\ni = %i\n",
i);
1035 if(lcoarseGrid == 0){
1040 if(
i==actualnumberofGrids-1){
1044 REAL8 Omega, phi0, Mfhere = 0, Mfnext = 0;
1048 for(
UINT4 j = 0; j < lcoarseGrid && !stop ; j++){
1049 Mfhere = IntLawpoints[pointsPrecessedSoFar + j];
1050 Mfnext = IntLawpoints[pointsPrecessedSoFar + j + 1];
1054 if(j==lcoarseGrid-1 &&
i < actualnumberofGrids-1){
1055 ratio = mydfRatio[
i+1];
1058 ratio = mydfRatio[
i];
1060 if(Mfnext + evaldMf >= Mfmax){
1061 double dratio = (Mfmax - Mfhere)/evaldMf + 1;
1062 ratio = (int) dratio;
1063 int roundratio = round((Mfmax - Mfhere)/evaldMf) + 1;
1064 if(fabs(dratio-roundratio) < 0.0001) ratio = roundratio;
1068 printf(
"\nMfmax, Mfhere, evaldMf, ratio, lastfreqHz= %.16f %.16f %.16f %i %.16e\n", Mfmax, Mfhere, evaldMf, ratio,
XLALSimIMRPhenomXUtilsMftoHz(Mfhere+(ratio-1)*evaldMf,pWF->
Mtot) );
1075 UINT4 jjdx = j + pointsPrecessedSoFar;
1076 if(jjdx < lenCoarseArray){
1077 Omega = (ILphaselm[jjdx+ 1] - ILphaselm[jjdx])/(IntLawpoints[jjdx + 1] - IntLawpoints[jjdx]);
1080 Omega = (ILphaselm[jjdx] - ILphaselm[jjdx -1])/(IntLawpoints[jjdx] - IntLawpoints[jjdx -1]);
1082 phi0 = ILphaselm[jjdx];
1085 Q = cexp(I*evaldMf*Omega);
1087 finefreqs[count] = Mfhere;
1092 for(
int kk = 1; kk < ratio; kk++){
1093 finefreqs[count] = Mfhere + evaldMf*kk;
1094 expphi[count] =
Q*expphi[count-1];
1099 pointsPrecessedSoFar = pointsPrecessedSoFar + lcoarseGrid;
1103 printf(
"\ncount = %i\n", count);
1107 printf(
"\n******* Interpolate Amplitude **********\n");
1112 interpolateAmplitude(fineAmp, IntLawpoints, ILamplm, finefreqs, lenCoarseArray, count, ampinterpolorder);
1117 while(finefreqs[count-1] > Mfmax){
1121 printf(
"\n******* Building Waveform 2**********\n");
1122 printf(
"\nfinefreqs[0]Hz = %.16f\n", finefreqs[0]/pWF->
M_sec);
1123 printf(
"\nfinefreqs[%i]Hz = %.16f\n", count-1, finefreqs[count-1]/pWF->
M_sec);
1124 printf(
"Mfmax in Hz = %.16f\n", Mfmax/pWF->
M_sec);
1125 printf(
"count, offset = %i %zu\n", count-1, offset);
1126 printf(
"Mfmaxtheory = %.16f\n", (count-1+offset)*deltaF);
1130 while(count+offset > iStop){ count--; }
1132 XLAL_CHECK(
XLALGPSAdd(&ligotimegps_zero, -1. / deltaF),
XLAL_EFUNC,
"Failed to shift the coalescence time to t=0. Tried to apply a shift of -1/df with df = %g.", deltaF);
1135 for(
int idx = 0; idx < (int) offset; idx++){
1136 ((*htildelm)->data->data)[idx] = 0.;
1148 for(
UINT4 idx = 0; idx < count; idx++){
1150 ((*htildelm)->data->data)[idx + offset] = minus1l * fineAmp[idx] * expphi[idx];
1155 for(
UINT4 idx = count-1; idx < iStop-offset; idx++){
1157 ((*htildelm)->data->data)[idx + offset] = 0.;
1171 sprintf(fileSpec,
"simulation%i%i_Multiband.dat", ell,emm);
1172 printf(
"\nOutput file: %s\r\n",fileSpec);
1173 file = fopen(fileSpec,
"w");
1174 fprintf(
file,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
1175 fprintf(
file,
"# Frequency (Hz) Real Imaginary\n");
1177 for(
UINT4 idx = 0; idx < count; idx++)
1189 sprintf(fileSpec2,
"amplitude%i%i_fine.dat", ell,emm);
1190 printf(
"\nOutput file: %s\r\n",fileSpec2);
1191 file2 = fopen(fileSpec2,
"w");
1192 fprintf(file2,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
1193 printf(
"\ncount, count + offset, len htildelm = %i %i %i\n", count, (
int)(count + offset), (*htildelm)->data->length);
1194 for(
UINT4 idx = 0; idx < count; idx++)
1196 fprintf(file2,
"%.16f %.16f %.16e\n", finefreqs[idx], (idx+offset)*evaldMf, fineAmp[idx]);
1259 UINT4 emm = abs(emmIn);
1261 printf(
"\nMode %i %i \n",ell,emm);
1262 printf(
"fRef_In : %e\n",fRef_In);
1263 printf(
"m1_SI : %e\n",m1_SI);
1264 printf(
"m2_SI : %e\n",m2_SI);
1265 printf(
"chi1L : %e\n",chi1L);
1266 printf(
"chi2L : %e\n\n",chi2L);
1267 printf(
"Performing sanity checks...\n");
1272 if(fRef_In < 0.0) {
XLAL_ERROR(
XLAL_EDOM,
"fRef_In must be positive or set to 0 to ignore.\n"); }
1278 if(distance < 0.0) {
XLAL_ERROR(
XLAL_EDOM,
"Distance must be positive and greater than 0.\n"); }
1290 mass_ratio = m1_SI / m2_SI;
1294 mass_ratio = m2_SI / m1_SI;
1296 if(mass_ratio > 20.0 ) {
XLAL_PRINT_INFO(
"Warning: Extrapolating outside of Numerical Relativity calibration domain."); }
1297 if(mass_ratio > 1000. && fabs(mass_ratio - 1000) > 1
e-12) {
XLAL_ERROR(
XLAL_EDOM,
"ERROR: Model not valid at mass ratios beyond 1000."); }
1298 if(fabs(chi1L) > 0.99 || fabs(chi2L) > 0.99) {
XLAL_PRINT_INFO(
"Warning: Extrapolating to extremal spins, model is not trusted."); }
1301 printf(
"\n**********************************************************************\n");
1302 printf(
"\n* IMRPhenomXHMMultiBandOneModeMixing %i%i *\n", ell, emm);
1303 printf(
"\n**********************************************************************\n");
1304 printf(
"\nm1, m2, chi1, chi2, f_min, f_max, deltaF %.16f %.16f %.16f %.16f %.16f %.16f %.16f\n", m1_SI/
LAL_MSUN_SI, m2_SI/
LAL_MSUN_SI, chi1L, chi2L,
f_min,
f_max, deltaF);
1305 if(htilde22 == NULL){
1306 printf(
"*** 22 mode not computed before ***\n\n");
1310 if(htilde22 == NULL){
1311 XLALPrintWarning(
"The input 22 waveform is NULL and will be computed internally. This produces a very small difference in the ringdown part respect to when the multibanded 22 waveform is passed in as an argument.\n ");
1326 status =
IMRPhenomXSetWaveformVariables(pWF, m1_SI, m2_SI, chi1L, chi2L, deltaF, fRef_In, phiRef,
f_min,
f_max, distance, 0.0, lalParams, debug);
1334 INT4 offset = (size_t) (pWF->
fMin / deltaF);
1343 printf(
"\nTransforming to positive m by doing (-1)^l*Conjugate, frequencies must be negatives.\n");
1345 for(
UINT4 idx=offset; idx<(*htildelm)->data->length; idx++){
1346 (*htildelm)->data->data[idx] = minus1l*conj((*htildelm)->data->data[idx]);
1355 lastfreq = pWF->
fMax;
1356 XLAL_PRINT_WARNING(
"The input f_max = %.2f Hz is larger than the internal cutoff of Mf=0.3 (%.2f Hz). Array will be filled with zeroes between these two frequencies.\n", pWF->
fMax, pWF->
f_max_prime);
1362 size_t n_full =
NextPow2(lastfreq / deltaF) + 1;
1363 size_t n = (*htildelm)->data->length;
1367 XLAL_CHECK (*htildelm,
XLAL_ENOMEM,
"Failed to resize waveform COMPLEX16FrequencySeries of length %zu (for internal fCut=%f) to new length %zu (for user-requested f_max=%f).", n, pWF->
fCut, n_full, pWF->
fMax );
1400 size_t iStart = (size_t) (pWF->
fMin / deltaF);
1401 size_t iStop = (size_t) (pWF->
f_max_prime / deltaF) + 1;
1403 "minimum freq index %zu and maximum freq index %zu do not fulfill 0<=ind_min<=ind_max<=htilde->data>length=%zu.", iStart, iStop, npts);
1422 printf(
"\n***** MBAND = %i, resTest = %.16f, ampIntorder = %i\n",
MBAND, resTest, ampinterpolorder);
1425 REAL8 dfpower = 11./6.;
1432 REAL8 dfmerger = 0., dfringdown = 0.;
1459 printf(
"f_min = %.6f, Mfmin = %.6f\n", pWF->
fMin, Mfmin);
1460 printf(
"f_max = %.6f, f_max_prime = %.6f, Mfmax = %.6f\n", pWF->
fMax, pWF->
f_max_prime, Mfmax);
1461 printf(
"\nfRING = %e\n",pWFHM->
fRING);
1462 printf(
"fDAMP = %e\n",pWFHM->
fDAMP);
1463 printf(
"\nMfmin = %.6f\n", Mfmin);
1464 printf(
"MfMECO = %.6f\n", MfMECO);
1465 printf(
"MfLorentzianEnd = %.6f\n", MfLorentzianEnd);
1466 printf(
"Mfmax = %.6f\n", Mfmax);
1467 printf(
"evaldMf = %.6e\n", evaldMf);
1468 printf(
"dfpower = %.6e\n", dfpower);
1469 printf(
"dfcoefficient = %.6e\n", dfcoefficient);
1470 printf(
"dfmerger = %.6e\n", dfmerger);
1471 printf(
"dfringdown = %.6e\n", dfringdown);
1472 printf(
"alphaL_S = %.16e\n", pPhase->
alphaL_S);
1476 UINT4 lengthallGrids = 20;
1479 if (allGrids == NULL)
1482 printf(
"Malloc of allGrids failed!\n");
1491 printf(
"allGrids[0].Length = %i\n", allGrids[0].Length);
1495 INT4 mydfRatio[lengthallGrids];
1497 UINT4 actualnumberofGrids = 0;
1499 UINT4 lenCoarseArray = 0;
1503 for(
UINT4 kk = 0; kk < nGridsUsed; kk++){
1504 lenCoarseArray = lenCoarseArray + allGrids[kk].
Length;
1505 actualnumberofGrids++;
1510 printf(
"\nkk = %i\n",kk);
1511 printf(
"xStart: %.16e\n", allGrids[kk].xStart);
1512 printf(
"xEnd: %.16e\n", allGrids[kk].xEndRequested);
1513 printf(
"Length: %i\n", allGrids[kk].Length);
1514 printf(
"deltax: %.16e\n", allGrids[kk].deltax);
1515 printf(
"evaldMf: %.16e\n", evaldMf);
1516 printf(
"xMax: %.16e\n", allGrids[kk].xMax);
1517 printf(
"# fine points %i\n", mydfRatio[kk]);
1518 printf(
"Last grid.xMax = %.16f\n", allGrids[actualnumberofGrids-1].xMax);
1521 if(allGrids[kk].xMax + evaldMf >= Mfmax){
1527 while(allGrids[actualnumberofGrids-1].xMax < Mfmax){
1528 allGrids[actualnumberofGrids-1].
xMax = allGrids[actualnumberofGrids-1].
xMax + allGrids[actualnumberofGrids-1].
deltax;
1529 allGrids[actualnumberofGrids-1].
Length = allGrids[actualnumberofGrids-1].
Length + 1;
1535 printf(
"\nactualnumberofGrids = %i\n", actualnumberofGrids);
1536 printf(
"lenCoarseArray = %i\n", lenCoarseArray);
1537 printf(
"Last grid.xMax = %.16f", allGrids[actualnumberofGrids-1].xMax);
1542 UINT4 lenIntLawpoints = 0;
1544 for(
UINT4 kk = 0; kk < actualnumberofGrids; kk++){
1545 for(
INT4 ll = 0; ll < allGrids[kk].
Length; ll++){
1546 IntLawpoints[lenIntLawpoints] = (allGrids[kk].
xStart + allGrids[kk].
deltax*ll);
1556 printf(
"\n******** Coarse frequencies array done ********* \n");
1557 printf(
"\nlenIntLawpoints, coarse[0], coarse[-1], Mfmax, M_sec = %i %.16e %.16e %.16e %.16e\n",lenIntLawpoints, IntLawpoints[0], IntLawpoints[lenIntLawpoints-1], Mfmax, pWF->
M_sec);
1569 printf(
"\n***** Coarse freqs *****\n");
1572 for (
UINT4 ii = 0; ii < lenCoarseArray; ii++)
1574 coarseFreqs->
data[ii] = IntLawpoints[ii]*divis;
1577 printf(
"\nFirst/Last Coarse freqs *****%.16f %.16f\n", coarseFreqs->
data[0], coarseFreqs->
data[coarseFreqs->
length-1]);
1584 printf(
"\n******* Splitting spherical/spheroidal coarseFreqs %i****************\n",lenCoarseArray);
1591 double MfRDcutMin, MfRDcutMax;
1601 printf(
"\nMfRDcutMin = %.16f, MfRDcutMax = %.16f, lastcoarseArray = %.16f\n", MfRDcutMin, MfRDcutMax, IntLawpoints[lenCoarseArray-1]);
1606 unsigned int lencoarseS = 0, lencoarseSS = 0, enter = 0;
1607 for(
UINT4 idx = 0; idx < lenCoarseArray; idx++){
1608 double ff = IntLawpoints[idx];
1609 if(ff > MfRDcutMin){
1610 if(lencoarseSS < 1 && lencoarseS>0){
1611 IntLawpointsSS[lencoarseSS] = IntLawpointsS[lencoarseS-1];
1614 if(idx == lenCoarseArray-1){
1615 IntLawpointsS[lencoarseS] = ff;
1619 IntLawpointsSS[lencoarseSS] = ff;
1622 if(idx < lenCoarseArray-1 && IntLawpoints[idx+1] < MfRDcutMax){
1623 IntLawpointsS[lencoarseS] = ff;
1626 if(idx < lenCoarseArray-1 && IntLawpoints[idx+1] > MfRDcutMax && enter<2){
1627 IntLawpointsS[lencoarseS] = ff;
1633 IntLawpointsS[lencoarseS] = ff;
1639 printf(
"\n******* Coarse Freqs Spherical/Spheroidal ****************\n");
1640 printf(
"%i ", lencoarseS);
1641 printf(
"%i ", lencoarseSS);
1647 for (
UINT4 ii = 0; ii < lencoarseS; ii++)
1649 coarseFreqsS->
data[ii] = IntLawpointsS[ii]/pWF->
M_sec;
1651 for (
UINT4 ii = 0; ii < lencoarseSS; ii++)
1653 coarseFreqsSS->
data[ii] = IntLawpointsSS[ii]/pWF->
M_sec;
1658 printf(
"\n******* Computing Coarse Phase and Amp ****************\n");
1659 printf(
"%i ", coarseFreqsS->
length);
1660 printf(
"%i ", coarseFreqsSS->
length);
1669 if(lencoarseS > ampinterpolorder){
1670 IMRPhenomXHM_Phase(&phase, coarseFreqsS, pWF, pAmp22, pPhase22, pWFHM, pAmp, pPhase);
1673 if(lencoarseSS > ampinterpolorder){
1677 printf(
"\nLength@phaseSS = %i\n",phaseSS->
data->
length);
1684 printf(
"\n******* Computed Coarse Amp and Phase **************** %i\n", coarseFreqs->
length);
1694 if(lencoarseS > ampinterpolorder){
1695 for (
UINT4 ii = 0; ii < lencoarseS; ii++)
1697 ILamplm[ii] = ((amplitude)->
data->data)[ii];
1698 ILphaselm[ii] = ((phase)->
data->data)[ii];
1701 if(lencoarseSS > ampinterpolorder){
1702 for (
UINT4 ii = 0; ii < lencoarseSS; ii++)
1704 ILamplmSS[ii] = ((amplitudeSS)->
data->data)[ii];
1705 ILphaselmSS[ii] = ((phaseSS)->
data->data)[ii];
1710 if(lencoarseS > ampinterpolorder) printf(
"\nLast spherical phases %.16f %.16f", ILphaselm[lencoarseS-2], ILphaselm[lencoarseS-1]);
1711 if(lencoarseSS > ampinterpolorder) printf(
"\nLast spherical freqs %.16f %.16f", IntLawpoints[lencoarseS-2], IntLawpoints[lencoarseS-1]);
1718 sprintf(fileSpec0,
"coarseamplitude%i%i.dat", ell,emm);
1719 printf(
"\nOutput file: %s\r\n",fileSpec0);
1720 file0 = fopen(fileSpec0,
"w");
1721 fprintf(file0,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
1724 sprintf(fileSpec3,
"coarsephase%i%i.dat", ell,emm);
1725 printf(
"\nOutput file: %s\r\n",fileSpec3);
1726 file3 = fopen(fileSpec3,
"w");
1727 fprintf(file3,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
1728 for(
UINT4 idx = 0; idx < (
UINT4)lencoarseS && lencoarseS>ampinterpolorder; idx++)
1730 fprintf(file0,
"%.16f %.16e \n", coarseFreqsS->
data[idx], ILamplm[idx]);
1731 fprintf(file3,
"%.16f %.16e \n", coarseFreqsS->
data[idx]*pWF->
M_sec, ILphaselm[idx]);
1734 if(lencoarseSS > ampinterpolorder){
1735 for(
UINT4 idx = 0; idx < (
UINT4)lencoarseSS && lencoarseSS>ampinterpolorder; idx++)
1737 fprintf(file0,
"%.16f %.16e \n", coarseFreqsSS->
data[idx], ILamplmSS[idx]);
1738 fprintf(file3,
"%.16f %.16e \n", coarseFreqsSS->
data[idx]*pWF->
M_sec, ILphaselmSS[idx]);
1746 if(lencoarseS > ampinterpolorder){
1750 if(lencoarseSS > ampinterpolorder){
1764 for(
UINT4 kk = 0; kk < actualnumberofGrids; kk++){
1765 lenWF = lenWF + (allGrids[kk].
Length -1) * mydfRatio[kk] + 2*mydfRatio[kk];
1767 printf(
"\nmydfRatio[%i] = %i %i %i", kk, mydfRatio[kk],allGrids[kk].Length, (allGrids[kk].Length -1) * mydfRatio[kk] + 2*mydfRatio[kk]);
1768 printf(
"\nlenWF = %i", lenWF);
1773 int pointsPrecessedSoFar = 0;
1777 if (expphi == NULL) {
1782 if (finefreqs == NULL){
1787 UINT4 coarsecount = 0;
1788 UINT4 RDcutMin = 0, RDcutMax = 0;
1790 INT4 lenRD = round((Mfmax - MfRDcutMin)/evaldMf) + 3;
1800 for (
UINT4 i = 0;
i<actualnumberofGrids && !stop;
i++){
1802 printf(
"\ni = %i\n",
i);
1808 if(lcoarseGrid == 0){
1813 if(
i==actualnumberofGrids-1){
1817 REAL8 Omega, phi0, Mfhere = 0, Mfnext=0;
1821 for(
UINT4 j = 0; j < lcoarseGrid && !stop; j++){
1822 Mfhere = IntLawpoints[pointsPrecessedSoFar + j];
1823 Mfnext = IntLawpoints[pointsPrecessedSoFar + j + 1] ;
1827 if(j==lcoarseGrid-1 &&
i < actualnumberofGrids-1){
1828 ratio = mydfRatio[
i+1];
1831 ratio = mydfRatio[
i];
1833 if(Mfnext + evaldMf >= Mfmax){
1834 double dratio = (Mfmax - Mfhere)/evaldMf + 1;
1835 ratio = (int) dratio;
1836 int roundratio = round((Mfmax - Mfhere)/evaldMf) + 1;
1837 if(fabs(dratio-roundratio) < 0.0001) ratio = roundratio;
1841 printf(
"\nMfmax, Mfhere, evaldMf, ratio= %.16f %.16f %.16f %i\n", Mfmax, Mfhere, evaldMf, ratio);
1849 if(Mfhere > MfRDcutMin && lencoarseSS > ampinterpolorder) {
1851 MfRDcutMin = Mfhere;
1853 linear32[0] = cexp( I * (pPhase->
C1RD*Mfhere+pPhase->
CRD + pPhase->
deltaphiLM));
1854 Q32 = cexp( I * evaldMf * (pPhase->
C1RD));
1856 printf(
"\n*** Starting spheroidal part ****\n");
1857 printf(
"Mfhere, MfRDcutMin, RDcutMin = %.16e %.16e %i\n", Mfhere, MfRDcutMin, RDcutMin);
1859 if(lencoarseS <= ampinterpolorder){
1864 INT4 jdx = pointsPrecessedSoFar + j - coarsecount + 1;
1866 phi0 = ILphaselmSS[jdx];
1868 if(jdx < (
int)lencoarseSS-1){
1869 Omega = (ILphaselmSS[ jdx + 1] - ILphaselmSS[jdx])/(IntLawpoints[pointsPrecessedSoFar + j + 1] - IntLawpoints[pointsPrecessedSoFar + j]);
1872 Omega = (ILphaselmSS[jdx] - ILphaselmSS[jdx - 1])/(IntLawpoints[pointsPrecessedSoFar + j] - IntLawpoints[pointsPrecessedSoFar + j -1]);
1884 UINT4 jjdx = j + pointsPrecessedSoFar;
1885 if(jjdx < lencoarseS-1){
1886 Omega = (ILphaselm[jjdx+ 1] - ILphaselm[jjdx])/(IntLawpoints[jjdx + 1] - IntLawpoints[jjdx]);
1889 Omega = (ILphaselm[jjdx] - ILphaselm[jjdx -1])/(IntLawpoints[jjdx] - IntLawpoints[jjdx -1]);
1892 phi0 = ILphaselm[jjdx];
1897 Q = cexp(I*evaldMf*Omega);
1899 if(RDcutMin == 0 && lencoarseS>ampinterpolorder){
1900 finefreqs[count] = Mfhere;
1904 for(
int kk = 1; kk < ratio; kk++){
1905 finefreqs[count] = Mfhere + evaldMf*kk;
1906 expphi[count] =
Q*expphi[count-1];
1911 finefreqs[count] = Mfhere;
1913 linear32[count - RDcutMin +1] = Q32*linear32[count - RDcutMin ];
1916 for(
int kk = 1; kk < ratio; kk++){
1917 finefreqs[count] = Mfhere + evaldMf*kk;
1918 expphi[count] =
Q*expphi[count-1];
1919 linear32[count - RDcutMin +1] = Q32*linear32[count - RDcutMin ];
1924 pointsPrecessedSoFar = pointsPrecessedSoFar + lcoarseGrid;
1930 if(lencoarseS <= ampinterpolorder){
1939 printf(
"\nTheory and practice (should not be equal) %i %i \n", lencoarseS, coarsecount );
1940 printf(
"\n******* Interpolate Amplitude **********\n");
1947 interpolateAmplitudeMixing(fineAmp, fineAmpSS, IntLawpointsS, IntLawpointsSS, ILamplm, ILamplmSS, finefreqs, lencoarseS, lencoarseSS, count, RDcutMin, RDcutMax, ampinterpolorder);
1951 size_t offset = iStart;
1954 printf(
"\nfinefreqs[0], evaldMf, quotient, offset = %.16e %.16e %.16e %zu\n", finefreqs[0], evaldMf, finefreqs[0]/evaldMf, offset);
1959 while(finefreqs[count-1] > Mfmax){
1961 if(RDcutMin>count) RDcutMin = count;
1962 if(RDcutMax>count) RDcutMax = count;
1966 while(count + offset > iStop){ count--;}
1968 XLAL_CHECK(
XLALGPSAdd(&ligotimegps_zero, -1. / deltaF ),
XLAL_EFUNC,
"Failed to shift the coalescence time to t=0. Tried to apply a shift of -1/df with df = %g.", deltaF);
1971 for(
int idx = 0; idx < (int) offset; idx++){
1972 ((*htildelm)->data->data)[idx] = 0.;
1977 for(
UINT4 idx = count-1; idx < iStop-offset; idx++){
1979 ((*htildelm)->data->data)[idx + offset] = 0.;
1983 printf(
"\n**** pPhase->fPhaseMatchIM, pPhase->fAmpMatchIM, MfRDcutMin = %.16f %.16f %.16f \n",pPhase->
fPhaseMatchIM, pAmp->
fAmpMatchIM, MfRDcutMin);
1984 printf(
"\ncount RDcutMin RDcutMax: %i %i %i\n", count, RDcutMin, RDcutMax);
1985 printf(
"\nMfRDcutMin MfRDcutMax: %.6f %.6f\n", MfRDcutMin, MfRDcutMax);
1989 sprintf(fileSpec5,
"sphericalfine%i%i.dat", ell,emm);
1990 printf(
"\nOutput file: %s\r\n",fileSpec5);
1991 file5 = fopen(fileSpec5,
"w");
1992 fprintf(file5,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
1993 fprintf(file5,
"# Frequency (Hz) Fine Spherical Phase \n");
1997 sprintf(fileSpec6,
"spheroidalfine%i%i.dat", ell,emm);
1998 printf(
"\nOutput file: %s\r\n",fileSpec6);
1999 file6 = fopen(fileSpec6,
"w");
2000 fprintf(file6,
"# q = %.16f chi1 = %.16f chi2 = %.16f lm = %i%i\n", pWF->
q, pWF->
chi1L, pWF->
chi2L, ell, emm);
2001 fprintf(file6,
"# Frequency (Hz) Fine Spheroidal Phase \n");
2013 printf(
"\nRDcutMin = %i", RDcutMin);
2015 for(
UINT4 idx = 0; idx < RDcutMin; idx++){
2016 COMPLEX16 data5 = minus1l * fineAmp[idx] * expphi[idx];
2017 ((*htildelm)->data->data)[idx + offset] = data5;
2019 fprintf(file5,
"%.16f %.16e %.16e\n",(idx + offset)*deltaF, creal(data5), cimag(data5));
2031 if(htilde22 == NULL && count>RDcutMin){
2034 printf(
"\nBuilding RD 22 mode\n");
2035 printf(
"\nlen@freqs, RDcutMin, count = %i %i %i\n", freqs->
length, RDcutMin, count);
2037 for(
UINT4 idx = RDcutMin; idx < count; idx++){
2038 freqs->
data[idx-RDcutMin] = finefreqs[idx]/pWF->
M_sec;
2052 for(
UINT4 idx = RDcutMin; idx < count; idx++){
2053 htilde22tmp->
data->
data[idx - RDcutMin] = htilde22->
data->
data[idx + offset];
2062 printf(
"\nLength@htilde22, count, RDcutMin, RDcutMax, offset %i %i %i %i %zu\n",htilde22tmp->
data->
length, (
int)(count+offset), RDcutMin, RDcutMax, offset);
2064 for(
UINT4 idx = RDcutMin; idx < count; idx++){
2065 double Mf = finefreqs[idx];
2072 REAL8 amplm = fineAmpSS[idx-RDcutMin] * pWFHM->
Amp0;
2076 shift32 = linear32[idx-RDcutMin];
2081 if(Mf < pAmp->fAmpMatchIM){
2082 data = sphericalWF_32/cabs(sphericalWF_32) * fineAmp[idx];
2093 data = cabs(sphericalWF_32) * myphase;
2097 data = sphericalWF_32;
2099 ((*htildelm)->data->data)[idx + offset] =
data * minus1l;
2101 data = ((*htildelm)->data->data)[idx + offset];
2102 fprintf(file6,
"%.16f %.16e %.16e\n",(idx + offset)*deltaF, creal(
data), cimag(
data));
2119 printf(
"\n******* Building Waveform 2**********\n");
2120 printf(
"\nfinefreqs[0]Hz = %.16f\n", finefreqs[0]/pWF->
M_sec);
2121 printf(
"\nfinefreqs[%i]Hz = %.16f\n", count-1, finefreqs[count-1]/pWF->
M_sec);
2122 printf(
"Mfmax in Hz = %.16f\n", Mfmax/pWF->
M_sec);
2123 printf(
"count-1, offset = %i %zu\n", count-1, offset);
2124 printf(
"Mfmaxtheory = %.16f\n", (count-1+offset)*deltaF);
2125 printf(
"\nlength@htildelm, count+offset = %i %zu", (*htildelm)->data->length, count+offset);
2126 printf(
"\nf_max_prime = %.16e", pWF->
f_max_prime);
2127 printf(
"\nlastfreq true = %.16e", (*htildelm)->data->length * deltaF);
2128 printf(
"\nlastfreq true = %.16e %.16e", creal((*htildelm)->data->data[count-1]), cimag((*htildelm)->data->data[count-1]));
2136 sprintf(fileSpec,
"simulation%i%i_Multiband.dat", ell,emm);
2137 printf(
"\nOutput file: %s\r\n",fileSpec);
2138 file = fopen(fileSpec,
"w");
2140 fprintf(
file,
"# Frequency (Hz) Real Imaginary\n");
2142 for(
UINT4 idx = 0; idx < ((*htildelm)->data->length); idx++)
2144 data = ((*htildelm)->data->data)[idx];
2154 sprintf(fileSpec2,
"amplitude%i%i_fine.dat", ell,emm);
2155 printf(
"\nOutput file: %s\r\n",fileSpec2);
2156 file2 = fopen(fileSpec2,
"w");
2158 for(
UINT4 idx = 0; idx < RDcutMax && lencoarseS>ampinterpolorder; idx++)
2160 fprintf(file2,
"%.16f %.16e\n", finefreqs[idx], fineAmp[idx]);
2192 double coarsefreqs[],
2197 int ampinterpolorder
2201 printf(
"\n****Building interpolants*****\n");
2202 printf(
"Number of points to interpolate = %i\r\n", lengthCoarse);
2205 gsl_interp_accel *acc = gsl_interp_accel_alloc();
2207 switch(ampinterpolorder){
2209 spline = gsl_spline_alloc(gsl_interp_linear, lengthCoarse);
2213 spline = gsl_spline_alloc(gsl_interp_cspline, lengthCoarse);
2216 default:{spline = gsl_spline_alloc(gsl_interp_cspline, lengthCoarse);}
2218 gsl_spline_init(spline, coarsefreqs, coarseAmp, lengthCoarse);
2221 printf(
"\n****Loop for fine freqs*****\n");
2224 for(
INT4 kk = 0; kk < lengthFine; kk++){
2225 if(finefreqs[kk] < coarsefreqs[0] || finefreqs[kk] > coarsefreqs[lengthCoarse-1]){
2227 printf(
"\nOut of coarse range: coarse[0], coarse[-1] fine[%i] %.16e %.16e %.16e\n", kk, coarsefreqs[0], coarsefreqs[lengthCoarse-1], finefreqs[kk]);
2229 fineAmp[kk] = fineAmp[kk-1];
2232 fineAmp[kk] = gsl_spline_eval(spline, finefreqs[kk], acc);
2236 printf(
"\n****Free memory*****\n");
2239 gsl_spline_free(spline);
2240 gsl_interp_accel_free(acc);
2250 double coarsefreqs[],
2251 double coarsefreqsSS[],
2253 double coarseAmpSS[],
2258 int sphericalfinecount,
2259 int sphericalfinecountMax,
2260 int ampinterpolorder
2263 int spheroidalfinecount = lengthFine - sphericalfinecount;
2268 for(
int i = 0;
i < sphericalfinecountMax;
i++){
2269 sphericalfineFreqs[
i] = finefreqs[
i];
2271 for(
int i = 0;
i < spheroidalfinecount;
i++){
2272 spheroidalfineFreqs[
i] = finefreqs[
i + sphericalfinecount];
2275 if(lengthCoarse > ampinterpolorder)
interpolateAmplitude(fineAmp, coarsefreqs, coarseAmp, sphericalfineFreqs, lengthCoarse, sphericalfinecountMax, ampinterpolorder);
2276 if(lengthCoarseSS > ampinterpolorder)
interpolateAmplitude(fineAmpSS, coarsefreqsSS, coarseAmpSS, spheroidalfineFreqs, lengthCoarseSS, spheroidalfinecount, ampinterpolorder);
2282 sprintf(fileSpec2,
"amplitude%i%i_fineSS.dat", 3,2);
2283 printf(
"\nOutput file: %s\r\n",fileSpec2);
2284 file2 = fopen(fileSpec2,
"w");
2286 for(
long int idx = 0; idx < spheroidalfinecount; idx++)
2288 data2 = fineAmpSS[idx];
2289 fprintf(file2,
"%.16f %.16e\n", finefreqs[ sphericalfinecount + idx], data2);
2326 UNUSED
UINT4 offset = 0;
2329 printf(
"f_min, f_max = %.6f %.6f \n",
f_min,
f_max);
2336 printf(
"\n******* deltaF > 0 ************\n");
2345 printf(
"npts = %zu\n",npts);
2346 printf(
"fMin = %.4f\n",
f_min);
2347 printf(
"fMax = %.4f\n",
f_max);
2348 printf(
"dF = %.4f\n",pWF->
deltaF);
2355 printf(
"f_min, f_max = %.6f %.6f \n",
f_min,
f_max);
2364 size_t iStop = (size_t) (
f_max / pWF->
deltaF) + 1;
2367 "minimum freq index %zu and maximum freq index %zu do not fulfill 0<=ind_min<=ind_max<=htilde->data>length=%zu.", iStart, iStop, npts);
2369 printf(
"f_min, f_max = %.6f %.6f \n",
f_min,
f_max);
2374 printf(
"f_min, f_max = %.6f %.6f \n",
f_min,
f_max);
2381 printf(
"f_min, f_max = %.6f %.6f \n",
f_min,
f_max);
2384 for (
UINT4 i = iStart;
i < iStop;
i++)
2386 (*freqs)->data[
i-iStart] =
i * pWF->
deltaF;
2393 printf(
"\n******* deltaF = 0 ************\n");
2399 XLAL_CHECK (*amphase,
XLAL_ENOMEM,
"Failed to allocated waveform REAL8FrequencySeries of length %zu from sequence.", npts);
2413 (*freqs)->data[
i] = freqs_In->
data[
i];
2416 memset((*amphase)->data->data, 0, npts *
sizeof(
REAL8));
2439 printf(
"\n **** IMRPhenomXHM_Amplitude **** \n");
2440 printf(
"\nf_min, f_max = %.16e %.16e\n", freqs_In->
data[0], freqs_In->
data[freqs_In->
length-1]);
2451 printf(
"\n***Length@freqs, offset %i %i",freqs_In->
length,offset);
2452 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs_In->
data[0], freqs_In->
data[freqs_In->
length-1]);
2453 printf(
"\n***Length@freqs, offset %i %i",freqs->
length,offset);
2454 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs->
data[0], freqs->
data[freqs->
length-1]);
2472 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2478 ((*amplm)->data->data)[idx+offset] = pWFHM->
Amp0 * amp;
2490 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2496 ((*amplm)->data->data)[idx+offset] = pWFHM->
Amp0 * amp;
2519 printf(
"\n **** IMRPhenomXHM_Amplitude **** \n");
2530 printf(
"\n***Length@freqs, offset %i %i",freqs_In->
length,offset);
2531 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs_In->
data[0], freqs_In->
data[freqs_In->
length-1]);
2532 printf(
"\n***Length@freqs, offset %i %i",freqs->
length,offset);
2533 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs->
data[0], freqs->
data[freqs->
length-1]);
2551 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2558 ((*amplm)->data->data)[idx+offset] = amp;
2582 printf(
"\n **** IMRPhenomXHM_Phase **** \n");
2593 printf(
"\n***Length@freqs, offset %i %i",freqs->
length,offset);
2594 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs->
data[0], freqs->
data[freqs->
length-1]);
2612 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2619 Mf = Msec * freqs->
data[idx];
2624 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2633 printf(
"\nExtrapolating intermediate phase out of its range for one point\n");
2642 ((*phaselm)->data->data)[idx+offset] = phi;
2656 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2662 ((*phaselm)->data->data)[idx+offset] = phi;
2684 printf(
"\n **** IMRPhenomXHM_PhaseMixing **** \n");
2695 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs_In->
data[0], freqs_In->
data[freqs_In->
length-1]);
2696 printf(
"\n***Length@freqs, offset %i %i",freqs->
length,offset);
2697 printf(
"\n\nfstart, fend = %.16f %.16f\n\n", freqs->
data[0], freqs->
data[freqs->
length-1]);
2714 XLALPrintError(
"IMRPhenomX_Initialize_Powers failed for Mf, initial_status=%d",initial_status);
2720 ((*phaselm)->data->data)[idx+offset] = phi;
2732 return (log(
x) / log(base));
2738 double aux = sqrt(sqrt(3.)*3);
2739 return 4. *
fdamp * sqrt(abserror/fabs(alpha4)) / aux;
2744 double dfphase = 5*
fdamp*sqrt(abserror*0.5/fabs(alpha4));
2745 double dfamp = sqrt(2*abserror)/fabs(LAMBDA);
2746 if (dfphase <= dfamp){
int XLALSimNRTunedTidesFDTidalPhaseFrequencySeries(const REAL8Sequence *phi_tidal, const REAL8Sequence *amp_tidal, const REAL8Sequence *planck_taper, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2, NRTidal_version_type NRTidal_version)
Function to call the frequency domain tidal correction over an array of input frequencies.
double XLALSimNRTunedTidesMergerFrequency(const REAL8 mtot_MSUN, const REAL8 kappa2T, const REAL8 q)
compute the merger frequency of a BNS system.
static size_t NextPow2(const size_t n)
static double fdamp(double eta, double chi1, double chi2, double finspin)
fdamp is the complex part of the ringdown frequency 1508.07250 figure 9
IMRPhenomX_UsefulPowers powers_of_lalpi
int IMRPhenomXASGenerateFD(COMPLEX16FrequencySeries **htilde22, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, LALDict *lalParams)
int IMRPhenomXSetWaveformVariables(IMRPhenomXWaveformStruct *wf, const REAL8 m1_SI, const REAL8 m2_SI, const REAL8 chi1L_In, const REAL8 chi2L_In, const REAL8 deltaF, const REAL8 fRef, const REAL8 phi0, const REAL8 f_min, const REAL8 f_max, const REAL8 distance, const REAL8 inclination, LALDict *LALParams, UNUSED const UINT4 debug)
NRTidal_version_type IMRPhenomX_SetTidalVersion(LALDict *lalParams)
double IMRPhenomX_TimeShift_22(IMRPhenomXPhaseCoefficients *pPhase, IMRPhenomXWaveformStruct *pWF)
REAL8 IMRPhenomX_TidalPhaseDerivative(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase, NRTidal_version_type NRTidal_version)
void IMRPhenomX_Phase_22_ConnectionCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase)
int IMRPhenomXGetAmplitudeCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp)
int IMRPhenomX_Initialize_Powers(IMRPhenomX_UsefulPowers *p, REAL8 number)
double IMRPhenomX_Phase_22(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXPhaseCoefficients *pPhase, IMRPhenomXWaveformStruct *pWF)
void IMRPhenomXGetTidalPhaseCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase, NRTidal_version_type NRTidal_version)
REAL8 IMRPhenomX_TidalPhase(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase, NRTidal_version_type NRTidal_version)
int IMRPhenomXGetPhaseCoefficients(IMRPhenomXWaveformStruct *pWF, IMRPhenomXPhaseCoefficients *pPhase)
double IMRPhenomX_dPhase_22(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXPhaseCoefficients *pPhase, IMRPhenomXWaveformStruct *pWF)
double IMRPhenomX_Amplitude_22(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXAmpCoefficients *pAmp, IMRPhenomXWaveformStruct *pWF)
IMRPhenomX_UsefulPowers powers_of_lalpiHM
REAL8 IMRPhenomXHM_Amplitude_ModeMixing(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase, IMRPhenomXHMWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXWaveformStruct *pWF22)
void IMRPhenomXHM_SetHMWaveformVariables(int ell, int emm, IMRPhenomXHMWaveformStruct *wf, IMRPhenomXWaveformStruct *wf22, QNMFits *qnms, LALDict *LALParams)
void IMRPhenomXHM_GetAmplitudeCoefficients(IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXWaveformStruct *pWF22)
void IMRPhenomXHM_GetPhaseCoefficients(IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXWaveformStruct *pWF22, UNUSED LALDict *lalParams)
REAL8 IMRPhenomXHM_Amplitude_noModeMixing(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMWaveformStruct *pWF)
void GetSpheroidalCoefficients(IMRPhenomXHMPhaseCoefficients *pPhase, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXWaveformStruct *pWF22)
void IMRPhenomXHM_FillAmpFitsArray(IMRPhenomXHMAmpCoefficients *pAmp)
void IMRPhenomXHM_FillPhaseFitsArray(IMRPhenomXHMPhaseCoefficients *pPhase)
REAL8 IMRPhenomXHM_Phase_noModeMixing(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXHMPhaseCoefficients *pPhase, IMRPhenomXHMWaveformStruct *pWF, UNUSED IMRPhenomXWaveformStruct *pWF22)
REAL8 IMRPhenomXHM_Phase_ModeMixing(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase, IMRPhenomXHMWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXWaveformStruct *pWF22)
void IMRPhenomXHM_Initialize_QNMs(QNMFits *qnms)
static double deltaF_ringdownBin(REAL8 fdamp, REAL8 alpha4, REAL8 LAMBDA, REAL8 abserror)
static int interpolateAmplitudeMixing(double *fineAmp, double *fineAmpSS, double coarsefreqs[], double coarsefreqsSS[], double coarseAmp[], double coarseAmpSS[], double finefreqs[], int lengthCoarse, int lengthCoarseSS, int lengthFine, int sphericalfinecount, int sphericalfinecountMax, int ampinterpolorder)
INT4 XLALSimIMRPhenomXMultibandingGrid(REAL8 fstartIn, REAL8 fend, REAL8 MfLorentzianEnd, REAL8 Mfmax, REAL8 evaldMf, REAL8 dfpower, REAL8 dfcoefficient, IMRPhenomXMultiBandingGridStruct *allGrids, REAL8 dfmerger, REAL8 dfringdown)
INT4 deltaF_MergerRingdown(REAL8 *dfmerger, REAL8 *dfringdown, REAL8 resTest, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
static double logbase(double base, double x)
static int IMRPhenomXHM_AmplitudeMixing(REAL8FrequencySeries **amplm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, UNUSED IMRPhenomXHMPhaseCoefficients *pPhase)
static int interpolateAmplitude(double *fineAmp, double coarsefreqs[], double coarseAmp[], double finefreqs[], int lengthCoarse, int lengthFine, int ampinterpolorder)
static int IMRPhenomXHM_PhaseMixing(REAL8FrequencySeries **phaselm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMPhaseCoefficients *pPhase)
static int SetupWFArraysReal(REAL8Sequence **freqs, REAL8FrequencySeries **amphase, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, LIGOTimeGPS ligotimegps_zero)
IMRPhenomXMultiBandingGridStruct XLALSimIMRPhenomXGridComp(REAL8 fSTART, REAL8 fEND, REAL8 mydf)
static double deltaF_mergerBin(REAL8 fdamp, REAL8 alpha4, REAL8 abserror)
static int IMRPhenomXHM_Amplitude(REAL8FrequencySeries **amplm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
Functions to compute coarse amplitude and phase.
static int IMRPhenomXHM_Phase(REAL8FrequencySeries **phaselm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
int IMRPhenomXHMMultiBandOneModeMixing(COMPLEX16FrequencySeries **htildelm, COMPLEX16FrequencySeries *htilde22, IMRPhenomXWaveformStruct *pWF, UINT4 ell, UINT4 emm, LALDict *lalParams)
int IMRPhenomXHMMultiBandOneMode(COMPLEX16FrequencySeries **htildelm, IMRPhenomXWaveformStruct *pWF, UINT4 ell, UINT4 emm, LALDict *lalParams)
static double IMRPhenomXHM_RD_Phase_AnsatzInt(double ff, IMRPhenomX_UsefulPowers *powers_of_f, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMPhaseCoefficients *pPhase)
static double IMRPhenomXHM_RD_Amp_Ansatz(IMRPhenomX_UsefulPowers *powers_of_Mf, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp)
REAL8 XLALSimIMRPhenomXUtilsHztoMf(REAL8 fHz, REAL8 Mtot_Msun)
Convert from frequency in Hz to geometric frequency.
REAL8 XLALSimIMRPhenomXUtilsMftoHz(REAL8 Mf, REAL8 Mtot_Msun)
Convert from geometric frequency to Hz.
REAL8FrequencySeries * XLALCreateREAL8FrequencySeries(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)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL8FrequencySeries(REAL8FrequencySeries *series)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
void * XLALMalloc(size_t n)
@ NoNRT_V
special case for PhenomPv2 BBH baseline
@ NRTidalv2_V
version NRTidalv2: https://arxiv.org/abs/1905.06011
int XLALSimIMRPhenomXHMMultiBandOneMode(COMPLEX16FrequencySeries **htildelm, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, UINT4 ell, INT4 emmIn, REAL8 distance, REAL8 f_min, REAL8 f_max, REAL8 deltaF, REAL8 phiRef, REAL8 fRef_In, LALDict *lalParams)
Return htildelm, the waveform of one mode without mode-mixing.
int XLALSimIMRPhenomXHMMultiBandOneModeMixing(COMPLEX16FrequencySeries **htildelm, COMPLEX16FrequencySeries *htilde22, REAL8 m1_SI, REAL8 m2_SI, REAL8 chi1L, REAL8 chi2L, UINT4 ell, INT4 emmIn, REAL8 distance, REAL8 f_min, REAL8 f_max, REAL8 deltaF, REAL8 phiRef, REAL8 fRef_In, LALDict *lalParams)
Returns htildelm the waveform of one mode that present mode-mixing.
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
const LALUnit lalStrainUnit
const LALUnit lalSecondUnit
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
#define XLAL_PRINT_INFO(...)
#define XLAL_CHECK(assertion,...)
#define XLAL_PRINT_WARNING(...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 RDCoefficient[N_MAX_COEFFICIENTS_AMPLITUDE_RING]
REAL8 RDCoefficient[N_MAX_COEFFICIENTS_PHASE_RING+3]