25 #define UNUSED __attribute__ ((unused))
41 #include <gsl/gsl_errno.h>
42 #include <gsl/gsl_bspline.h>
43 #include <gsl/gsl_blas.h>
44 #include <gsl/gsl_min.h>
45 #include <gsl/gsl_spline.h>
46 #include <gsl/gsl_poly.h>
47 #include <lal/Units.h>
48 #include <lal/SeqFactories.h>
49 #include <lal/LALConstants.h>
50 #include <lal/XLALError.h>
51 #include <lal/FrequencySeries.h>
53 #include <lal/StringInput.h>
54 #include <lal/Sequence.h>
55 #include <lal/LALStdio.h>
56 #include <lal/FileIO.h>
57 #include <lal/LALSimSphHarmMode.h>
58 #include <lal/LALDatatypes.h>
59 #include <lal/LALSimInspiral.h>
60 #include <lal/AVFactories.h>
61 #include <lal/SphericalHarmonics.h>
65 #define f_hyb_ini 0.003
66 #define f_hyb_end 0.004
68 #ifdef LAL_HDF5_ENABLED
69 #include <lal/H5FileIO.h>
70 static const char ROMDataHDF5[] =
"SEOBNRv5HMROM_v1.0.hdf5";
71 static const INT4 ROMDataHDF5_VERSION_MAJOR = 1;
72 static const INT4 ROMDataHDF5_VERSION_MINOR = 0;
73 static const INT4 ROMDataHDF5_VERSION_MICRO = 0;
74 static const char ROM22DataHDF5[] =
"SEOBNRv5ROM_v1.0.hdf5";
75 static const INT4 ROM22DataHDF5_VERSION_MAJOR = 1;
76 static const INT4 ROM22DataHDF5_VERSION_MINOR = 0;
77 static const INT4 ROM22DataHDF5_VERSION_MICRO = 0;
80 #include <lal/LALSimInspiral.h>
81 #include <lal/LALSimIMR.h>
85 #include <lal/LALConfig.h>
86 #ifdef LAL_PTHREAD_LOCK
92 #ifdef LAL_PTHREAD_LOCK
93 static pthread_once_t SEOBNRv5HMROM_is_initialized = PTHREAD_ONCE_INIT;
94 static pthread_once_t SEOBNRv5ROM_is_initialized = PTHREAD_ONCE_INIT;
109 const UINT4 lmModes_v5hm[
NMODES][2] = {{2, 2}, {3, 3}, {2, 1}, {4, 4}, {5, 5}, {3, 2}, {4, 3}};
128 #define Mf_low_22 0.0004925491025543576
129 #define Mf_low_33 (Mf_low_22 * (3.0/2.0))
130 #define Mf_low_21 (Mf_low_22 * (1.0/2.0))
131 #define Mf_low_44 (Mf_low_22 * (4.0/2.0))
132 #define Mf_low_55 (Mf_low_22 * (5.0/2.0))
133 #define Mf_low_32 (Mf_low_22)
134 #define Mf_low_43 (Mf_low_22 * (3.0/2.0))
139 typedef struct tagSEOBNRROMdataDS_coeff
172 SEOBNRROMdataDS_submodel*
lowf;
179 typedef int (*
load_dataPtr)(
const char*, gsl_vector *, gsl_vector *, gsl_matrix *, gsl_matrix *, gsl_vector *);
181 typedef struct tagSplineData
183 gsl_bspline_workspace *bwx;
184 gsl_bspline_workspace *bwy;
185 gsl_bspline_workspace *bwz;
188 typedef struct tagAmpPhaseSplineData
190 gsl_spline *spline_amp;
191 gsl_spline *spline_phi;
192 gsl_interp_accel *acc_amp;
193 gsl_interp_accel *acc_phi;
207 UNUSED SEOBNRROMdataDS_submodel **submodel,
208 UNUSED
const char dir[],
209 UNUSED
const char grp_name[],
210 UNUSED
UINT4 index_mode,
221 const double *chi1vec,
222 const double *chi2vec
252 UNUSED
static double GetModeAmpFactor(
double eta,
double delta,
double chi1,
double chi2,
int l,
int m,
double v);
284 REAL8 sign_odd_modes,
285 SEOBNRROMdataDS *romdataset
290 static size_t NextPow2(
const size_t n);
316 const double *chi1vec,
317 const double *chi2vec,
324 UNUSED
static UINT8 SEOBNRv5HMROM_cmode_sparse_grid_hybrid(gsl_vector* freq, gsl_vector* cmode_real, gsl_vector* cmode_imag, gsl_vector* freq_lo, gsl_vector* freq_hi,
REAL8 q,
REAL8 chi1,
REAL8 chi2,
UINT8 nMode,
INT8 nk_max,SEOBNRROMdataDS *romdataset);
333 REAL8* Deltaphi_align,
334 gsl_vector *phase_lo,
335 gsl_vector *phase_hi,
345 gsl_vector *phase_lo,
346 gsl_vector *phase_hi,
351 REAL8 Deltat_22_align,
352 REAL8 Deltaphi_22_align,
368 gsl_spline **hyb_spline,
377 gsl_spline **hyb_spline,
379 REAL8* Deltaphi_align,
382 gsl_vector *PN_phase,
388 gsl_spline **hyb_spline,
391 gsl_vector *PN_phase,
394 REAL8 Deltat_22_align,
395 REAL8 Deltaphi_22_align,
406 UNUSED SEOBNRROMdataDS *romdataset
413 UNUSED
REAL8 distance,
414 UNUSED
REAL8 Mtot_sec,
423 REAL8 sign_odd_modes,
424 UNUSED SEOBNRROMdataDS *romdataset
428 gsl_spline **spline_phi,
429 gsl_interp_accel **acc_phi,
450 *
x = gsl_vector_alloc(
s->size);
451 *
y = gsl_vector_alloc(
s->size);
452 for (
size_t i=0;
i <
s->size;
i++) {
453 gsl_vector_set(*
x,
i,
s->x[
i]);
454 gsl_vector_set(*
y,
i,
s->y[
i]);
471 #ifdef LAL_HDF5_ENABLED
472 #define datafile ROMDataHDF5
477 char *dir = dirname(
path);
485 files in $LAL_DATA_PATH for the mode = %d\n",
i);
498 for(
int i = 0;
i < 1;
i++) {
503 #ifdef LAL_HDF5_ENABLED
504 #define datafile22 ROM22DataHDF5
509 char *dir = dirname(
path);
513 for(
int i = 0;
i < 1;
i++) {
517 files in $LAL_DATA_PATH for the mode = %d\n",
i);
527 if(romdataset[index_mode].setup){
542 const double *chi1vec,
543 const double *chi2vec
546 if(!splinedata) exit(1);
552 const size_t nbreak_x = ncx-2;
553 const size_t nbreak_y = ncy-2;
554 const size_t nbreak_z = ncz-2;
557 gsl_bspline_workspace *bwx = gsl_bspline_alloc(4, nbreak_x);
558 gsl_bspline_workspace *bwy = gsl_bspline_alloc(4, nbreak_y);
559 gsl_bspline_workspace *bwz = gsl_bspline_alloc(4, nbreak_z);
562 gsl_vector *breakpts_x = gsl_vector_alloc(nbreak_x);
563 gsl_vector *breakpts_y = gsl_vector_alloc(nbreak_y);
564 gsl_vector *breakpts_z = gsl_vector_alloc(nbreak_z);
566 gsl_vector_set(breakpts_x,
i, qvec[
i]);
567 for (
UINT4 j=0; j<nbreak_y; j++)
568 gsl_vector_set(breakpts_y, j, chi1vec[j]);
569 for (
UINT4 k=0; k<nbreak_z; k++)
570 gsl_vector_set(breakpts_z, k, chi2vec[k]);
572 gsl_bspline_knots(breakpts_x, bwx);
573 gsl_bspline_knots(breakpts_y, bwy);
574 gsl_bspline_knots(breakpts_z, bwz);
576 gsl_vector_free(breakpts_x);
577 gsl_vector_free(breakpts_y);
578 gsl_vector_free(breakpts_z);
580 (*splinedata)->bwx=bwx;
581 (*splinedata)->bwy=bwy;
582 (*splinedata)->bwz=bwz;
588 if(!splinedata)
return;
589 if(splinedata->
bwx) gsl_bspline_free(splinedata->
bwx);
590 if(splinedata->
bwy) gsl_bspline_free(splinedata->
bwy);
591 if(splinedata->
bwz) gsl_bspline_free(splinedata->
bwz);
605 for (
int i=0;
i<num_modes;
i++) {
613 if(!data_array)
return;
616 for (
int i=0;
i<num_modes;
i++) {
617 data = data_array[
i];
621 if (
data->spline_amp) gsl_spline_free(
data->spline_amp);
622 if (
data->spline_phi) gsl_spline_free(
data->spline_phi);
623 if (
data->acc_amp) gsl_interp_accel_free(
data->acc_amp);
624 if (
data->acc_phi) gsl_interp_accel_free(
data->acc_phi);
625 if (
data->f) gsl_vector_free(
data->f);
646 const double *chi1vec,
647 const double *chi2vec,
652 XLAL_ERROR(
XLAL_EDOM,
"Truncation parameter nk_max %d must be smaller or equal to nk %d\n", nk_max, nk);
661 gsl_bspline_workspace *bwx=splinedata->
bwx;
662 gsl_bspline_workspace *bwy=splinedata->
bwy;
663 gsl_bspline_workspace *bwz=splinedata->
bwz;
667 for (
int k=0; k<nk; k++) {
668 gsl_vector v = gsl_vector_subvector(cvec, k*
N,
N).vector;
670 gsl_vector_set(c_out, k, csum);
680 if(romdataset[index_mode].setup) {
686 if(romdataset[index_mode].setup) {
697 UNUSED SEOBNRROMdataDS *romdata,
698 UNUSED
const char dir[],
699 UNUSED
UINT4 index_mode,
707 XLALPrintError(
"WARNING: You tried to setup the SEOBNRv5HMROM model that was already initialised. Ignoring\n");
711 #ifdef LAL_HDF5_ENABLED
715 size = strlen(dir) + strlen(ROMDataHDF5) + 2;
718 size = strlen(dir) + strlen(ROM22DataHDF5) + 2;
722 snprintf(
path, size,
"%s/%s", dir, ROMDataHDF5);
725 snprintf(
path, size,
"%s/%s", dir, ROM22DataHDF5);
731 PrintInfoStringAttribute(
file,
"Email");
732 PrintInfoStringAttribute(
file,
"Description");
733 ret = ROM_check_version_number(
file, ROMDataHDF5_VERSION_MAJOR,
734 ROMDataHDF5_VERSION_MINOR,
735 ROMDataHDF5_VERSION_MICRO);
736 ret = ROM_check_canonical_file_basename(
file,ROMDataHDF5,
"CANONICAL_FILE_BASENAME");
739 PrintInfoStringAttribute(
file,
"Email");
740 PrintInfoStringAttribute(
file,
"Description");
741 ret = ROM_check_version_number(
file, ROM22DataHDF5_VERSION_MAJOR,
742 ROM22DataHDF5_VERSION_MINOR,
743 ROM22DataHDF5_VERSION_MICRO);
744 ret = ROM_check_canonical_file_basename(
file,ROM22DataHDF5,
"CANONICAL_FILE_BASENAME");
775 (romdata)->highf = NULL;
778 (romdata)->lowf = NULL;
784 if(submodel->cvec_real) gsl_vector_free(submodel->cvec_real);
785 if(submodel->cvec_imag) gsl_vector_free(submodel->cvec_imag);
786 if(submodel->cvec_phase) gsl_vector_free(submodel->cvec_phase);
787 if(submodel->Breal) gsl_matrix_free(submodel->Breal);
788 if(submodel->Bimag) gsl_matrix_free(submodel->Bimag);
789 if(submodel->Bphase) gsl_matrix_free(submodel->Bphase);
790 if(submodel->gCMode) gsl_vector_free(submodel->gCMode);
791 if(submodel->gPhase) gsl_vector_free(submodel->gPhase);
792 if(submodel->qvec) gsl_vector_free(submodel->qvec);
793 if(submodel->chi1vec) gsl_vector_free(submodel->chi1vec);
794 if(submodel->chi2vec) gsl_vector_free(submodel->chi2vec);
799 SEOBNRROMdataDS_submodel **submodel,
800 UNUSED
const char dir[],
801 UNUSED
const char grp_name[],
802 UNUSED
UINT4 index_mode,
806 if(!submodel) exit(1);
809 *submodel =
XLALCalloc(1,
sizeof(SEOBNRROMdataDS_submodel));
813 #ifdef LAL_HDF5_ENABLED
816 size = strlen(dir) + strlen(ROMDataHDF5) + 2;
819 size = strlen(dir) + strlen(ROM22DataHDF5) + 2;
823 snprintf(
path, size,
"%s/%s", dir, ROMDataHDF5);
826 snprintf(
path, size,
"%s/%s", dir, ROM22DataHDF5);
836 ReadHDF5RealVectorDataset(sub, path_to_dataset, & (*submodel)->cvec_real);
837 free(path_to_dataset);
839 ReadHDF5RealVectorDataset(sub, path_to_dataset, & (*submodel)->cvec_imag);
840 free(path_to_dataset);
844 ReadHDF5RealVectorDataset(sub,
"phase_carrier/coeff_flattened", & (*submodel)->cvec_phase);
852 ReadHDF5RealMatrixDataset(sub, path_to_dataset, & (*submodel)->Breal);
853 free(path_to_dataset);
855 ReadHDF5RealMatrixDataset(sub, path_to_dataset, & (*submodel)->Bimag);
856 free(path_to_dataset);
860 ReadHDF5RealMatrixDataset(sub,
"phase_carrier/basis", & (*submodel)->Bphase);
866 ReadHDF5RealVectorDataset(sub, path_to_dataset, & (*submodel)->gCMode);
867 free(path_to_dataset);
871 ReadHDF5RealVectorDataset(sub,
"phase_carrier/MF_grid", & (*submodel)->gPhase);
874 ReadHDF5RealVectorDataset(sub,
"qvec", & (*submodel)->qvec);
875 ReadHDF5RealVectorDataset(sub,
"chi1vec", & (*submodel)->chi1vec);
876 ReadHDF5RealVectorDataset(sub,
"chi2vec", & (*submodel)->chi2vec);
880 (*submodel)->nk_cmode = (*submodel)->gCMode->size;
883 (*submodel)->nk_phase = (*submodel)->gPhase->size;
885 (*submodel)->ncx = (*submodel)->qvec->size + 2;
886 (*submodel)->ncy = (*submodel)->chi1vec->size + 2;
887 (*submodel)->ncz = (*submodel)->chi2vec->size + 2;
890 (*submodel)->q_bounds[0] = gsl_vector_get((*submodel)->qvec, 0);
891 (*submodel)->q_bounds[1] = gsl_vector_get((*submodel)->qvec, (*submodel)->qvec->size - 1);
892 (*submodel)->chi1_bounds[0] = gsl_vector_get((*submodel)->chi1vec, 0);
893 (*submodel)->chi1_bounds[1] = gsl_vector_get((*submodel)->chi1vec, (*submodel)->chi1vec->size - 1);
894 (*submodel)->chi2_bounds[0] = gsl_vector_get((*submodel)->chi2vec, 0);
895 (*submodel)->chi2_bounds[1] = gsl_vector_get((*submodel)->chi2vec, (*submodel)->chi2vec->size - 1);
910 if(!romdatacoeff) exit(1);
917 (*romdatacoeff)->c_real = gsl_vector_alloc(nk_cmode);
918 (*romdatacoeff)->c_imag = gsl_vector_alloc(nk_cmode);
919 (*romdatacoeff)->c_phase = gsl_vector_alloc(nk_phase);
924 if(romdatacoeff->
c_real) gsl_vector_free(romdatacoeff->
c_real);
925 if(romdatacoeff->
c_imag) gsl_vector_free(romdatacoeff->
c_imag);
932 return 1 << (size_t) ceil(log2(n));
937 gsl_vector *phase_f_lo = gsl_vector_alloc(freq_lo->size);
938 gsl_vector *phase_f_hi = gsl_vector_alloc(freq_hi->size);
954 gsl_vector_free(phase_f_lo);
955 gsl_vector_free(phase_f_hi);
967 SEOBNRROMdataDS *romdata=&romdataset[0];
970 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
973 UNUSED
UINT4 retcode=0;
976 SEOBNRROMdataDS_submodel *submodel_hi;
977 SEOBNRROMdataDS_submodel *submodel_lo;
981 submodel_lo = romdata->lowf;
983 submodel_hi = romdata->highf;
991 gsl_vector* freq_lo = gsl_vector_alloc(submodel_lo->nk_phase);
992 for(
unsigned int i = 0;
i < freq_lo->size;
i++){
993 freq_lo->data[
i] = submodel_lo->gPhase->data[
i];
995 gsl_vector* freq_hi = gsl_vector_alloc(submodel_hi->nk_phase);
1002 for(
unsigned int i = 0;
i < freq_hi->size;
i++){
1003 freq_hi->data[
i] = inv_scaling*submodel_hi->gPhase->data[
i];
1009 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1012 *phase = gsl_vector_calloc((*freq)->size);
1015 for(
unsigned int i = 0;
i <= i_max_LF;
i++){
1016 (*freq)->data[
i] = freq_lo->data[
i];
1018 for(
unsigned int i = i_min_HF;
i < freq_hi->size;
i++){
1019 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1027 gsl_vector_free(freq_lo);
1028 gsl_vector_free(freq_hi);
1040 REAL8* Deltat_align,
1041 REAL8* Deltaphi_align,
1042 gsl_vector *phase_lo,
1043 gsl_vector *phase_hi,
1044 gsl_vector *freq_lo,
1045 gsl_vector *freq_hi,
1061 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1064 for(
unsigned int i=0;
i <= i_max_LF;
i++)
1065 (*freq)->data[
i] = freq_lo->data[
i];
1066 for(
unsigned int i=i_min_HF; i < freq_hi->size;
i++)
1067 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1070 *phase = gsl_vector_calloc((*freq)->size);
1075 REAL8 Deltaphi = 0.;
1076 retcode =
align_wfs_window(freq_lo, freq_hi, phase_lo, phase_hi, &Deltat, &Deltaphi, f_hyb_lo, f_hyb_hi);
1080 retcode =
blend_functions(*freq, *phase, freq_lo, phase_lo, freq_hi, phase_hi, f_hyb_lo, f_hyb_hi);
1086 *Deltat_align = Deltat;
1087 *Deltaphi_align = Deltaphi;
1096 gsl_vector *phase_lo,
1097 gsl_vector *phase_hi,
1098 gsl_vector *freq_lo,
1099 gsl_vector *freq_hi,
1102 REAL8 Deltat_22_align,
1103 REAL8 Deltaphi_22_align,
1118 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1121 for(
unsigned int i=0;
i <= i_max_LF;
i++)
1122 (*freq)->data[
i] = freq_lo->data[
i];
1123 for(
unsigned int i=i_min_HF; i < freq_hi->size;
i++)
1124 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1127 *phase = gsl_vector_calloc((*freq)->size);
1130 retcode =
align_wfs_window_from_22(freq_lo, freq_hi, phase_lo, phase_hi, f_hyb_lo, f_hyb_hi, Deltat_22_align, Deltaphi_22_align, modeM);
1134 retcode =
blend_functions(*freq, *phase, freq_lo, phase_lo, freq_hi, phase_hi, f_hyb_lo, f_hyb_hi);
1146 gsl_vector *freq_lo,
1147 gsl_vector *freq_hi,
1162 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1165 for(
unsigned int i=0;
i <= i_max_LF;
i++)
1166 (*freq)->data[
i] = freq_lo->data[
i];
1167 for(
unsigned int i=i_min_HF; i < freq_hi->size;
i++)
1168 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1171 *amp = gsl_vector_calloc((*freq)->size);
1174 retcode =
blend_functions(*freq, *amp, freq_lo, amp_lo, freq_hi, amp_hi, f_hyb_lo, f_hyb_hi);
1189 REAL8 f_max_carrier = freq_carrier_hyb->data[freq_carrier_hyb->size -1];
1190 REAL8 phase_carrier_at_f_max = phase_carrier_hyb->data[phase_carrier_hyb->size -1];
1192 gsl_interp_accel *acc = gsl_interp_accel_alloc ();
1193 gsl_spline *spline = gsl_spline_alloc (gsl_interp_cspline, phase_carrier_hyb->size);
1195 gsl_spline_init (spline, freq_carrier_hyb->data, phase_carrier_hyb->data, phase_carrier_hyb->size);
1196 REAL8 der_phase_carrier_at_f_max = gsl_spline_eval_deriv(spline, f_max_carrier, acc);
1201 for(
unsigned int i = 0;
i < freq_mode_lm->size;
i++){
1202 if(freq_mode_lm->data[
i]/(
REAL8)modeM < f_max_carrier){
1204 phase_approx_lm->data[
i] = (
REAL8)modeM*gsl_spline_eval (spline, freq_mode_lm->data[
i]/(
REAL8)modeM, acc) + const_phase_shift;
1208 phase_approx_lm->data[
i] = modeM*(phase_carrier_at_f_max + der_phase_carrier_at_f_max*(freq_mode_lm->data[
i]/modeM-f_max_carrier)) + const_phase_shift;
1213 gsl_spline_free(spline);
1214 gsl_interp_accel_free(acc);
1221 UNUSED
static UINT8 SEOBNRv5HMROM_cmode_sparse_grid_hybrid(gsl_vector* freq, gsl_vector* cmode_real, gsl_vector* cmode_imag, gsl_vector* freq_lo, gsl_vector* freq_hi,
REAL8 q,
REAL8 chi1,
REAL8 chi2,
UINT8 nMode,
INT8 nk_max,SEOBNRROMdataDS *romdataset){
1223 gsl_vector* real_f_lo = gsl_vector_alloc(freq_lo->size);
1224 gsl_vector* imag_f_lo = gsl_vector_alloc(freq_lo->size);
1225 gsl_vector* real_f_hi = gsl_vector_alloc(freq_hi->size);
1226 gsl_vector* imag_f_hi = gsl_vector_alloc(freq_hi->size);
1239 gsl_vector_free(real_f_lo);
1240 gsl_vector_free(imag_f_lo);
1241 gsl_vector_free(real_f_hi);
1242 gsl_vector_free(imag_f_hi);
1255 SEOBNRROMdataDS *romdata=&romdataset[nMode];
1258 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
1261 UNUSED
UINT4 retcode=0;
1264 SEOBNRROMdataDS_submodel *submodel_hi;
1265 SEOBNRROMdataDS_submodel *submodel_lo;
1269 submodel_lo = romdata->lowf;
1271 submodel_hi = romdata->highf;
1279 gsl_vector* freq_lo = gsl_vector_alloc(submodel_lo->nk_cmode);
1280 gsl_vector* freq_hi = gsl_vector_alloc(submodel_hi->nk_cmode);
1282 for(
unsigned int i = 0;
i < freq_lo->size;
i++){
1283 freq_lo->data[
i] = submodel_lo->gCMode->data[
i];
1290 for(
unsigned int i = 0;
i < freq_hi->size;
i++){
1291 freq_hi->data[
i] = inv_scaling*submodel_hi->gCMode->data[
i];
1298 *freq_cmode = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1301 for(
unsigned int i = 0;
i <= i_max_LF;
i++){
1302 (*freq_cmode)->data[
i] = freq_lo->data[
i];
1304 for(
unsigned int i = i_min_HF;
i < freq_hi->size;
i++){
1305 (*freq_cmode)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1308 *cmode_real = gsl_vector_calloc((*freq_cmode)->size);
1309 *cmode_imag = gsl_vector_calloc((*freq_cmode)->size);
1314 retcode =
SEOBNRv5HMROM_cmode_sparse_grid_hybrid(*freq_cmode,*cmode_real,*cmode_imag,freq_lo, freq_hi,
q,chi1,chi2,nMode,nk_max,romdataset);
1318 gsl_vector_free(freq_lo);
1319 gsl_vector_free(freq_hi);
1330 SEOBNRROMdataDS *romdata=&romdataset[0];
1333 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
1336 SEOBNRROMdataDS_submodel *submodel;
1337 if(strcmp(
"LF",freq_range) == 0){
1339 submodel = romdata->lowf;
1342 submodel = romdata->highf;
1353 submodel->cvec_phase,
1359 gsl_vector_const_ptr(submodel->qvec, 0),
1360 gsl_vector_const_ptr(submodel->chi1vec, 0),
1361 gsl_vector_const_ptr(submodel->chi2vec, 0),
1372 gsl_blas_dgemv(CblasTrans, 1.0, submodel->Bphase, romdata_coeff->
c_phase, 0.0, phase_f);
1384 SEOBNRROMdataDS *romdata=&romdataset[nMode];
1387 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
1390 SEOBNRROMdataDS_submodel *submodel;
1391 if(strcmp(
"LF",freq_range) == 0){
1393 submodel = romdata->lowf;
1397 submodel = romdata->highf;
1408 submodel->cvec_real,
1414 gsl_vector_const_ptr(submodel->qvec, 0),
1415 gsl_vector_const_ptr(submodel->chi1vec, 0),
1416 gsl_vector_const_ptr(submodel->chi2vec, 0),
1425 submodel->cvec_imag,
1431 gsl_vector_const_ptr(submodel->qvec, 0),
1432 gsl_vector_const_ptr(submodel->chi1vec, 0),
1433 gsl_vector_const_ptr(submodel->chi2vec, 0),
1445 gsl_blas_dgemv(CblasTrans, 1.0, submodel->Breal, romdata_coeff->
c_real, 0.0, creal_f);
1446 gsl_blas_dgemv(CblasTrans, 1.0, submodel->Bimag, romdata_coeff->
c_imag, 0.0, cimag_f);
1457 if ((
q> 3.) && (chi1<=0.8)){
1460 else if ((
q> 3.) && (chi1>0.8)){
1463 else if ((
q<= 3.) && (chi1<=0.8)){
1466 else if ((
q<= 3.) && (chi1>0.8)){
1471 XLALPrintError(
"XLAL Error - %s: SEOBNRv5HM not currently available in this region!\n",
1485 UNUSED SEOBNRROMdataDS *romdataset
1489 if(!ampPhaseSplineData)
1494 if (
q > 100.0)
nudge(&
q, 100.0, 1
e-6);
1496 if ( chi1 < -0.998 - 1
e-6 || chi2 < -0.998 - 1e-6 || chi1 > 0.998 + 1
e-6|| chi2 > 0.998 + 1
e-6) {
1497 XLALPrintError(
"XLAL Error - %s: chi1 or chi2 smaller than -0.998 or larger than 0.998!\n"
1498 "SEOBNRv5HMROM is only available for spins in the range -0.998 <= a/M <= 0.998.\n",
1503 if (q<1.0 || q > 100.0) {
1504 XLALPrintError(
"XLAL Error - %s: q (%f) bigger than 100.0 or unphysical!\n"
1505 "SEOBNRv5HMROM is only available for q in the range 1 <= q <= 100.\n",
1510 gsl_vector *freq_carrier_hyb = NULL;
1511 gsl_vector *phase_carrier_hyb = NULL;
1516 &freq_carrier_hyb, &phase_carrier_hyb,
q, chi1, chi2, nk_max,romdataset);
1520 for(
unsigned int i=0;
i < phase_carrier_hyb->size;
i++) {
1521 phase_carrier_hyb->data[
i] = -phase_carrier_hyb->data[
i];
1525 for(
unsigned int nMode=0; nMode <
nModes; nMode++){
1527 gsl_vector *freq_cmode_hyb = NULL;
1528 gsl_vector *cmode_real_hyb = NULL;
1529 gsl_vector *cmode_imag_hyb = NULL;
1536 &freq_cmode_hyb, &cmode_real_hyb, &cmode_imag_hyb,
1537 q, chi1, chi2, nMode, nk_max, romdataset);
1539 gsl_vector *phase_approx_lm = gsl_vector_alloc(freq_cmode_hyb->size);
1542 freq_carrier_hyb, phase_carrier_hyb, nMode);
1546 gsl_vector *phase_cmode = gsl_vector_alloc(freq_cmode_hyb->size);
1547 for(
unsigned int i=0;
i < freq_cmode_hyb->size;
i++) {
1548 complex_mode = cmode_real_hyb->data[
i] + I*cmode_imag_hyb->data[
i];
1549 phase_cmode->data[
i] = carg(complex_mode);
1553 gsl_vector *unwrapped_phase_cmode = gsl_vector_alloc(freq_cmode_hyb->size);
1554 retcode =
unwrap_phase(unwrapped_phase_cmode,phase_cmode);
1557 gsl_vector *reconstructed_phase = gsl_vector_alloc(freq_cmode_hyb->size);
1558 gsl_vector *reconstructed_amplitude = gsl_vector_alloc(freq_cmode_hyb->size);
1559 for(
unsigned int i=0;
i < freq_cmode_hyb->size;
i++) {
1560 complex_mode = cmode_real_hyb->data[
i] + I*cmode_imag_hyb->data[
i];
1561 reconstructed_amplitude->data[
i] = cabs(complex_mode);
1562 reconstructed_phase->data[
i] = unwrapped_phase_cmode->data[
i] - phase_approx_lm->data[
i];
1566 gsl_interp_accel *acc_amp = gsl_interp_accel_alloc();
1567 gsl_spline *spline_amp = gsl_spline_alloc (gsl_interp_cspline, reconstructed_amplitude->size);
1568 gsl_spline_init(spline_amp, freq_cmode_hyb->data, reconstructed_amplitude->data, reconstructed_amplitude->size);
1570 gsl_interp_accel *acc_phase = gsl_interp_accel_alloc();
1571 gsl_spline *spline_phase = gsl_spline_alloc (gsl_interp_cspline, reconstructed_phase->size);
1572 gsl_spline_init(spline_phase, freq_cmode_hyb->data, reconstructed_phase->data, reconstructed_phase->size);
1576 ampPhaseSplineData[nMode]->spline_amp = spline_amp;
1577 ampPhaseSplineData[nMode]->spline_phi = spline_phase;
1578 ampPhaseSplineData[nMode]->acc_amp = acc_amp;
1579 ampPhaseSplineData[nMode]->acc_phi = acc_phase;
1580 ampPhaseSplineData[nMode]->f = freq_cmode_hyb;
1583 gsl_vector_free(cmode_real_hyb);
1584 gsl_vector_free(cmode_imag_hyb);
1585 gsl_vector_free(phase_approx_lm);
1586 gsl_vector_free(phase_cmode);
1587 gsl_vector_free(unwrapped_phase_cmode);
1588 gsl_vector_free(reconstructed_amplitude);
1589 gsl_vector_free(reconstructed_phase);
1593 gsl_vector_free(freq_carrier_hyb);
1594 gsl_vector_free(phase_carrier_hyb);
1607 UNUSED
REAL8 phiRef,
1609 UNUSED
REAL8 distance,
1610 UNUSED
REAL8 Mtot_sec,
1615 UNUSED
REAL8 deltaF,
1619 REAL8 sign_odd_modes,
1620 UNUSED SEOBNRROMdataDS *romdataset
1629 if (
q > 100.0)
nudge(&
q, 100.0, 1
e-6);
1631 if ( chi1 < -0.998 || chi2 < -0.998 || chi1 > 0.998 || chi2 > 0.998) {
1632 XLALPrintError(
"XLAL Error - %s: chi1 or chi2 smaller than -0.998 or larger than 0.998!\n"
1633 "SEOBNRv5HMROM is only available for spins in the range -0.998 <= a/M <= 0.998.\n",
1638 if (q<1.0 || q > 100.0) {
1639 XLALPrintError(
"XLAL Error - %s: q (%f) bigger than 100.0 or unphysical!\n"
1640 "SEOBNRv5HMROM is only available for q in the range 1 <= q <= 100.\n",
1650 ampPhaseSplineData,
q, chi1, chi2, nk_max,
nModes,romdataset);
1656 REAL8 fLow = freqs_in->data[0];
1657 REAL8 fHigh = freqs_in->data[freqs_in->length - 1];
1659 UNUSED
REAL8 fLow_geom = fLow * Mtot_sec;
1660 REAL8 fHigh_geom = fHigh * Mtot_sec;
1661 REAL8 deltaF_geom = deltaF * Mtot_sec;
1666 if (fHigh_geom == 0)
1672 if (fHigh_geom <= fLow_geom)
1673 XLAL_ERROR(
XLAL_EDOM,
"End frequency %g is smaller than (or equal to) starting frequency %g!\n", fHigh_geom, fLow_geom);
1676 for(
unsigned int nMode=0; nMode <
nModes; nMode++){
1687 npts =
NextPow2(fHigh_geom / deltaF_geom) + 1;
1688 if (fHigh_geom < fHigh * Mtot_sec)
1689 npts =
NextPow2(fHigh * Mtot_sec / deltaF_geom) + 1;
1697 double fHigh_temp = fHigh_geom / Mtot_sec;
1699 UINT4 iStop = (
UINT4) ceil(fHigh_temp / deltaF);
1703 freqs->
data[
i-iStart] =
i*deltaF_geom;
1722 REAL8 t_corr = 1000.;
1725 gsl_spline *spline_amp = ampPhaseSplineData[nMode]->
spline_amp;
1726 gsl_spline *spline_phase = ampPhaseSplineData[nMode]->
spline_phi;
1727 gsl_interp_accel *acc_amp = ampPhaseSplineData[nMode]->
acc_amp;
1728 gsl_interp_accel *acc_phase = ampPhaseSplineData[nMode]->
acc_phi;
1737 if (f > Mf_max_mode)
continue;
1738 if (f <=
Mf_low_22 * modeM/2.)
continue;
1740 REAL8 A = gsl_spline_eval(spline_amp, f, acc_amp);
1741 REAL8 phase = gsl_spline_eval(spline_phase, f, acc_phase);
1742 hlmdata[j] = amp0*A * (cos(phase) + I*sin(phase));
1744 COMPLEX16 t_factor = cos(phase_factor) + I*sin(phase_factor);
1745 hlmdata[j] *= t_factor;
1748 hlmdata[j] = pow(-1.,modeL)*conj(hlmdata[j]);
1752 hlmdata[j] = hlmdata[j]*sign_odd_modes;
1813 const char *model_name;
1815 model_name=
"SEOBNRv5_ROM";
1818 model_name=
"SEOBNRv5HM_ROM";
1825 for (
INT4 EMM = -ELL; EMM <= (
INT4)ELL; EMM++) {
1832 if ((modeL == ELL)&&(modeM == EMM)) {
1835 if ((modeL == ELL)&&(modeM == -EMM)) {
1841 if (flagTrue == 0) {
1842 XLALPrintError (
"Mode (%d,%d) is not available by the model %s\n", ELL,
1846 if (flagTrue == 2) {
1847 XLALPrintError (
"Mode (%d,%d) is not available by the model %s.\n"
1848 "In this function you can only select (l,-|m|) modes that are directly modeled in the ROM.\n"
1849 "The (l,+|m|) mode will be automatically added to the waveform using symmetry arguments.\n", ELL,
1871 LALValue *ModeArray,
1879 while ( hlms_temp ) {
1883 hlms_temp->
l, hlms_temp->
m, 1);
1885 hlms_temp = hlms_temp->
next;
1896 if (
l==2 &&
m==2)
return 0.;
1897 else if (
l==2 &&
m==1)
return LAL_PI/2;
1898 else if (
l==3 &&
m==3)
return -
LAL_PI/2;
1899 else if (
l==4 &&
m==4)
return LAL_PI;
1900 else if (
l==5 &&
m==5)
return LAL_PI/2;
1901 else if (
l==3 &&
m==2)
return 0;
1902 else if (
l==4 &&
m==3)
return -
LAL_PI/2;
1916 double chis = 1./2 * (chi1 + chi2);
1917 double chia = 1./2 * (chi1 - chi2);
1918 if (
l==2 &&
m==2)
return 1.;
1919 else if (
l==2 &&
m==1)
return v * (
delta/3 - 1./2*v*(chia +
delta*chis));
1920 else if (
l==3 &&
m==3)
return v * 3./4 * sqrt(15./14) *
delta;
1921 else if (
l==4 &&
m==4)
return v*v * 8*sqrt(35.)/63 * (1 - 3*eta);
1922 else if (
l==5 &&
m==5)
return v*v*v * 625*sqrt(66.)/6336 *
delta * (1 - 2*eta);
1923 else if (
l==3 &&
m==2)
return v*v * 9./8 *sqrt(5./7) * (8./27 * (-1 + 3*eta));
1924 else if (
l==4 &&
m==3)
return v*v*v * 8./9*sqrt(10./7)*81./320 *
delta * (-1 + 2*eta);
1946 gsl_vector **PNphase
1950 *PNphase = gsl_vector_alloc(Mfs->size);
1957 double m1OverM =
q / (1.0+
q);
1958 double m2OverM = 1.0 / (1.0+
q);
1968 for (
size_t i=0;
i < Mfs->size;
i++) {
1969 const double Mf = gsl_vector_get(Mfs,
i);
1970 const double Mf_m = 2./
m * Mf;
1971 const double v = cbrt(
LAL_PI * Mf_m);
1972 const double logv = log(v);
1973 const double v2 = v * v;
1974 const double v3 = v * v2;
1975 const double v4 = v * v3;
1976 const double v5 = v * v4;
1977 const double v6 = v * v5;
1978 const double v7 = v * v6;
1979 double phasing = 0.0;
1981 phasing +=
pn->v[7] * v7;
1982 phasing += (
pn->v[6] +
pn->vlogv[6] * logv) * v6;
1983 phasing += (
pn->v[5] +
pn->vlogv[5] * logv) * v5;
1984 phasing +=
pn->v[4] * v4;
1985 phasing +=
pn->v[3] * v3;
1986 phasing +=
pn->v[2] * v2;
1987 phasing +=
pn->v[1] * v;
1988 phasing +=
pn->v[0];
1997 phasing += Deltaphilm -
LAL_PI/4.;
1999 gsl_vector_set(*PNphase,
i, phasing);
2026 *PNamp = gsl_vector_alloc(Mfs->size);
2027 double eta =
q / ((1.+
q)*(1.+
q));
2031 double delta = (
q-1. + DBL_EPSILON) / (1.+
q);
2034 double ampN =
LAL_PI * sqrt(2*eta/3.);
2037 for (
size_t i=0;
i < Mfs->size;
i++) {
2038 const double Mf = gsl_vector_get(Mfs,
i);
2039 const double Mf_m = 2./
m * Mf;
2040 const double v = cbrt(
LAL_PI * Mf_m);
2041 const double vm72 = pow(v, -7./2);
2045 double amp = ampN * vm72 * sqrt(2./
m) * mode_amp_factor;
2046 gsl_vector_set(*PNamp,
i, amp);
2065 if (!(Mfmin < Mfmax))
2068 double eta =
q / ((1.+
q) * (1.+
q));
2073 double Lambda = 3.8 * pow(acc * eta, 1./4) * pow(
LAL_PI, 5./12);
2077 double Lambdatilde = 0.;
2078 N = 1 + ceil(12./5/
Lambda * (pow(Mfmin, -5./12) - pow(Mfmax, -5./12)));
2080 Lambdatilde = 12./5/(
N-1) * (pow(Mfmin, -5./12) - pow(Mfmax, -5./12));
2083 *Mfreq = gsl_vector_alloc(
N);
2086 double Mfmin_m512 = pow(Mfmin, -5./12);
2087 for (
int i=0;
i<
N;
i++) {
2088 (*Mfreq)->data[
i] = pow(Mfmin_m512 - 5./12*Lambdatilde*
i, -12./5);
2092 (*Mfreq)->data[0] = Mfmin;
2093 (*Mfreq)->data[
N-1] = Mfmax;
2099 gsl_spline **hyb_spline,
2101 gsl_vector *PN_freq,
2103 double f_hyb_win_lo,
2107 gsl_vector *ROM_amp_f = NULL;
2108 gsl_vector *ROM_amp = NULL;
2112 if ( (gsl_vector_get(PN_freq, 0) > f_hyb_win_lo)
2113 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_lo)
2114 || (gsl_vector_get(PN_freq, 0) > f_hyb_win_hi)
2115 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_hi) )
2116 XLAL_ERROR(
XLAL_EFUNC,
"Hybridization window for amplitude is not contained in PN frequencies.");
2117 if ( (gsl_vector_get(ROM_amp_f, 0) > f_hyb_win_lo)
2118 || (gsl_vector_get(ROM_amp_f, ROM_amp_f->size - 1) < f_hyb_win_lo)
2119 || (gsl_vector_get(ROM_amp_f, 0) > f_hyb_win_hi)
2120 || (gsl_vector_get(ROM_amp_f, ROM_amp_f->size - 1) < f_hyb_win_hi) )
2121 XLAL_ERROR(
XLAL_EFUNC,
"Hybridization window for amplitude is not contained in ROM frequencies.");
2124 gsl_spline *PN_amp_spline = gsl_spline_alloc(gsl_interp_cspline, PN_amp->size);
2125 gsl_spline_init(PN_amp_spline, PN_freq->data, PN_amp->data, PN_amp->size);
2126 gsl_interp_accel *acc_PN = gsl_interp_accel_alloc();
2127 gsl_interp_accel *acc_ROM = gsl_interp_accel_alloc();
2128 double PN_amp_i = gsl_spline_eval(PN_amp_spline, f_hyb_win_lo, acc_PN);
2129 double ROM_amp_i = gsl_spline_eval(ampPhaseSplineData_for_mode->
spline_amp, f_hyb_win_lo, acc_ROM);
2130 double fac = ROM_amp_i / PN_amp_i;
2131 for (
size_t i=0;
i < PN_amp->size;
i++) {
2132 double A = gsl_vector_get(PN_amp,
i);
2133 gsl_vector_set(PN_amp,
i, A * fac);
2135 gsl_spline_free(PN_amp_spline);
2136 gsl_interp_accel_free(acc_PN);
2137 gsl_interp_accel_free(acc_ROM);
2139 gsl_vector *hyb_freq = NULL;
2140 gsl_vector *hyb_amp = NULL;
2142 &hyb_freq, &hyb_amp,
2145 f_hyb_win_lo, f_hyb_win_hi
2148 *hyb_spline = gsl_spline_alloc(gsl_interp_cspline, hyb_amp->size);
2149 gsl_spline_init(*hyb_spline, hyb_freq->data, hyb_amp->data, hyb_amp->size);
2151 gsl_vector_free(ROM_amp_f);
2152 gsl_vector_free(ROM_amp);
2153 gsl_vector_free(hyb_freq);
2154 gsl_vector_free(hyb_amp);
2160 gsl_spline **hyb_spline,
2161 REAL8* Deltat_align,
2162 REAL8* Deltaphi_align,
2164 gsl_vector *PN_freq,
2165 gsl_vector *PN_phase,
2166 double f_hyb_win_lo,
2170 gsl_vector *ROM_phi_f = NULL;
2171 gsl_vector *ROM_phi = NULL;
2175 if ( (gsl_vector_get(PN_freq, 0) > f_hyb_win_lo)
2176 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_lo)
2177 || (gsl_vector_get(PN_freq, 0) > f_hyb_win_hi)
2178 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_hi) )
2180 if ( (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_lo)
2181 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_lo)
2182 || (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_hi)
2183 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_hi) )
2186 gsl_vector *hyb_freq = NULL;
2187 gsl_vector *hyb_phase = NULL;
2189 &hyb_freq, &hyb_phase, Deltat_align, Deltaphi_align,
2192 f_hyb_win_lo, f_hyb_win_hi
2196 *hyb_spline = gsl_spline_alloc(gsl_interp_cspline, hyb_phase->size);
2197 gsl_spline_init(*hyb_spline, hyb_freq->data, hyb_phase->data, hyb_phase->size);
2199 gsl_vector_free(ROM_phi_f);
2200 gsl_vector_free(ROM_phi);
2201 gsl_vector_free(hyb_freq);
2202 gsl_vector_free(hyb_phase);
2208 gsl_spline **hyb_spline,
2210 gsl_vector *PN_freq,
2211 gsl_vector *PN_phase,
2212 double f_hyb_win_lo,
2213 double f_hyb_win_hi,
2214 REAL8 Deltat_22_align,
2215 REAL8 Deltaphi_22_align,
2219 gsl_vector *ROM_phi_f = NULL;
2220 gsl_vector *ROM_phi = NULL;
2224 if ( (gsl_vector_get(PN_freq, 0) > f_hyb_win_lo)
2225 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_lo)
2226 || (gsl_vector_get(PN_freq, 0) > f_hyb_win_hi)
2227 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_hi) )
2229 if ( (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_lo)
2230 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_lo)
2231 || (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_hi)
2232 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_hi) )
2235 gsl_vector *hyb_freq = NULL;
2236 gsl_vector *hyb_phase = NULL;
2238 &hyb_freq, &hyb_phase,
2241 f_hyb_win_lo, f_hyb_win_hi,
2242 Deltat_22_align, Deltaphi_22_align, modeM
2246 *hyb_spline = gsl_spline_alloc(gsl_interp_cspline, hyb_phase->size);
2247 gsl_spline_init(*hyb_spline, hyb_freq->data, hyb_phase->data, hyb_phase->size);
2249 gsl_vector_free(ROM_phi_f);
2250 gsl_vector_free(ROM_phi);
2251 gsl_vector_free(hyb_freq);
2252 gsl_vector_free(hyb_phase);
2262 UNUSED
REAL8 phiRef,
2264 UNUSED
REAL8 distance,
2265 UNUSED
REAL8 Mtot_sec,
2270 UNUSED
REAL8 deltaF,
2277 REAL8 sign_odd_modes,
2278 UNUSED SEOBNRROMdataDS *romdataset
2283 REAL8 fLow = freqs_in->data[0];
2284 REAL8 fHigh = freqs_in->data[freqs_in->length - 1];
2286 REAL8 fLow_geom = fLow * Mtot_sec;
2287 REAL8 fHigh_geom = fHigh * Mtot_sec;
2288 REAL8 deltaF_geom = deltaF * Mtot_sec;
2293 if (fHigh_geom == 0)
2300 XLAL_PRINT_INFO(
"Starting frequency %g is smaller than (or equal to) ROM starting frequency for (2,2) mode %g!\nUsing hybridization with TaylorF2.\n", fLow_geom,
Mf_low_22);
2302 XLAL_PRINT_INFO(
"Starting frequency %g is smaller than (or equal to) ROM starting frequency for (5,5) mode %g!\nUsing hybridization with TaylorF2.\n", fLow_geom,
Mf_low_55);
2303 if (fLow_geom <= 0.0) {
2304 XLALPrintError(
"XLAL Error - %s: Starting frequency in REAL8Sequence must be positive.\n", __func__);
2311 ampPhaseSplineData,
q, chi1, chi2, nk_max,
nModes,romdataset);
2316 const double f_hyb_win_lo_fac = 1.01;
2317 const double f_hyb_win_hi_fac = 2.0;
2326 double PN_Mf_low = fmin(fLow_geom / 2.0,
Mf_low_21);
2327 double PN_Mf_high = 1.1 * f_hyb_win_hi_fac *
Mf_low_55;
2329 gsl_vector *Mfs = NULL;
2330 const double acc = 1
e-4;
2335 gsl_spline *hybrid_spline_amp[
nModes];
2336 gsl_spline *hybrid_spline_phi[
nModes];
2338 hybrid_spline_amp[
i] = NULL;
2339 hybrid_spline_phi[
i] = NULL;
2344 REAL8 Deltat_22_align = 0.;
2345 REAL8 Deltaphi_22_align = 0.;
2353 XLALPrintInfo(
"%s : SEOBNRv5HM_ROM hybridization window for (2,2) mode: Mf in [%g, %g]\n",
2354 __func__, f_hyb_win_lo, f_hyb_win_hi);
2358 gsl_vector *PNamp = NULL;
2359 gsl_vector *PNphase = NULL;
2363 retcode |=
TaylorF2Phasing(Mtot,
q, chi1, chi2, modeL, modeM, Mfs, &PNphase);
2365 gsl_vector_free(PNamp);
2366 gsl_vector_free(PNphase);
2367 gsl_vector_free(Mfs);
2376 if (!(modeL==2 && modeM==2)) {
2382 &hybrid_spline_phi[k],
2385 ampPhaseSplineData[k],
2387 f_hyb_win_lo, f_hyb_win_hi
2393 &hybrid_spline_phi[k],
2394 ampPhaseSplineData[k],
2396 f_hyb_win_lo, f_hyb_win_hi,
2397 Deltat_22_align, Deltaphi_22_align, modeM
2403 &hybrid_spline_amp[k],
2404 ampPhaseSplineData[k],
2406 f_hyb_win_lo, f_hyb_win_hi
2410 gsl_interp_accel *acc_amp = gsl_interp_accel_alloc();
2411 gsl_interp_accel *acc_phase = gsl_interp_accel_alloc();
2423 npts =
NextPow2(fHigh_geom / deltaF_geom) + 1;
2424 if (fHigh_geom < fHigh * Mtot_sec)
2425 npts =
NextPow2(fHigh * Mtot_sec / deltaF_geom) + 1;
2430 "hlmtilde: FD mode", &tC, 0.0, deltaF, &
lalStrainUnit, npts);
2434 double fHigh_temp = fHigh_geom / Mtot_sec;
2436 UINT4 iStop = (
UINT4) ceil(fHigh_temp / deltaF);
2440 freqs->
data[
i-iStart] =
i*deltaF_geom;
2445 npts = freqs_in->length;
2449 "hlmtilde: FD mode", &tC, fLow, deltaF, &
lalStrainUnit, npts);
2453 for (
UINT4 i=0;
i<freqs_in->length;
i++)
2454 freqs->
data[
i] = freqs_in->data[
i] * Mtot_sec;
2463 double amp0 = Mtot * Mtot_sec *
LAL_MRSUN_SI / (distance);
2467 double t_corr = 1000.0;
2471 q, chi1, chi2, modeL, modeM) / (2.0*
LAL_PI);
2475 double f = freqs->
data[
i];
2476 if (f > Mf_max_mode)
continue;
2480 REAL8 A = gsl_spline_eval(hybrid_spline_amp[k], f, acc_amp);
2481 REAL8 phase = gsl_spline_eval(hybrid_spline_phi[k], f, acc_phase);
2482 hlmdata[j] = amp0*A * (cos(phase) + I*sin(phase));
2484 COMPLEX16 t_factor = cos(phase_factor) + I*sin(phase_factor);
2485 hlmdata[j] *= t_factor;
2488 hlmdata[j] = pow(-1.0, modeL) * conj(hlmdata[j]);
2492 hlmdata[j] = hlmdata[j] * sign_odd_modes;
2500 gsl_interp_accel_free(acc_amp);
2501 gsl_interp_accel_free(acc_phase);
2502 gsl_vector_free(PNamp);
2503 gsl_vector_free(PNphase);
2508 gsl_vector_free(Mfs);
2512 gsl_spline_free(hybrid_spline_amp[k]);
2513 gsl_spline_free(hybrid_spline_phi[k]);
2549 UNUSED
struct tagCOMPLEX16FrequencySeries **hptilde,
2550 UNUSED
struct tagCOMPLEX16FrequencySeries **hctilde,
2551 UNUSED
REAL8 phiRef,
2552 UNUSED
REAL8 deltaF,
2556 UNUSED
REAL8 distance,
2557 UNUSED
REAL8 inclination,
2564 bool use_hybridization,
2568 REAL8 sign_odd_modes = 1.;
2572 REAL8 m1temp = m1SI;
2573 REAL8 chi1temp = chi1;
2578 sign_odd_modes = -1.;
2584 REAL8 Mtot = mass1+mass2;
2591 if (ModeArray == NULL) {
2606 freqs->
data[0] = fLow;
2607 freqs->
data[1] = fHigh;
2609 SEOBNRROMdataDS *romdataset;
2612 #ifdef LAL_PTHREAD_LOCK
2633 if (use_hybridization) {
2635 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
2636 nModes, sign_odd_modes, romdataset);
2640 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
2641 nModes, sign_odd_modes, romdataset);
2654 memset(hPlustilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2655 memset(hCrosstilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2662 (*hptilde) = hPlustilde;
2663 (*hctilde) = hCrosstilde;
2670 const char*
s = getenv(
"FREE_MEMORY_SEOBNRv5HMROM");
2672 for(
unsigned int index_mode = 0; index_mode <
nModes;index_mode++){
2688 UNUSED
struct tagCOMPLEX16FrequencySeries **hptilde,
2689 UNUSED
struct tagCOMPLEX16FrequencySeries **hctilde,
2691 UNUSED
REAL8 phiRef,
2693 UNUSED
REAL8 distance,
2694 UNUSED
REAL8 inclination,
2704 REAL8 sign_odd_modes = 1.;
2708 REAL8 m1temp = m1SI;
2709 REAL8 chi1temp = chi1;
2714 sign_odd_modes = -1.;
2720 REAL8 Mtot = mass1+mass2;
2727 if (ModeArray == NULL) {
2738 SEOBNRROMdataDS *romdataset;
2741 #ifdef LAL_PTHREAD_LOCK
2763 double deltaF = 0.0;
2768 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
2769 nModes, sign_odd_modes, romdataset);
2778 double fLow = freqs->
data[0];
2781 "hptilde: FD waveform", &tGPS, fLow, deltaF, &
lalStrainUnit, npts);
2783 "hctilde: FD waveform", &tGPS, fLow, deltaF, &
lalStrainUnit, npts);
2784 memset(hPlustilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2785 memset(hCrosstilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2792 (*hptilde) = hPlustilde;
2793 (*hctilde) = hCrosstilde;
2799 const char*
s = getenv(
"FREE_MEMORY_SEOBNRv5HMROM");
2801 for(
unsigned int index_mode = 0; index_mode <
nModes;index_mode++){
2818 UNUSED
REAL8 phiRef,
2819 UNUSED
REAL8 deltaF,
2830 bool use_hybridization
2833 REAL8 sign_odd_modes = 1.;
2837 REAL8 m1temp = m1SI;
2838 REAL8 chi1temp = chi1;
2843 sign_odd_modes = -1.;
2848 XLAL_PRINT_ERROR(
"Requested number of modes not available. Set nModes = 0 to get all the available modes.\n");
2855 REAL8 Mtot = mass1+mass2;
2866 freqs->
data[0] = fLow;
2867 freqs->
data[1] = fHigh;
2869 SEOBNRROMdataDS *romdataset;
2872 #ifdef LAL_PTHREAD_LOCK
2891 UNUSED
UINT8 retcode;
2893 if (use_hybridization) {
2896 Mtot_sec,
q, chi1, chi2, freqs,
2897 deltaF, nk_max, 7, sign_odd_modes, romdataset);
2900 Mtot_sec,
q, chi1, chi2, freqs,
2901 deltaF, nk_max,
nModes, sign_odd_modes, romdataset);
2906 Mtot_sec,
q, chi1, chi2, freqs,
2907 deltaF, nk_max, 7, sign_odd_modes, romdataset);
2910 Mtot_sec,
q, chi1, chi2, freqs,
2911 deltaF, nk_max,
nModes, sign_odd_modes, romdataset);
2928 UNUSED
REAL8 phiRef,
2930 UNUSED
REAL8 distance,
2931 UNUSED
REAL8 inclination,
2941 REAL8 sign_odd_modes = 1.;
2945 REAL8 m1temp = m1SI;
2946 REAL8 chi1temp = chi1;
2951 sign_odd_modes = -1.;
2957 REAL8 Mtot = mass1+mass2;
2964 if (ModeArray == NULL) {
2975 SEOBNRROMdataDS *romdataset;
2978 #ifdef LAL_PTHREAD_LOCK
2999 double deltaF = 0.0;
3004 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
3005 nModes, sign_odd_modes, romdataset);
3011 const char*
s = getenv(
"FREE_MEMORY_SEOBNRv5HMROM");
3013 for(
unsigned int index_mode = 0; index_mode <
nModes;index_mode++){
3023 gsl_spline **spline_phi,
3024 gsl_interp_accel **acc_phi,
3039 double Mtot = mass1 + mass2;
3040 double q = mass1 / mass2;
3041 double eta = mass1 * mass2 / (Mtot*Mtot);
3046 if (
q > 100.0)
nudge(&
q, 100.0, 1
e-6);
3048 if ( chi1 < -0.998 || chi2 < -0.998 || chi1 > 0.998 || chi2 > 0.998) {
3049 XLALPrintError(
"XLAL Error - %s: chi1 or chi2 smaller than -0.998 or larger than 0.998!\n"
3050 "SEOBNRv5HMROM is only available for spins in the range -0.998 <= a/M <= 0.998.\n",
3055 if (q<1.0 || q > 100.0) {
3056 XLALPrintError(
"XLAL Error - %s: q (%f) bigger than 100.0 or unphysical!\n"
3057 "SEOBNRv5HMROM is only available for q in the range 1 <= q <= 100.\n",
3062 SEOBNRROMdataDS *romdataset;
3065 #ifdef LAL_PTHREAD_LOCK
3078 ampPhaseSplineData,
q, chi1, chi2, nk_max,
nModes,romdataset);
3084 const double f_hyb_win_lo_fac = 1.01;
3085 const double f_hyb_win_hi_fac = 2.0;
3088 double PN_Mf_low = fmin(Mf_start / 2.0,
Mf_low_21);
3089 double PN_Mf_high = 1.1 * f_hyb_win_hi_fac *
Mf_low_55;
3091 gsl_vector *Mfs = NULL;
3092 const double acc = 1
e-4;
3097 gsl_spline *hybrid_spline_phi[
nModes];
3099 hybrid_spline_phi[
i] = NULL;
3104 REAL8 Deltat_22_align = 0.;
3105 REAL8 Deltaphi_22_align = 0.;
3112 XLALPrintInfo(
"%s : SEOBNRv5HM_ROM hybridization window for (2,2) mode: Mf in [%g, %g]\n",
3113 __func__, f_hyb_win_lo, f_hyb_win_hi);
3117 gsl_vector *PNphase = NULL;
3120 retcode |=
TaylorF2Phasing(Mtot,
q, chi1, chi2, modeL, modeM, Mfs, &PNphase);
3122 gsl_vector_free(PNphase);
3123 gsl_vector_free(Mfs);
3128 if (!(modeL==2 && modeM==2)) {
3134 &hybrid_spline_phi[k],
3137 ampPhaseSplineData[k],
3139 f_hyb_win_lo, f_hyb_win_hi
3143 *spline_phi = hybrid_spline_phi[0];
3144 *acc_phi = ampPhaseSplineData[0]->
acc_phi;
3182 double m1temp = m1SI;
3183 double chi1temp = chi1;
3191 gsl_spline *spline_phi;
3192 gsl_interp_accel *acc_phi;
3193 double Mf_final, Mtot_sec;
3198 &Mtot_sec, m1SI, m2SI, chi1, chi2, Mf,
3204 double t_corr = gsl_spline_eval_deriv(spline_phi, Mf_final, acc_phi) / (2*
LAL_PI);
3208 gsl_spline_free(spline_phi);
3209 gsl_interp_accel_free(acc_phi);
3211 "Min / max / final Mf values are %g, %g, %g\n", frequency, Mf,
Mf_ROM_min,
Mf_ROM_max, Mf_final);
3215 double time_M = gsl_spline_eval_deriv(spline_phi, frequency * Mtot_sec, acc_phi) / (2*
LAL_PI) - t_corr;
3217 *t = -1. * time_M * Mtot_sec;
3219 gsl_spline_free(spline_phi);
3220 gsl_interp_accel_free(acc_phi);
struct tagLALH5File LALH5File
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
static const REAL8 Mf_ROM_max
static const REAL8 Mf_ROM_min
static void nudge(REAL8 *x, REAL8 X, REAL8 epsilon)
static double double delta
Auxiliary functions for SEOBNRv1/v2 reduced order modeling codes in LALSimIMRSEOBNRv2ROMDoubleSpin....
static UNUSED UINT4 align_wfs_window_from_22(gsl_vector *f_array_1, gsl_vector *f_array_2, gsl_vector *phase_1, gsl_vector *phase_2, REAL8 f_align_start, REAL8 f_align_end, REAL8 Deltat22, REAL8 Deltaphi22, INT4 modeM)
static UNUSED REAL8 Get_omegaQNM_SEOBNRv5(REAL8 q, REAL8 chi1z, REAL8 chi2z, UINT4 l, UINT4 m)
static UNUSED UINT4 compute_i_max_LF_i_min_HF(INT8 *i_max_LF, INT8 *i_min_LF, gsl_vector *freqs_in_1, gsl_vector *freqs_in_2, REAL8 freq_1)
static UNUSED REAL8 Interpolate_Coefficent_Tensor(gsl_vector *v, REAL8 eta, REAL8 chi1, REAL8 chi2, int ncy, int ncz, gsl_bspline_workspace *bwx, gsl_bspline_workspace *bwy, gsl_bspline_workspace *bwz)
static UNUSED UINT4 unwrap_phase(gsl_vector *phaseout, gsl_vector *phasein)
static UNUSED UINT4 align_wfs_window(gsl_vector *f_array_1, gsl_vector *f_array_2, gsl_vector *phase_1, gsl_vector *phase_2, REAL8 *Deltat, REAL8 *Deltaphi, REAL8 f_align_start, REAL8 f_align_end)
static UNUSED double SEOBNRROM_Ringdown_Mf_From_Mtot_Eta(const double Mtot_sec, const double eta, const double chi1, const double chi2, Approximant apx)
static UNUSED char * concatenate_strings(int count,...)
static UNUSED UINT4 blend_functions(gsl_vector *freqs_out, gsl_vector *out_fun, gsl_vector *freq_in_1, gsl_vector *fun_in_1, gsl_vector *freq_in_2, gsl_vector *fun_in_2, REAL8 freq_1, REAL8 freq_2)
const REAL8 const_fmax_lm_v5hm[NMODES]
static UNUSED UINT8 SEOBNRv5HMROM_Select_HF_patch(REAL8 q, REAL8 chi1)
static UNUSED void AmpPhaseSplineData_Destroy(AmpPhaseSplineData **data, const int num_modes)
static SEOBNRROMdataDS __lalsim_SEOBNRv5ROMDS_data[1]
static UNUSED UINT8 SEOBNRv5HMROM_freq_phase_sparse_grid_hybrid(UNUSED gsl_vector **freq, UNUSED gsl_vector **phase, REAL8 q, REAL8 chi1, REAL8 chi2, INT4 nk_max, SEOBNRROMdataDS *romdataset)
static INT8 Check_EOBROM_mode_array_structure(LALValue *ModeArray, UINT4 nModes)
ModeArray is a structure which allows to select the modes to include in the waveform.
static UNUSED UINT8 SEOBNRv5HMROM_cmode_sparse_grid(gsl_vector *creal_f, gsl_vector *cimag_f, REAL8 q, REAL8 chi1, REAL8 chi2, const char *freq_range, UINT8 nMode, INT4 nk_max, SEOBNRROMdataDS *romdataset)
static UNUSED int SEOBNRROMdataDS_Init(SEOBNRROMdataDS *romdata, const char dir[], UINT4, bool)
static UNUSED void SEOBNRv5ROM_Init_LALDATA(void)
Setup SEOBNRv5ROM model using data files installed in $LAL_DATA_PATH.
static UNUSED int TaylorF2Phasing(double Mtot, double q, double chi1, double chi2, int l, int m, gsl_vector *Mfs, gsl_vector **PNphase)
int(* load_dataPtr)(const char *, gsl_vector *, gsl_vector *, gsl_matrix *, gsl_matrix *, gsl_vector *)
static UNUSED double GetDeltaphilm(int l, int m)
static UNUSED void SplineData_Init(SplineData **splinedata, int ncx, int ncy, int ncz, const double *qvec, const double *chi1vec, const double *chi2vec)
static UNUSED int hybridize_ROM_with_PN_phase_output_align(gsl_spline **hyb_spline, REAL8 *Deltat_align, REAL8 *Deltaphi_align, AmpPhaseSplineData *ampPhaseSplineData_for_mode, gsl_vector *PN_freq, gsl_vector *PN_phase, double f_hyb_win_lo, double f_hyb_win_hi)
static UNUSED int SEOBNRv5HMROM_Init(const char dir[], UINT4, bool, SEOBNRROMdataDS *romdataset)
Setup SEOBNRv5HMROM mode using data files installed in dir.
const REAL8 Mf_low_lm_v5hm[NMODES]
static UNUSED void SplineData_Destroy(SplineData *splinedata)
static UNUSED UINT8 SEOBNRv5HMROM_phase_sparse_grid_hybrid_output_align(gsl_vector **freq, gsl_vector **phase, REAL8 *Deltat_align, REAL8 *Deltaphi_align, gsl_vector *phase_lo, gsl_vector *phase_hi, gsl_vector *freq_lo, gsl_vector *freq_hi, double f_hyb_lo, double f_hyb_hi)
static UNUSED bool SEOBNRv5HMROM_IsSetup(UINT4, SEOBNRROMdataDS *romdataset)
Helper function to check if the SEOBNRv5HMROM model has been initialised.
static UNUSED void SEOBNRROMdataDS_coeff_Init(SEOBNRROMdataDS_coeff **romdatacoeff, int nk_cmode, int nk_phase)
static SEOBNRROMdataDS __lalsim_SEOBNRv5HMROMDS_data[NMODES]
static UNUSED int TaylorF2Amplitude(const double q, const double chi1, const double chi2, const int l, const int m, gsl_vector *Mfs, gsl_vector **PNamp)
static UNUSED int SEOBNRv5HMROMCoreModes(SphHarmFrequencySeries **hlm_list, REAL8 phiRef, REAL8 fRef, REAL8 distance, REAL8 Mtot_sec, REAL8 q, REAL8 chi1, REAL8 chi2, const REAL8Sequence *freqs, REAL8 deltaF, INT4 nk_max, UINT4 nModes, REAL8 sign_odd_modes, SEOBNRROMdataDS *romdataset)
Core function for computing the ROM waveform.
const REAL8 const_phaseshift_lm_v5hm[NMODES]
static int SEOBROMComputehplushcrossFromhlm(COMPLEX16FrequencySeries *hplusFS, COMPLEX16FrequencySeries *hcrossFS, LALValue *ModeArray, SphHarmFrequencySeries *hlm, REAL8 inc, REAL8 phi)
static UNUSED int SEOBNRROMdataDS_Init_submodel(UNUSED SEOBNRROMdataDS_submodel **submodel, UNUSED const char dir[], UNUSED const char grp_name[], UNUSED UINT4 index_mode, UNUSED bool use_hm)
static UNUSED void SEOBNRROMdataDS_Cleanup_submodel(SEOBNRROMdataDS_submodel *submodel)
static UNUSED void AmpPhaseSplineData_Init(AmpPhaseSplineData ***data, const int num_modes)
static UNUSED void SEOBNRv5HMROM_Init_LALDATA(void)
Setup SEOBNRv5HMROM model using data files installed in $LAL_DATA_PATH.
static UNUSED UINT8 SEOBNRv5HMROM_phase_sparse_grid(gsl_vector *phase_f, REAL8 q, REAL8 chi1, REAL8 chi2, const char *freq_range, INT4 nk_max, SEOBNRROMdataDS *romdataset)
static UNUSED int SEOBNRv5HMROMCoreModesHybridized(UNUSED SphHarmFrequencySeries **hlm_list, UNUSED REAL8 phiRef, UNUSED REAL8 fRef, UNUSED REAL8 distance, UNUSED REAL8 Mtot_sec, UNUSED REAL8 q, UNUSED REAL8 chi1, UNUSED REAL8 chi2, UNUSED const REAL8Sequence *freqs_in, UNUSED REAL8 deltaF, UNUSED INT4 nk_max, UNUSED UINT4 nModes, REAL8 sign_odd_modes, UNUSED SEOBNRROMdataDS *romdataset)
static UNUSED void SEOBNRROMdataDS_coeff_Cleanup(SEOBNRROMdataDS_coeff *romdatacoeff)
const char mode_array_v5hm[NMODES][3]
static UNUSED UINT8 SEOBNRv5HMROM_cmode_sparse_grid_hybrid(gsl_vector *freq, gsl_vector *cmode_real, gsl_vector *cmode_imag, gsl_vector *freq_lo, gsl_vector *freq_hi, REAL8 q, REAL8 chi1, REAL8 chi2, UINT8 nMode, INT8 nk_max, SEOBNRROMdataDS *romdataset)
static UNUSED UINT8 SEOBNRv5HMROM_approx_phi_lm(gsl_vector *freq_mode_lm, gsl_vector *phase_approx_lm, gsl_vector *freq_carrier_hyb, gsl_vector *phase_carrier_hyb, UINT4 nMode)
static UNUSED UINT8 SEOBNRv5HMROM_phase_sparse_grid_hybrid(gsl_vector *freq, gsl_vector *phase, gsl_vector *freq_lo, gsl_vector *freq_hi, REAL8 q, REAL8 chi1, REAL8 chi2, INT4 nk_max, SEOBNRROMdataDS *romdataset)
static UNUSED void SEOBNRROMdataDS_Cleanup(SEOBNRROMdataDS *romdata)
static UNUSED int hybridize_ROM_with_PN_amplitude(gsl_spline **hyb_spline, AmpPhaseSplineData *ampPhaseSplineData_for_mode, gsl_vector *PN_freq, gsl_vector *PN_amp, double f_hyb_win_lo, double f_hyb_win_hi)
static UNUSED double GetModeAmpFactor(double eta, double delta, double chi1, double chi2, int l, int m, double v)
static UNUSED UINT8 SEOBNRv5HMROM_freq_cmode_sparse_grid_hybrid(gsl_vector **freq_cmode, gsl_vector **cmode_real, gsl_vector **cmode_imag, REAL8 q, REAL8 chi1, REAL8 chi2, UINT8 nMode, INT8 nk_max, SEOBNRROMdataDS *romdataset)
static size_t NextPow2(const size_t n)
static UNUSED int BuildInspiralGeomFrequencyGrid(gsl_vector **Mfreq, const double Mfmin, const double Mfmax, const double q, const double acc)
static int TP_Spline_interpolation_3d(REAL8 q, REAL8 chi1, REAL8 chi2, gsl_vector *cvec, int nk, int nk_max, int ncx, int ncy, int ncz, const double *qvec, const double *chi1vec, const double *chi2vec, gsl_vector *c_out)
static UNUSED UINT8 SEOBNRv5HMROM_amplitude_sparse_grid_hybrid_general(gsl_vector **freq, gsl_vector **amp, gsl_vector *amp_lo, gsl_vector *amp_hi, gsl_vector *freq_lo, gsl_vector *freq_hi, double f_hyb_lo, double f_hyb_hi)
static UNUSED UINT8 SEOBNRv5HMROM_phase_sparse_grid_hybrid_input_align(gsl_vector **freq, gsl_vector **phase, gsl_vector *phase_lo, gsl_vector *phase_hi, gsl_vector *freq_lo, gsl_vector *freq_hi, double f_hyb_lo, double f_hyb_hi, REAL8 Deltat_22_align, REAL8 Deltaphi_22_align, INT4 modeM)
static UNUSED int hybridize_ROM_with_PN_phase_input_align(gsl_spline **hyb_spline, AmpPhaseSplineData *ampPhaseSplineData_for_mode, gsl_vector *PN_freq, gsl_vector *PN_phase, double f_hyb_win_lo, double f_hyb_win_hi, REAL8 Deltat_22_align, REAL8 Deltaphi_22_align, INT4 modeM)
const UINT4 lmModes_v5hm[NMODES][2]
static UNUSED int SEOBNRv5HMROMCoreModeAmpPhaseSplines(UNUSED AmpPhaseSplineData **ampPhaseSplineData, UNUSED REAL8 q, UNUSED REAL8 chi1, UNUSED REAL8 chi2, UNUSED INT4 nk_max, UNUSED UINT4 nModes, UNUSED SEOBNRROMdataDS *romdataset)
static UINT8 Setup_EOBROM__std_mode_array_structure(LALValue *ModeArray, UINT4 nModes)
ModeArray is a structure which allows to select the modes to include in the waveform.
static UNUSED int spline_to_gsl_vectors(gsl_spline *s, gsl_vector **x, gsl_vector **y)
void XLALDestroyValue(LALValue *value)
#define XLAL_FILE_RESOLVE_PATH(fname)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
void XLALH5FileClose(LALH5File UNUSED *file)
LALH5File * XLALH5GroupOpen(LALH5File UNUSED *file, const char UNUSED *name)
LALH5File * XLALH5FileOpen(const char UNUSED *path, const char UNUSED *mode)
void * XLALCalloc(size_t m, size_t n)
void * XLALMalloc(size_t n)
static UNUSED int SEOBNRv5ROMTimeFrequencySetup(gsl_spline **spline_phi, gsl_interp_accel **acc_phi, REAL8 *Mf_final, REAL8 *Mtot_sec, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, REAL8 Mf_start, REAL8 *Mf_ROM_min, REAL8 *Mf_ROM_max)
int XLALSimIMRSEOBNRv5HMROM_Modes(SphHarmFrequencySeries **hlm, UNUSED REAL8 phiRef, UNUSED REAL8 deltaF, REAL8 fLow, UNUSED REAL8 fHigh, REAL8 fRef, REAL8 distance, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, UNUSED INT4 nk_max, UNUSED UINT4 nModes, bool use_hybridization)
Compute modes in LAL format for the SEOBNRv5HM_ROM model.
int XLALSimIMRSEOBNRv5HMROMFrequencySequence(UNUSED struct tagCOMPLEX16FrequencySeries **hptilde, UNUSED struct tagCOMPLEX16FrequencySeries **hctilde, const REAL8Sequence *freqs, UNUSED REAL8 phiRef, UNUSED REAL8 fRef, UNUSED REAL8 distance, UNUSED REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, UNUSED INT4 nk_max, UNUSED UINT4 nModes, LALDict *LALParams)
Compute waveform polarizations at user specified frequencies for the SEOBNRv5HM_ROM model.
int XLALSimIMRSEOBNRv5HMROMFrequencySequence_Modes(SphHarmFrequencySeries **hlm, const REAL8Sequence *freqs, UNUSED REAL8 phiRef, UNUSED REAL8 fRef, UNUSED REAL8 distance, UNUSED REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, UNUSED INT4 nk_max, UNUSED UINT4 nModes, LALDict *LALParams)
Compute waveform modes at user specified frequencies for the SEOBNRv5HM_ROM model.
int XLALSimIMRSEOBNRv5ROMTimeOfFrequency(REAL8 *t, REAL8 frequency, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2)
Compute the 'time' elapsed in the ROM waveform from a given starting frequency until the ringdown.
int XLALSimIMRSEOBNRv5HMROM(UNUSED struct tagCOMPLEX16FrequencySeries **hptilde, UNUSED struct tagCOMPLEX16FrequencySeries **hctilde, UNUSED REAL8 phiRef, UNUSED REAL8 deltaF, REAL8 fLow, UNUSED REAL8 fHigh, UNUSED REAL8 fRef, UNUSED REAL8 distance, UNUSED REAL8 inclination, REAL8 m1SI, REAL8 m2SI, REAL8 chi1, REAL8 chi2, UNUSED INT4 nk_max, UNUSED UINT4 nModes, bool use_hybridization, LALDict *LALParams)
Compute waveform in LAL format for the SEOBNRv5HM_ROM model.
#define LAL_SIM_L_MAX_MODE_ARRAY
Maximum L spherical harmonic mode that is supported in Mode Array.
@ LAL_SIM_INSPIRAL_SPIN_ORDER_35PN
@ SEOBNRv5_ROM
Time domain, precessing phenomenological IMR waveform model with subdominant modes ([arXiv: 20XY....
int XLALSimInspiralTaylorF2AlignedPhasing(PNPhasingSeries **pfa, const REAL8 m1, const REAL8 m2, const REAL8 chi1, const REAL8 chi2, LALDict *extraPars)
Returns structure containing TaylorF2 phasing coefficients for given physical parameters.
int XLALSimAddModeFD(COMPLEX16FrequencySeries *hptilde, COMPLEX16FrequencySeries *hctilde, COMPLEX16FrequencySeries *hlmtilde, REAL8 theta, REAL8 phi, INT4 l, INT4 m, INT4 sym)
Helper function to add a mode to hplus, hcross in Fourier domain copies the function XLALSimAddMode,...
COMPLEX16FrequencySeries * XLALSphHarmFrequencySeriesGetMode(SphHarmFrequencySeries *ts, UINT4 l, INT4 m)
Get the time series of a waveform's (l,m) spherical harmonic mode from a SphHarmFrequencySeries linke...
SphHarmFrequencySeries * XLALSphHarmFrequencySeriesAddMode(SphHarmFrequencySeries *appended, const COMPLEX16FrequencySeries *inmode, UINT4 l, INT4 m)
Prepend a node to a linked list of SphHarmFrequencySeries, or create a new head.
void XLALDestroySphHarmFrequencySeries(SphHarmFrequencySeries *ts)
Delete list from current pointer to the end of the list.
void XLALDestroyREAL8Sequence(REAL8Sequence *sequence)
REAL8Sequence * XLALCreateREAL8Sequence(size_t length)
const LALUnit lalStrainUnit
const LALUnit lalSecondUnit
LALUnit * XLALUnitDivide(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
#define XLAL_ERROR_VOID(...)
#define XLAL_PRINT_INFO(...)
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_PRINT_ERROR(...)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
int pthread_once(pthread_once_t *once_control, void(*init_routine)(void))
gsl_interp_accel * acc_amp
gsl_interp_accel * acc_phi
struct tagSphHarmFrequencySeries * next
next pointer
COMPLEX16FrequencySeries * mode
The sequences of sampled data.
gsl_bspline_workspace * bwx
gsl_bspline_workspace * bwz
gsl_bspline_workspace * bwy
SEOBNRROMdataDS_submodel * lowf
SEOBNRROMdataDS_submodel * highf