2 #include <gsl/gsl_vector.h>
3 #include <gsl/gsl_deriv.h>
31 unsigned int numdynvars,
32 unsigned int retLenHi,
53 gsl_spline *spline = NULL;
54 gsl_interp_accel *acc = NULL;
56 if (debugPK) {debugRD = 0;}
58 unsigned int peakIdx,
i, j;
76 REAL8 rdotvec[3] = {0,0,0};
77 REAL8 rvec[3] = {0,0,0};
78 REAL8 rcrossrdot[3] = {0,0,0};
87 for (k = 1; k < timeHi.
length-1; k++) {
88 ddradiusVec[k] = (radiusVec->
data[k+1] - 2.*radiusVec->
data[k] + radiusVec->
data[k-1])/
dt/
dt;
97 ddradiusVec[0] = ddradiusVec[1];
98 for (k = 0; k < timeHi.
length-2; k++) {
100 if (
dt*k >
dt*( timeHi.
length-2)-20 && ddradiusVec[k] > 0) {
104 double minoff =
dt*( timeHi.
length-2 - k) > 0.2 ?
dt*( timeHi.
length-2 - k) : 0.2;
106 XLAL_PRINT_INFO(
"Change of sign in ddr %3.10f M before the end\n", minoff );
109 double maxoff = 20.0;
110 unsigned int Nps = timeHi.
length;
112 double tMin = timeHi.
data[Nps-1] - maxoff;
115 double tMax = timeHi.
data[Nps-1] - minoff;
125 double time1, time2, omegaDeriv, omegaDerivMid, tPeakOmega;
128 out = fopen(
"omegaHi.dat",
"w" );
133 out = fopen(
"omegaHi.dat",
"w" );
136 for (
i = 0;
i < retLenHi;
i++ )
138 for ( j = 0; j < values->
length; j++ )
139 { values->
data[j] = *(dynamicsHi->
data+(j+1)*retLenHi+
i); }
142 memset( dvalues->
data, 0, numdynvars*
sizeof(dvalues->
data[0]));
148 " Calculation of dr/dt failed while computing omegaHi time series\n");
156 " Calculation of dr/dt failed while computing omegaHi time series\n");
163 rvec[j] = values->
data[j];
164 rdotvec[j] = dvalues->
data[j];
175 if(debugPK || debugRD){
184 for (
i = 1, peakIdx = 0;
i < retLenHi-1;
i++ ){
185 omega = omegaHi->
data[
i];
187 if (omega >= omegaHi->
data[
i-1] && omega > omegaHi->
data[
i+1] && tMax>=timeHi.
data[
i] && timeHi.
data[
i]>=tMin){
191 XLAL_PRINT_INFO(
"PK: Crude peak of Omega is at idx = %d. t = %f, OmegaPeak = %.16e\n",
192 peakIdx, timeHi.
data[peakIdx], omega);
202 XLAL_PRINT_INFO(
"Stas: peak of orbital frequency was not found. peakIdx = %d, retLenHi = %d, i at exit = %d\n", peakIdx, retLenHi,
i);
213 spline = gsl_spline_alloc( gsl_interp_cspline, retLenHi );
214 acc = gsl_interp_accel_alloc();
215 time1 = timeHi.
data[peakIdx-2];
216 gsl_spline_init( spline, timeHi.
data, omegaHi->
data, retLenHi );
217 omegaDeriv = gsl_spline_eval_deriv( spline, time1, acc );
219 if ( omegaDeriv > 0. ) { time2 = timeHi.
data[peakIdx+2]; }
223 time1 = timeHi.
data[peakIdx-2];
224 omegaDeriv = gsl_spline_eval_deriv( spline, time1, acc );
229 tPeakOmega = ( time1 + time2 ) / 2.;
230 omegaDerivMid = gsl_spline_eval_deriv( spline, tPeakOmega, acc );
232 if ( omegaDerivMid * omegaDeriv < 0.0 ) { time2 = tPeakOmega; }
235 omegaDeriv = omegaDerivMid;
239 XLAL_PRINT_INFO(
"Stas: searching for orbital max: %f, %f, %f, %f \n", time1, time2, omegaDeriv, omegaDerivMid);
241 }
while ( time2 - time1 > 1.0e-5 );
243 XLAL_PRINT_INFO(
"Estimation of the orbital peak is now at time %.16e \n", tPeakOmega);
248 if(*found == 0 || debugRD || debugPK){
250 XLAL_PRINT_INFO(
"Stas: We couldn't find the maximum of orbital frequency, search for maximum of A(r)/r^2 \n");
252 REAL8 rad, rad2,
m1PlusetaKK,
bulk,
logTerms,
deltaU,
u,
u2,
u3,
u4,
u5;
253 REAL8 listAOverr2[retLenHi];
269 REAL8 s1Data[3], s2Data[3];
270 REAL8 mTotal = m1 + m2;
272 REAL8 eta = m1*m2/(mTotal*mTotal);
274 if(debugPK || debugRD){
275 out = fopen(
"OutAofR.dat",
"w" );
277 for (
i = 0;
i < retLenHi;
i++ )
279 for ( j = 0; j < values->
length; j++ )
281 values->
data[j] = *(dynamicsHi->
data+(j+1)*retLenHi+
i);
283 for( j = 0; j < 3; j++ )
287 s1Data[j] = values->
data[j+6] * mTotal * mTotal;
288 s2Data[j] = values->
data[j+9] * mTotal * mTotal;
307 listAOverr2[
i] =
deltaU / rad2;
308 if(debugPK || debugRD){
309 fprintf(out,
"%3.10f %3.10f\n", timeHi.
data[
i], listAOverr2[
i]);
313 if(debugPK || debugRD ) fclose(out);
318 for (
i = 1, peakIdx = 0;
i < retLenHi-1;
i++ ){
319 Aoverr2 = listAOverr2[
i];
320 if (Aoverr2 >= listAOverr2[
i-1] && Aoverr2 > listAOverr2[
i+1]){
321 if (timeHi.
data[
i] > tMin){
323 tPeakOmega = timeHi.
data[
i];
326 XLAL_PRINT_INFO(
"PK: Peak of A(r)/r^2 is at idx = %d. t = %f, Peak ampl. = %.16e\n",
327 peakIdx, timeHi.
data[peakIdx], Aoverr2);
339 peakIdx = %d, retLenHi = %d, i at exit = %d\n", peakIdx, retLenHi,
i);
347 gsl_spline_free(spline);
349 gsl_interp_accel_free(acc);
354 return(timeHi.
data[retLenHi-1]);
368 unsigned int i, peakIdx;
369 unsigned int NpsSmall = 0;
378 out = fopen(
"AmpPHi.dat",
"w" );
381 int iMax = timeHi->
length-1;
382 NpsSmall = iMax - iMin + 1;
383 AmplO = sqrt(creal(hP22->
data[iMin + 0])*creal(hP22->
data[iMin + 0]) + cimag(hP22->
data[iMin + 0])*cimag(hP22->
data[iMin + 0]));
385 tAmpMax = timeHi->
data[iMin];
388 for (
i=0;
i<NpsSmall-1;
i++){
390 AmplN = sqrt(creal(hP22->
data[iMin +
i+1])*creal(hP22->
data[iMin +
i+1]) + cimag(hP22->
data[iMin +
i+1])*cimag(hP22->
data[iMin +
i+1]));
393 fprintf(out,
"%3.10f %3.10f\n", timeHi->
data[iMin+
i], Ampl);
395 if (Ampl >= AmplO && Ampl >AmplN){
398 tAmpMax = timeHi->
data[iMin +
i];
403 XLAL_PRINT_INFO(
"Stas dismissing time %3.10f outside limits %3.10f, %3.10f \n",
404 timeHi->
data[iMin +
i], timeHi->
data[iMin], timeHi->
data[iMax]);
415 XLAL_PRINT_INFO(
"Peak of 2,2 mode in P-frame was not found. peakIdx = %d, retLenHi = %d, i at exit = %d\n", peakIdx, timeHi->
length,
i);
418 XLAL_PRINT_INFO(
"We have found maximum of amplitude %3.10f at t = %3.10f \n", AmpMax, tAmpMax);
438 gsl_spline *spline = NULL;
439 gsl_interp_accel *acc = NULL;
440 if (debugPK) {debugRD = 0;}
442 double dt = timeHi->
data[1] - timeHi->
data[0];
449 for (k = 1; k < timeHi->
length-1; k++) {
450 ddradiusVec[k] = (radiusVec->
data[k+1] - 2.*radiusVec->
data[k] + radiusVec->
data[k-1])/
dt/
dt;
459 ddradiusVec[0]=ddradiusVec[1];
460 for (k = 0; k < timeHi->
length-2; k++) {
462 if (
dt*k >
dt*( timeHi->
length-2)-20 && ddradiusVec[k] > 0) {
466 double minoff =
dt*( timeHi->
length-2 - k) > 0.2 ?
dt*( timeHi->
length-2 - k) : 0.2;
468 XLAL_PRINT_INFO(
"Change of sign in ddr %3.10f M before the end\n", minoff );
471 unsigned int i, peakIdx;
472 double maxoff = 20.0;
473 unsigned int Nps = timeHi->
length;
478 double tMin = timeHi->
data[Nps-1] - maxoff;
479 double tMax = timeHi->
data[Nps-1] - minoff;
481 tMin = tMax - maxoff;
485 unsigned int iMin = ceil((tMin-timeHi->
data[0])/
dt);
486 unsigned int iMax = floor((tMax-timeHi->
data[0])/
dt);
487 unsigned int NpsSmall = iMax - iMin + 1;
490 double tAmpMax, tAmp;
493 REAL8 tSeries[NpsSmall], Ampl[NpsSmall];
495 if(debugPK || debugRD) {
496 out = fopen(
"AmpPHi.dat",
"w" );
498 AmplO = sqrt(creal(hP22->
data[iMin + 0])*creal(hP22->
data[iMin + 0]) + cimag(hP22->
data[iMin + 0])*cimag(hP22->
data[iMin + 0]));
501 for (
i=0;
i<NpsSmall-1;
i++){
502 tSeries[
i] = timeHi->
data[iMin +
i];
503 AmplN = sqrt(creal(hP22->
data[iMin +
i+1])*creal(hP22->
data[iMin +
i+1]) + cimag(hP22->
data[iMin +
i+1])*cimag(hP22->
data[iMin +
i+1]));
505 if(debugPK || debugRD){
506 fprintf(out,
"%3.10f %3.10f\n", tSeries[
i], Ampl[
i]);
508 if (Ampl[
i] >= AmplO && Ampl[
i] >AmplN){
510 tAmp = timeHi->
data[iMin +
i];
511 if (tAmp >=tMin && tAmp <= tMax ){
518 XLAL_PRINT_INFO(
"Stas dismissing time %3.10f outside limits %3.10f, %3.10f \n",
532 XLAL_PRINT_INFO(
"Stas: peak of 2,2 mode in P-frame was not found. peakIdx = %d, retLenHi = %d, i at exit = %d\n", peakIdx, Nps,
i);
535 XLAL_PRINT_INFO(
"Stas: we have found maximum of amplitude %3.10f at t = %3.10f \n", AmpMax, tAmpMax);
543 if (*found ==0 || debugRD || debugPK){
550 REAL8 AmpDot[NpsSmall];
551 REAL8 AmpDDot[NpsSmall];
553 for (
i=1;
i<NpsSmall-2;
i++){
555 AmpDot[
i] = (Ampl[
i+1] - Ampl[
i-1])/2./
dt;
556 AmpDDot[
i] = (Ampl[
i+1] - 2.0*Ampl[
i] + Ampl[
i-1])/(
dt*
dt);
558 AmpDot[0] = AmpDot[1];
559 AmpDot[NpsSmall -2] = AmpDot[NpsSmall-3];
560 AmpDot[NpsSmall -1] = AmpDot[NpsSmall-2];
561 AmpDDot[0] = AmpDDot[1];
562 AmpDDot[NpsSmall -2] = AmpDDot[NpsSmall-3];
563 AmpDDot[NpsSmall -1] = AmpDDot[NpsSmall-2];
569 REAL8 AmpDotSmooth[NpsSmall];
571 unsigned int win = 3;
574 double norm = 1.0/(2.0*win+1.0);
576 AmpDotSmooth[win] = 0;
577 for (
i=0;
i<(2*win +1);
i++){
578 AmpDotSmooth[win] += AmpDot[
i];
580 AmpDotSmooth[win] *= norm;
581 for (
i=0;
i<win;
i++){
582 AmpDotSmooth[
i] = AmpDotSmooth[win];
585 for (
i=win+1;
i<NpsSmall-1 -win;
i++){
586 AmpDotSmooth[
i] = AmpDotSmooth[
i-1] + norm*(AmpDot[
i+win] - AmpDot[
i-win-1]);
588 for (
i=0;
i<win;
i++){
589 AmpDotSmooth[NpsSmall-win-1+
i] = AmpDotSmooth[NpsSmall-win-2];
593 REAL8 AmpDDotSmooth[NpsSmall];
594 unsigned int win2 = 100;
597 norm = 1.0/(2.0*win2+1.0);
599 AmpDDotSmooth[win2] = 0;
600 for (
i=0;
i<(2*win2 +1);
i++){
601 AmpDDotSmooth[win2] += AmpDDot[
i];
603 AmpDDotSmooth[win2] *= norm;
604 for (
i=0;
i<win2;
i++){
605 AmpDDotSmooth[
i] = AmpDDotSmooth[win2];
608 for (
i=win2+1;
i<NpsSmall-1 -win2;
i++){
609 AmpDDotSmooth[
i] = AmpDDotSmooth[
i-1] + norm*(AmpDDot[
i+win2] - AmpDDot[
i-win2-1]);
611 for (
i=0;
i<win2;
i++){
612 AmpDDotSmooth[NpsSmall-win2-1+
i] = AmpDDotSmooth[NpsSmall-win2-2];
616 if(debugPK || debugRD) {
617 out = fopen(
"DotAmpPHi.dat",
"w" );
618 for (
i=0;
i<NpsSmall - 1;
i++){
619 fprintf(out,
"%3.10f %3.10f %3.10f %3.10f %3.10f\n", tSeries[
i], AmpDot[
i], AmpDotSmooth[
i], AmpDDot[
i], AmpDDotSmooth[
i]);
624 if (debugPK || debugRD){
625 XLAL_PRINT_INFO(
"Max of Amplitude is not found, looking for min of dot{Ampl} %d \n", iMin);
627 for (
i=1;
i<NpsSmall-1-win;
i++){
628 if (AmpDotSmooth[
i] < AmpDotSmooth[
i-1] && AmpDotSmooth[
i] < AmpDotSmooth[
i+1]){
632 if (tAmp >=tMin && tAmp <= tMax && *found==0){
635 AmpMax = AmpDotSmooth[
i];
638 if (debugPK || debugRD){
644 XLAL_PRINT_INFO(
"Stas, AmplDot - dismissing time %3.10f outside limits %3.10f, %3.10f \n",
653 if (debugPK || debugRD)
654 XLAL_PRINT_INFO(
"Min of Adot is not found, looking for min of ddot{Ampl} \n");
655 for (
i=win2*2;
i<NpsSmall-1-win2;
i++){
656 if (AmpDDotSmooth[
i] < AmpDDotSmooth[
i-1] && AmpDDotSmooth[
i] < AmpDDotSmooth[
i+1]){
660 if (tAmp >=tMin && tAmp <= tMax){
663 AmpMax = AmpDDotSmooth[
i];
668 XLAL_PRINT_INFO(
"Stas, AmplDDot - dismissing time %3.10f outside limits %3.10f, %3.10f \n",
767 gsl_spline_free(spline);
769 gsl_interp_accel_free(acc);
771 return(timeHi->
data[Nps-1]);
805 unsigned int i_att = 0;
810 XLAL_PRINT_INFO(
"attach_ind = %d, t =%f, %f \n", ind_att, matchrange->
data[1], timeVec->
data[ind_att]); fflush(NULL);
812 if (signal1->
data[ind_att] == 0.0 && signal2->
data[ind_att] == 0.0){
828 dt, mass1, mass2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
834 Amp[0] = sqrt(signal1->
data[0]*signal1->
data[0] + signal2->
data[0]*signal2->
data[0]);
837 if ( i < timeVec->length){
838 if (timeVec->
data[
i-1] <= tAtt && timeVec->
data[
i] > tAtt){
846 REAL8 timemaxR = timeVec->
data[0], timemaxL = 0.;
849 UINT4 maxLidx = i_att - 1;
850 for (
i=0;
i<i_att;
i++){
853 timemaxL = timeVec->
data[
i];
856 XLAL_PRINT_INFO(
"i, timemaxL, maxL = %d %f %f\n",
i,timemaxL,maxL);fflush(NULL);
861 timemaxR = timeVec->
data[i_att];
862 REAL8 timemaxRtmp = timemaxR;
863 REAL8 maxR = Amp[i_att];
865 timemaxRtmp = timemaxRtmp +
dt;
868 timemaxR = timemaxRtmp;
870 XLAL_PRINT_INFO(
"i, timemaxR, maxR = %d %f %f\n",
i, timemaxR,maxR);fflush(NULL);
874 if ( maxLidx == i_att - 1 ) {
875 *timediff = timemaxR - timemaxL;
881 XLAL_PRINT_INFO(
" the ratio of amplitudes = %f , ampls = %f, %f \n", maxR/maxL, maxR, maxL);fflush(NULL);
882 XLAL_PRINT_INFO(
" timemaxR, timemaxL = %f %f \n", timemaxR,timemaxL);fflush(NULL);
886 if (maxR/maxL != maxR/maxL){
919 const REAL8 combSize,
920 const REAL8 tMaxOmega,
926 REAL8 timediffStore = 0.;
932 REAL8 maxDeltaT = 10.0;
933 REAL8 thrStore22L = 0., thrStore2m2L = 0., thrStore22R = 0., thrStore2m2R = 0., tLBest = *tAttach, tRBest = *tAttach;
935 REAL8 mTScaled = (retLenHi-1)*
dt/matchrange->
data[2];
936 REAL8 tMax = timeVec->
data[retLenHi - 2] - 0.5 ;
937 double hNorm2, dsignal1, dsignal2;
double omegaVec[retLenHi - 1];
941 if ( tMaxAmp < tMax) {
944 if ( tMaxOmega < tMax) {
948 if(tMax > tAtt + 5.0){
951 REAL8 eta = m1*m2/(m1+m2)/(m1+m2);
952 REAL8 chiS = 0.5*(spin1z + spin2z);
953 REAL8 chiA = 0.5*(spin1z - spin2z);
954 REAL8 chi = chiS + chiA*sqrt(fabs(1. - 4.*eta))/(1. - 2.*eta);
956 if (tMaxAmp < tMaxOmega) {
964 XLAL_PRINT_INFO(
"tmax = %f, tAtt = %f, tmaxAmp = %f, tmaxOm = %f\n", tMax, tAtt, tMaxAmp, tMaxOmega);
967 while(pass == 0 && (tAtt >= *tAttach - maxDeltaT)){
969 memset( signal1->
data, 0, signal1->
length *
sizeof( signal1->
data[0] ));
970 memset( signal2->
data, 0, signal2->
length *
sizeof( signal2->
data[0] ));
971 for (
i = 0;
i < retLenHi;
i++ )
977 matchrange->
data[0] = combSize < tAtt ? tAtt - combSize : 0;
978 matchrange->
data[1] = tAtt;
979 matchrange->
data[0] -= fmod( matchrange->
data[0],
dt/mTScaled );
980 matchrange->
data[1] -= fmod( matchrange->
data[1],
dt/mTScaled );
983 dt, m1, m2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
989 memset( signal1->
data, 0, signal1->
length *
sizeof( signal1->
data[0] ));
990 memset( signal2->
data, 0, signal2->
length *
sizeof( signal2->
data[0] ));
991 for (
i = 0;
i < retLenHi;
i++ )
999 dt, m1, m2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
1004 if (debugPK)
XLAL_PRINT_INFO(
"Quality %f\n", (*ratio22 - thr)*(*ratio22 - thr) + (*ratio2m2 - thr)*(*ratio2m2 - thr));
1007 if ( thrStore22L != 0. && thrStore2m2L != 0. ) {
1008 if ( (*ratio22 - thr)*(*ratio22 - thr) + (*ratio2m2 - thr)*(*ratio2m2 - thr) + timediff < (thrStore22L - thr)*(thrStore22L - thr) + (thrStore2m2L - thr)*(thrStore2m2L - thr) + timediffStore ) {
1009 thrStore22L = *ratio22;
1010 thrStore2m2L = *ratio2m2;
1011 timediffStore = timediff;
1013 if(debugPK)
XLAL_PRINT_INFO(
"tLBest is now %f %f %f %f\n", tLBest, *ratio22 ,*ratio2m2, (*ratio22 - thr)*(*ratio22 - thr) + (*ratio2m2 - thr)*(*ratio2m2 - thr));
1017 thrStore22L = *ratio22;
1018 thrStore2m2L = *ratio2m2;
1019 timediffStore = timediff;
1029 memset( signal1->
data, 0, signal1->
length *
sizeof( signal1->
data[0] ));
1030 memset( signal2->
data, 0, signal2->
length *
sizeof( signal2->
data[0] ));
1033 XLAL_PRINT_INFO(
"Going left, we have found better attachment point: new tAtt = %f, old = %f, ratios = %f, %f \n", tAtt, *tAttach, *ratio22, *ratio2m2);
1035 XLAL_PRINT_INFO(
"Going left did nto find the best attachment point\n");
1042 int pass_left = pass;
1043 int iBad = retLenHi - 1;
1048 while(pass == 0 && (tAtt < tMax-0.5)){
1051 memset( signal1->
data, 0, signal1->
length *
sizeof( signal1->
data[0] ));
1052 memset( signal2->
data, 0, signal2->
length *
sizeof( signal2->
data[0] ));
1053 matchrange->
data[0] = combSize < tAtt ? tAtt - combSize : 0;
1054 matchrange->
data[1] = tAtt;
1055 matchrange->
data[0] -= fmod( matchrange->
data[0],
dt/mTScaled );
1056 matchrange->
data[1] -= fmod( matchrange->
data[1],
dt/mTScaled );
1057 for (
i = 0;
i < retLenHi;
i++ )
1062 for (
i = 0;
i < retLenHi-1;
i++ )
1064 dsignal1 = (signal1->
data[
i+1] - signal1->
data[
i]);
1065 dsignal2 = (signal2->
data[
i+1] - signal2->
data[
i]);
1067 omegaVec[
i] = (-dsignal1*signal2->
data[
i] + dsignal2*signal1->
data[
i])/hNorm2;
1069 for (
i = 0;
i < retLenHi-2;
i++ )
1071 if (omegaVec[
i]*omegaVec[
i+1] < 0) {
1084 if (matchrange->
data[1] < iBad){
1086 dt, m1, m2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
1093 memset( signal1->
data, 0, signal1->
length *
sizeof( signal1->
data[0] ));
1094 memset( signal2->
data, 0, signal2->
length *
sizeof( signal2->
data[0] ));
1095 for (
i = 0;
i < retLenHi;
i++ )
1103 dt, m1, m2, spin1x, spin1y, spin1z, spin2x, spin2y, spin2z,
1108 if (debugPK)
XLAL_PRINT_INFO(
"Quality %f\n", (*ratio22 - thr)*(*ratio22 - thr) + (*ratio2m2 - thr)*(*ratio2m2 - thr));
1112 if ( thrStore22R != 0. && thrStore2m2R != 0. ) {
1113 if ( tRBest < timeVec->
data[iBad] && (*ratio22 - thr)*(*ratio22 - thr) + (*ratio2m2 - thr)*(*ratio2m2 - thr) + timediff < (thrStore22R - thr)*(thrStore22R - thr) + (thrStore2m2R - thr)*(thrStore2m2R - thr) + timediffStore ) {
1114 thrStore22R = *ratio22;
1115 thrStore2m2R = *ratio2m2;
1116 timediffStore = timediff;
1118 if(debugPK)
XLAL_PRINT_INFO(
"tRBest is now %f %f %f %f\n", tRBest, *ratio22 , *ratio2m2, (*ratio22 - thr)*(*ratio22 - thr) + (*ratio2m2 - thr)*(*ratio2m2 - thr));
1122 thrStore22R = *ratio22;
1123 thrStore2m2R = *ratio2m2;
1124 timediffStore = timediff;
1137 XLAL_PRINT_INFO(
"Going right, we have found better attachment point: new tAtt = %f, old = %f, ratios = %f, %f \n", tAtt, *tAttach, *ratio22, *ratio2m2);
1139 XLAL_PRINT_INFO(
"Going right did nto find the best attachment point\n");
1143 int pass_right = pass;
1145 if (1==1 || (pass_right == 0 && pass_left == 0) ) {
1147 XLAL_PRINT_INFO(
"Cannot go below required threshold on RD/insp amplitude\n");
1149 if ( (thrStore22L - thr)*(thrStore22L - thr) + (thrStore2m2L - thr)*(thrStore2m2L - thr) < (thrStore22R - thr)*(thrStore22R - thr) + (thrStore2m2R - thr)*(thrStore2m2R - thr)) {
double XLALSimLocateAmplTime(REAL8Vector *timeHi, COMPLEX16Vector *hP22, REAL8Vector *radiusVec, int *found, REAL8 *tMaxAmp)
int XLALSimAdjustRDattachmentTime(REAL8Vector *signal1, REAL8Vector *signal2, COMPLEX16TimeSeries *h22, COMPLEX16TimeSeries *h2m2, REAL8 *ratio22, REAL8 *ratio2m2, REAL8 *tAttach, const REAL8 thr, const REAL8 dt, const REAL8 m1, const REAL8 m2, const REAL8 spin1x, const REAL8 spin1y, const REAL8 spin1z, const REAL8 spin2x, const REAL8 spin2y, const REAL8 spin2z, REAL8Vector *timeVec, REAL8Vector *matchrange, Approximant approximant, const REAL8 JLN, const REAL8 combSize, const REAL8 tMaxOmega, const REAL8 tMaxAmp)
double XLALSimLocateMaxAmplTime(REAL8Vector *timeHi, COMPLEX16Vector *hP22, int *found)
double XLALSimLocateOmegaTime(REAL8Array *dynamicsHi, unsigned int numdynvars, unsigned int retLenHi, SpinEOBParams seobParams, SpinEOBHCoeffs seobCoeffs, REAL8 m1, REAL8 m2, REAL8Vector *radiusVec, int *found, REAL8 *tMaxOmega, INT4 use_optimized)
INT4 XLALSimCheckRDattachment(REAL8Vector *signal1, REAL8Vector *signal2, REAL8 *ratio, const REAL8 tAtt, const INT4 l, const INT4 m, const REAL8 dt, const REAL8 mass1, const REAL8 mass2, const REAL8 spin1x, const REAL8 spin1y, const REAL8 spin1z, const REAL8 spin2x, const REAL8 spin2y, const REAL8 spin2z, REAL8Vector *timeVec, REAL8Vector *matchrange, Approximant approximant, const REAL8 JLN, REAL8 *timediff)
static UNUSED INT4 XLALSimIMREOBHybridAttachRingdownPrec(REAL8Vector *signal1, REAL8Vector *signal2, const INT4 l, const INT4 m, const REAL8 dt, const REAL8 mass1, const REAL8 mass2, const REAL8 spin1x, const REAL8 spin1y, const REAL8 spin1z, const REAL8 spin2x, const REAL8 spin2y, const REAL8 spin2z, REAL8Vector *timeVec, REAL8Vector *matchrange, Approximant approximant, const REAL8 JLN)
The main workhorse function for performing the ringdown attachment for EOB models EOBNRv2 and SEOBNRv...
static int XLALSimIMRSpinEOBCalculateSigmaKerr(REAL8Vector *sigmaKerr, REAL8 mass1, REAL8 mass2, REAL8Vector *s1, REAL8Vector *s2)
Function to calculate normalized spin of the deformed-Kerr background in SEOBNRv1.
static int XLALSimIMRSpinEOBCalculateSigmaStar(REAL8Vector *sigmaStar, REAL8 mass1, REAL8 mass2, REAL8Vector *s1, REAL8Vector *s2)
Function to calculate normalized spin of the test particle in SEOBNRv1.
static REAL8 * cross_product(const REAL8 values1[], const REAL8 values2[], REAL8 result[])
static int XLALSpinPrecHcapRvecDerivative(double UNUSED t, const REAL8 values[], REAL8 dvalues[], void *funcParams)
Function to calculate numerical derivatives of the spin EOB Hamiltonian, to get , as decribed in Eqs.
static REAL8 inner_product(const REAL8 values1[], const REAL8 values2[])
Functions to compute the inner product and cross products between vectors.
static int XLALSpinPrecHcapRvecDerivative_exact(double UNUSED t, const REAL8 values[], REAL8 dvalues[], void *funcParams)
Function to calculate exact derivatives of the spin EOB Hamiltonian, to get , as decribed in Eqs.
#define XLAL_INIT_DECL(var,...)
Approximant
Enum that specifies the PN approximant to be used in computing the waveform.
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
#define XLAL_PRINT_INFO(...)
#define XLAL_CHECK_ABORT(assertion)
Parameters for the spinning EOB model, used in calculating the Hamiltonian.
Parameters for the spinning EOB model.