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>
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>
70static const char ROMDataHDF5[] =
"SEOBNRv5HMROM_v1.0.hdf5";
71static const char ROM22DataHDF5[] =
"SEOBNRv5ROM_v1.0.hdf5";
74#include <lal/LALSimInspiral.h>
75#include <lal/LALSimIMR.h>
80#include <lal/LALConfig.h>
81#ifdef LAL_PTHREAD_LOCK
87#ifdef LAL_PTHREAD_LOCK
88static pthread_once_t SEOBNRv5HMROM_is_initialized = PTHREAD_ONCE_INIT;
89static pthread_once_t SEOBNRv5ROM_is_initialized = PTHREAD_ONCE_INIT;
104const UINT4 lmModes_v5hm[
NMODES][2] = {{2, 2}, {3, 3}, {2, 1}, {4, 4}, {5, 5}, {3, 2}, {4, 3}};
123#define Mf_low_22 0.0004925491025543576
124#define Mf_low_33 (Mf_low_22 * (3.0/2.0))
125#define Mf_low_21 (Mf_low_22 * (1.0/2.0))
126#define Mf_low_44 (Mf_low_22 * (4.0/2.0))
127#define Mf_low_55 (Mf_low_22 * (5.0/2.0))
128#define Mf_low_32 (Mf_low_22)
129#define Mf_low_43 (Mf_low_22 * (3.0/2.0))
134typedef struct tagSEOBNRROMdataDS_coeff
167 SEOBNRROMdataDS_submodel*
lowf;
174typedef int (*
load_dataPtr)(
const char*, gsl_vector *, gsl_vector *, gsl_matrix *, gsl_matrix *, gsl_vector *);
176typedef struct tagSplineData
178 gsl_bspline_workspace *bwx;
179 gsl_bspline_workspace *bwy;
180 gsl_bspline_workspace *bwz;
183typedef struct tagAmpPhaseSplineData
185 gsl_spline *spline_amp;
186 gsl_spline *spline_phi;
187 gsl_interp_accel *acc_amp;
188 gsl_interp_accel *acc_phi;
202 UNUSED SEOBNRROMdataDS_submodel **submodel,
203 UNUSED
const char dir[],
204 UNUSED
const char grp_name[],
205 UNUSED
UINT4 index_mode,
216 const double *chi1vec,
217 const double *chi2vec
247UNUSED
static double GetModeAmpFactor(
double eta,
double delta,
double chi1,
double chi2,
int l,
int m,
double v);
279 REAL8 sign_odd_modes,
280 SEOBNRROMdataDS *romdataset
285static size_t NextPow2(
const size_t n);
311 const double *chi1vec,
312 const double *chi2vec,
319UNUSED
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);
328 REAL8* Deltaphi_align,
329 gsl_vector *phase_lo,
330 gsl_vector *phase_hi,
340 gsl_vector *phase_lo,
341 gsl_vector *phase_hi,
346 REAL8 Deltat_22_align,
347 REAL8 Deltaphi_22_align,
363 gsl_spline **hyb_spline,
372 gsl_spline **hyb_spline,
374 REAL8* Deltaphi_align,
377 gsl_vector *PN_phase,
383 gsl_spline **hyb_spline,
386 gsl_vector *PN_phase,
389 REAL8 Deltat_22_align,
390 REAL8 Deltaphi_22_align,
401 UNUSED SEOBNRROMdataDS *romdataset
408 UNUSED
REAL8 distance,
409 UNUSED
REAL8 Mtot_sec,
418 REAL8 sign_odd_modes,
419 UNUSED SEOBNRROMdataDS *romdataset,
425 gsl_spline **spline_phi,
426 gsl_interp_accel **acc_phi,
447 *
x = gsl_vector_alloc(
s->size);
448 *
y = gsl_vector_alloc(
s->size);
449 for (
size_t i=0;
i <
s->size;
i++) {
450 gsl_vector_set(*
x,
i,
s->x[
i]);
451 gsl_vector_set(*
y,
i,
s->y[
i]);
468#ifdef LAL_HDF5_ENABLED
469#define datafile ROMDataHDF5
473 "Unable to resolve data file '%s' in $LAL_DATA_PATH.\n"
474 "Note: LALSuite versions >= 7.25 require data files that are publicly available at:\n"
475 "https://git.ligo.org/waveforms/software/lalsuite-waveform-data\n"
476 "and on Zenodo at: https://zenodo.org/records/14999310.\n"
477 "For earlier LALSuite versions, use the files in lalsuite-extra, available at:\n"
478 "https://git.ligo.org/lscsoft/lalsuite-extra\n",
481 char *dir = dirname(
path);
489 files in $LAL_DATA_PATH for the mode = %d\n",
i);
502 for(
int i = 0;
i < 1;
i++) {
507#ifdef LAL_HDF5_ENABLED
508#define datafile22 ROM22DataHDF5
513 char *dir = dirname(
path);
517 for(
int i = 0;
i < 1;
i++) {
521 files in $LAL_DATA_PATH for the mode = %d\n",
i);
531 if(romdataset[index_mode].setup){
546 const double *chi1vec,
547 const double *chi2vec
550 if(!splinedata) exit(1);
556 const size_t nbreak_x = ncx-2;
557 const size_t nbreak_y = ncy-2;
558 const size_t nbreak_z = ncz-2;
561 gsl_bspline_workspace *bwx = gsl_bspline_alloc(4, nbreak_x);
562 gsl_bspline_workspace *bwy = gsl_bspline_alloc(4, nbreak_y);
563 gsl_bspline_workspace *bwz = gsl_bspline_alloc(4, nbreak_z);
566 gsl_vector *breakpts_x = gsl_vector_alloc(nbreak_x);
567 gsl_vector *breakpts_y = gsl_vector_alloc(nbreak_y);
568 gsl_vector *breakpts_z = gsl_vector_alloc(nbreak_z);
570 gsl_vector_set(breakpts_x,
i, qvec[
i]);
571 for (
UINT4 j=0; j<nbreak_y; j++)
572 gsl_vector_set(breakpts_y, j, chi1vec[j]);
573 for (
UINT4 k=0; k<nbreak_z; k++)
574 gsl_vector_set(breakpts_z, k, chi2vec[k]);
576 gsl_bspline_knots(breakpts_x, bwx);
577 gsl_bspline_knots(breakpts_y, bwy);
578 gsl_bspline_knots(breakpts_z, bwz);
580 gsl_vector_free(breakpts_x);
581 gsl_vector_free(breakpts_y);
582 gsl_vector_free(breakpts_z);
584 (*splinedata)->bwx=bwx;
585 (*splinedata)->bwy=bwy;
586 (*splinedata)->bwz=bwz;
592 if(!splinedata)
return;
593 if(splinedata->
bwx) gsl_bspline_free(splinedata->
bwx);
594 if(splinedata->
bwy) gsl_bspline_free(splinedata->
bwy);
595 if(splinedata->
bwz) gsl_bspline_free(splinedata->
bwz);
609 for (
int i=0;
i<num_modes;
i++) {
617 if(!data_array)
return;
620 for (
int i=0;
i<num_modes;
i++) {
621 data = data_array[
i];
625 if (
data->spline_amp) gsl_spline_free(
data->spline_amp);
626 if (
data->spline_phi) gsl_spline_free(
data->spline_phi);
627 if (
data->acc_amp) gsl_interp_accel_free(
data->acc_amp);
628 if (
data->acc_phi) gsl_interp_accel_free(
data->acc_phi);
629 if (
data->f) gsl_vector_free(
data->f);
650 const double *chi1vec,
651 const double *chi2vec,
656 XLAL_ERROR(
XLAL_EDOM,
"Truncation parameter nk_max %d must be smaller or equal to nk %d\n", nk_max, nk);
665 gsl_bspline_workspace *bwx=splinedata->
bwx;
666 gsl_bspline_workspace *bwy=splinedata->
bwy;
667 gsl_bspline_workspace *bwz=splinedata->
bwz;
671 for (
int k=0; k<nk; k++) {
672 gsl_vector v = gsl_vector_subvector(cvec, k*
N,
N).vector;
674 gsl_vector_set(c_out, k, csum);
684 if(romdataset[index_mode].setup) {
690 if(romdataset[index_mode].setup) {
701 UNUSED SEOBNRROMdataDS *romdata,
702 UNUSED
const char dir[],
703 UNUSED
UINT4 index_mode,
711 XLALPrintError(
"WARNING: You tried to setup the SEOBNRv5HMROM model that was already initialised. Ignoring\n");
715#ifdef LAL_HDF5_ENABLED
719 size = strlen(dir) + strlen(ROMDataHDF5) + 2;
722 size = strlen(dir) + strlen(ROM22DataHDF5) + 2;
726 snprintf(
path, size,
"%s/%s", dir, ROMDataHDF5);
729 snprintf(
path, size,
"%s/%s", dir, ROM22DataHDF5);
735 PrintInfoStringAttribute(
file,
"Email");
736 PrintInfoStringAttribute(
file,
"Description");
737 ret = ROM_check_canonical_file_basename(
file,ROMDataHDF5,
"CANONICAL_FILE_BASENAME");
740 PrintInfoStringAttribute(
file,
"Email");
741 PrintInfoStringAttribute(
file,
"Description");
742 ret = ROM_check_canonical_file_basename(
file,ROM22DataHDF5,
"CANONICAL_FILE_BASENAME");
773 (romdata)->highf = NULL;
776 (romdata)->lowf = NULL;
782 if(submodel->cvec_real) gsl_vector_free(submodel->cvec_real);
783 if(submodel->cvec_imag) gsl_vector_free(submodel->cvec_imag);
784 if(submodel->cvec_phase) gsl_vector_free(submodel->cvec_phase);
785 if(submodel->Breal) gsl_matrix_free(submodel->Breal);
786 if(submodel->Bimag) gsl_matrix_free(submodel->Bimag);
787 if(submodel->Bphase) gsl_matrix_free(submodel->Bphase);
788 if(submodel->gCMode) gsl_vector_free(submodel->gCMode);
789 if(submodel->gPhase) gsl_vector_free(submodel->gPhase);
790 if(submodel->qvec) gsl_vector_free(submodel->qvec);
791 if(submodel->chi1vec) gsl_vector_free(submodel->chi1vec);
792 if(submodel->chi2vec) gsl_vector_free(submodel->chi2vec);
797 SEOBNRROMdataDS_submodel **submodel,
798 UNUSED
const char dir[],
799 UNUSED
const char grp_name[],
800 UNUSED
UINT4 index_mode,
804 if(!submodel) exit(1);
807 *submodel =
XLALCalloc(1,
sizeof(SEOBNRROMdataDS_submodel));
811#ifdef LAL_HDF5_ENABLED
814 size = strlen(dir) + strlen(ROMDataHDF5) + 2;
817 size = strlen(dir) + strlen(ROM22DataHDF5) + 2;
821 snprintf(
path, size,
"%s/%s", dir, ROMDataHDF5);
824 snprintf(
path, size,
"%s/%s", dir, ROM22DataHDF5);
834 ReadHDF5RealVectorDataset(sub, path_to_dataset, & (*submodel)->cvec_real);
835 free(path_to_dataset);
837 ReadHDF5RealVectorDataset(sub, path_to_dataset, & (*submodel)->cvec_imag);
838 free(path_to_dataset);
842 ReadHDF5RealVectorDataset(sub,
"phase_carrier/coeff_flattened", & (*submodel)->cvec_phase);
850 ReadHDF5RealMatrixDataset(sub, path_to_dataset, & (*submodel)->Breal);
851 free(path_to_dataset);
853 ReadHDF5RealMatrixDataset(sub, path_to_dataset, & (*submodel)->Bimag);
854 free(path_to_dataset);
858 ReadHDF5RealMatrixDataset(sub,
"phase_carrier/basis", & (*submodel)->Bphase);
864 ReadHDF5RealVectorDataset(sub, path_to_dataset, & (*submodel)->gCMode);
865 free(path_to_dataset);
869 ReadHDF5RealVectorDataset(sub,
"phase_carrier/MF_grid", & (*submodel)->gPhase);
872 ReadHDF5RealVectorDataset(sub,
"qvec", & (*submodel)->qvec);
873 ReadHDF5RealVectorDataset(sub,
"chi1vec", & (*submodel)->chi1vec);
874 ReadHDF5RealVectorDataset(sub,
"chi2vec", & (*submodel)->chi2vec);
878 (*submodel)->nk_cmode = (*submodel)->gCMode->size;
881 (*submodel)->nk_phase = (*submodel)->gPhase->size;
883 (*submodel)->ncx = (*submodel)->qvec->size + 2;
884 (*submodel)->ncy = (*submodel)->chi1vec->size + 2;
885 (*submodel)->ncz = (*submodel)->chi2vec->size + 2;
888 (*submodel)->q_bounds[0] = gsl_vector_get((*submodel)->qvec, 0);
889 (*submodel)->q_bounds[1] = gsl_vector_get((*submodel)->qvec, (*submodel)->qvec->size - 1);
890 (*submodel)->chi1_bounds[0] = gsl_vector_get((*submodel)->chi1vec, 0);
891 (*submodel)->chi1_bounds[1] = gsl_vector_get((*submodel)->chi1vec, (*submodel)->chi1vec->size - 1);
892 (*submodel)->chi2_bounds[0] = gsl_vector_get((*submodel)->chi2vec, 0);
893 (*submodel)->chi2_bounds[1] = gsl_vector_get((*submodel)->chi2vec, (*submodel)->chi2vec->size - 1);
908 if(!romdatacoeff) exit(1);
915 (*romdatacoeff)->c_real = gsl_vector_alloc(nk_cmode);
916 (*romdatacoeff)->c_imag = gsl_vector_alloc(nk_cmode);
917 (*romdatacoeff)->c_phase = gsl_vector_alloc(nk_phase);
922 if(romdatacoeff->
c_real) gsl_vector_free(romdatacoeff->
c_real);
923 if(romdatacoeff->
c_imag) gsl_vector_free(romdatacoeff->
c_imag);
930 return 1 << (size_t) ceil(log2(n));
935 gsl_vector *phase_f_lo = gsl_vector_alloc(freq_lo->size);
936 gsl_vector *phase_f_hi = gsl_vector_alloc(freq_hi->size);
952 gsl_vector_free(phase_f_lo);
953 gsl_vector_free(phase_f_hi);
965 SEOBNRROMdataDS *romdata=&romdataset[0];
968 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
971 UNUSED
UINT4 retcode=0;
974 SEOBNRROMdataDS_submodel *submodel_hi;
975 SEOBNRROMdataDS_submodel *submodel_lo;
979 submodel_lo = romdata->lowf;
981 submodel_hi = romdata->highf;
989 gsl_vector* freq_lo = gsl_vector_alloc(submodel_lo->nk_phase);
990 for(
unsigned int i = 0;
i < freq_lo->size;
i++){
991 freq_lo->data[
i] = submodel_lo->gPhase->data[
i];
993 gsl_vector* freq_hi = gsl_vector_alloc(submodel_hi->nk_phase);
1000 for(
unsigned int i = 0;
i < freq_hi->size;
i++){
1001 freq_hi->data[
i] = inv_scaling*submodel_hi->gPhase->data[
i];
1007 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1010 *phase = gsl_vector_calloc((*freq)->size);
1013 for(
unsigned int i = 0;
i <= i_max_LF;
i++){
1014 (*freq)->data[
i] = freq_lo->data[
i];
1016 for(
unsigned int i = i_min_HF;
i < freq_hi->size;
i++){
1017 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1025 gsl_vector_free(freq_lo);
1026 gsl_vector_free(freq_hi);
1038 REAL8* Deltat_align,
1039 REAL8* Deltaphi_align,
1040 gsl_vector *phase_lo,
1041 gsl_vector *phase_hi,
1042 gsl_vector *freq_lo,
1043 gsl_vector *freq_hi,
1059 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1062 for(
unsigned int i=0;
i <= i_max_LF;
i++)
1063 (*freq)->data[
i] = freq_lo->data[
i];
1064 for(
unsigned int i=i_min_HF; i < freq_hi->size;
i++)
1065 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1068 *phase = gsl_vector_calloc((*freq)->size);
1073 REAL8 Deltaphi = 0.;
1074 retcode =
align_wfs_window(freq_lo, freq_hi, phase_lo, phase_hi, &Deltat, &Deltaphi, f_hyb_lo, f_hyb_hi);
1078 retcode =
blend_functions(*freq, *phase, freq_lo, phase_lo, freq_hi, phase_hi, f_hyb_lo, f_hyb_hi);
1084 *Deltat_align = Deltat;
1085 *Deltaphi_align = Deltaphi;
1094 gsl_vector *phase_lo,
1095 gsl_vector *phase_hi,
1096 gsl_vector *freq_lo,
1097 gsl_vector *freq_hi,
1100 REAL8 Deltat_22_align,
1101 REAL8 Deltaphi_22_align,
1116 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1119 for(
unsigned int i=0;
i <= i_max_LF;
i++)
1120 (*freq)->data[
i] = freq_lo->data[
i];
1121 for(
unsigned int i=i_min_HF; i < freq_hi->size;
i++)
1122 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1125 *phase = gsl_vector_calloc((*freq)->size);
1128 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);
1132 retcode =
blend_functions(*freq, *phase, freq_lo, phase_lo, freq_hi, phase_hi, f_hyb_lo, f_hyb_hi);
1144 gsl_vector *freq_lo,
1145 gsl_vector *freq_hi,
1160 *freq = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1163 for(
unsigned int i=0;
i <= i_max_LF;
i++)
1164 (*freq)->data[
i] = freq_lo->data[
i];
1165 for(
unsigned int i=i_min_HF; i < freq_hi->size;
i++)
1166 (*freq)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1169 *amp = gsl_vector_calloc((*freq)->size);
1172 retcode =
blend_functions(*freq, *amp, freq_lo, amp_lo, freq_hi, amp_hi, f_hyb_lo, f_hyb_hi);
1187 REAL8 f_max_carrier = freq_carrier_hyb->data[freq_carrier_hyb->size -1];
1188 REAL8 phase_carrier_at_f_max = phase_carrier_hyb->data[phase_carrier_hyb->size -1];
1190 gsl_interp_accel *acc = gsl_interp_accel_alloc ();
1191 gsl_spline *spline = gsl_spline_alloc (gsl_interp_cspline, phase_carrier_hyb->size);
1193 gsl_spline_init (spline, freq_carrier_hyb->data, phase_carrier_hyb->data, phase_carrier_hyb->size);
1194 REAL8 der_phase_carrier_at_f_max = gsl_spline_eval_deriv(spline, f_max_carrier, acc);
1199 for(
unsigned int i = 0;
i < freq_mode_lm->size;
i++){
1200 if(freq_mode_lm->data[
i]/(
REAL8)modeM < f_max_carrier){
1202 phase_approx_lm->data[
i] = (
REAL8)modeM*gsl_spline_eval (spline, freq_mode_lm->data[
i]/(
REAL8)modeM, acc) + const_phase_shift;
1206 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;
1211 gsl_spline_free(spline);
1212 gsl_interp_accel_free(acc);
1219UNUSED
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){
1221 gsl_vector* real_f_lo = gsl_vector_alloc(freq_lo->size);
1222 gsl_vector* imag_f_lo = gsl_vector_alloc(freq_lo->size);
1223 gsl_vector* real_f_hi = gsl_vector_alloc(freq_hi->size);
1224 gsl_vector* imag_f_hi = gsl_vector_alloc(freq_hi->size);
1237 gsl_vector_free(real_f_lo);
1238 gsl_vector_free(imag_f_lo);
1239 gsl_vector_free(real_f_hi);
1240 gsl_vector_free(imag_f_hi);
1253 SEOBNRROMdataDS *romdata=&romdataset[nMode];
1256 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
1259 UNUSED
UINT4 retcode=0;
1262 SEOBNRROMdataDS_submodel *submodel_hi;
1263 SEOBNRROMdataDS_submodel *submodel_lo;
1267 submodel_lo = romdata->lowf;
1269 submodel_hi = romdata->highf;
1277 gsl_vector* freq_lo = gsl_vector_alloc(submodel_lo->nk_cmode);
1278 gsl_vector* freq_hi = gsl_vector_alloc(submodel_hi->nk_cmode);
1280 for(
unsigned int i = 0;
i < freq_lo->size;
i++){
1281 freq_lo->data[
i] = submodel_lo->gCMode->data[
i];
1288 for(
unsigned int i = 0;
i < freq_hi->size;
i++){
1289 freq_hi->data[
i] = inv_scaling*submodel_hi->gCMode->data[
i];
1296 *freq_cmode = gsl_vector_alloc(i_max_LF + freq_hi->size - i_min_HF + 1);
1299 for(
unsigned int i = 0;
i <= i_max_LF;
i++){
1300 (*freq_cmode)->data[
i] = freq_lo->data[
i];
1302 for(
unsigned int i = i_min_HF;
i < freq_hi->size;
i++){
1303 (*freq_cmode)->data[i_max_LF+
i-i_min_HF+1] = freq_hi->data[
i];
1306 *cmode_real = gsl_vector_calloc((*freq_cmode)->size);
1307 *cmode_imag = gsl_vector_calloc((*freq_cmode)->size);
1312 retcode =
SEOBNRv5HMROM_cmode_sparse_grid_hybrid(*freq_cmode,*cmode_real,*cmode_imag,freq_lo, freq_hi,
q,chi1,chi2,nMode,nk_max,romdataset);
1316 gsl_vector_free(freq_lo);
1317 gsl_vector_free(freq_hi);
1328 SEOBNRROMdataDS *romdata=&romdataset[0];
1331 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
1334 SEOBNRROMdataDS_submodel *submodel;
1335 if(strcmp(
"LF",freq_range) == 0){
1337 submodel = romdata->lowf;
1340 submodel = romdata->highf;
1351 submodel->cvec_phase,
1357 gsl_vector_const_ptr(submodel->qvec, 0),
1358 gsl_vector_const_ptr(submodel->chi1vec, 0),
1359 gsl_vector_const_ptr(submodel->chi2vec, 0),
1370 gsl_blas_dgemv(CblasTrans, 1.0, submodel->Bphase, romdata_coeff->
c_phase, 0.0, phase_f);
1382 SEOBNRROMdataDS *romdata=&romdataset[nMode];
1385 "Error setting up SEOBNRv5ROM data - check your $LAL_DATA_PATH\n");
1388 SEOBNRROMdataDS_submodel *submodel;
1389 if(strcmp(
"LF",freq_range) == 0){
1391 submodel = romdata->lowf;
1395 submodel = romdata->highf;
1406 submodel->cvec_real,
1412 gsl_vector_const_ptr(submodel->qvec, 0),
1413 gsl_vector_const_ptr(submodel->chi1vec, 0),
1414 gsl_vector_const_ptr(submodel->chi2vec, 0),
1423 submodel->cvec_imag,
1429 gsl_vector_const_ptr(submodel->qvec, 0),
1430 gsl_vector_const_ptr(submodel->chi1vec, 0),
1431 gsl_vector_const_ptr(submodel->chi2vec, 0),
1443 gsl_blas_dgemv(CblasTrans, 1.0, submodel->Breal, romdata_coeff->
c_real, 0.0, creal_f);
1444 gsl_blas_dgemv(CblasTrans, 1.0, submodel->Bimag, romdata_coeff->
c_imag, 0.0, cimag_f);
1455 if ((
q> 3.) && (chi1<=0.8)){
1458 else if ((
q> 3.) && (chi1>0.8)){
1461 else if ((
q<= 3.) && (chi1<=0.8)){
1464 else if ((
q<= 3.) && (chi1>0.8)){
1469 XLALPrintError(
"XLAL Error - %s: SEOBNRv5HM not currently available in this region!\n",
1483 UNUSED SEOBNRROMdataDS *romdataset
1487 if(!ampPhaseSplineData)
1492 if (
q > 100.0)
nudge(&
q, 100.0, 1
e-6);
1494 if ( chi1 < -0.998 - 1
e-6 || chi2 < -0.998 - 1e-6 || chi1 > 0.998 + 1
e-6|| chi2 > 0.998 + 1
e-6) {
1495 XLALPrintError(
"XLAL Error - %s: chi1 or chi2 smaller than -0.998 or larger than 0.998!\n"
1496 "SEOBNRv5HMROM is only available for spins in the range -0.998 <= a/M <= 0.998.\n",
1501 if (q<1.0 || q > 100.0) {
1502 XLALPrintError(
"XLAL Error - %s: q (%f) bigger than 100.0 or unphysical!\n"
1503 "SEOBNRv5HMROM is only available for q in the range 1 <= q <= 100.\n",
1508 gsl_vector *freq_carrier_hyb = NULL;
1509 gsl_vector *phase_carrier_hyb = NULL;
1514 &freq_carrier_hyb, &phase_carrier_hyb,
q, chi1, chi2, nk_max,romdataset);
1518 for(
unsigned int i=0;
i < phase_carrier_hyb->size;
i++) {
1519 phase_carrier_hyb->data[
i] = -phase_carrier_hyb->data[
i];
1523 for(
unsigned int nMode=0; nMode <
nModes; nMode++){
1525 gsl_vector *freq_cmode_hyb = NULL;
1526 gsl_vector *cmode_real_hyb = NULL;
1527 gsl_vector *cmode_imag_hyb = NULL;
1534 &freq_cmode_hyb, &cmode_real_hyb, &cmode_imag_hyb,
1535 q, chi1, chi2, nMode, nk_max, romdataset);
1537 gsl_vector *phase_approx_lm = gsl_vector_alloc(freq_cmode_hyb->size);
1540 freq_carrier_hyb, phase_carrier_hyb, nMode);
1544 gsl_vector *phase_cmode = gsl_vector_alloc(freq_cmode_hyb->size);
1545 for(
unsigned int i=0;
i < freq_cmode_hyb->size;
i++) {
1546 complex_mode = cmode_real_hyb->data[
i] + I*cmode_imag_hyb->data[
i];
1547 phase_cmode->data[
i] = carg(complex_mode);
1551 gsl_vector *unwrapped_phase_cmode = gsl_vector_alloc(freq_cmode_hyb->size);
1552 retcode =
unwrap_phase(unwrapped_phase_cmode,phase_cmode);
1555 gsl_vector *reconstructed_phase = gsl_vector_alloc(freq_cmode_hyb->size);
1556 gsl_vector *reconstructed_amplitude = gsl_vector_alloc(freq_cmode_hyb->size);
1557 for(
unsigned int i=0;
i < freq_cmode_hyb->size;
i++) {
1558 complex_mode = cmode_real_hyb->data[
i] + I*cmode_imag_hyb->data[
i];
1559 reconstructed_amplitude->data[
i] = cabs(complex_mode);
1560 reconstructed_phase->data[
i] = unwrapped_phase_cmode->data[
i] - phase_approx_lm->data[
i];
1564 gsl_interp_accel *acc_amp = gsl_interp_accel_alloc();
1565 gsl_spline *spline_amp = gsl_spline_alloc (gsl_interp_cspline, reconstructed_amplitude->size);
1566 gsl_spline_init(spline_amp, freq_cmode_hyb->data, reconstructed_amplitude->data, reconstructed_amplitude->size);
1568 gsl_interp_accel *acc_phase = gsl_interp_accel_alloc();
1569 gsl_spline *spline_phase = gsl_spline_alloc (gsl_interp_cspline, reconstructed_phase->size);
1570 gsl_spline_init(spline_phase, freq_cmode_hyb->data, reconstructed_phase->data, reconstructed_phase->size);
1574 ampPhaseSplineData[nMode]->spline_amp = spline_amp;
1575 ampPhaseSplineData[nMode]->spline_phi = spline_phase;
1576 ampPhaseSplineData[nMode]->acc_amp = acc_amp;
1577 ampPhaseSplineData[nMode]->acc_phi = acc_phase;
1578 ampPhaseSplineData[nMode]->f = freq_cmode_hyb;
1581 gsl_vector_free(cmode_real_hyb);
1582 gsl_vector_free(cmode_imag_hyb);
1583 gsl_vector_free(phase_approx_lm);
1584 gsl_vector_free(phase_cmode);
1585 gsl_vector_free(unwrapped_phase_cmode);
1586 gsl_vector_free(reconstructed_amplitude);
1587 gsl_vector_free(reconstructed_phase);
1591 gsl_vector_free(freq_carrier_hyb);
1592 gsl_vector_free(phase_carrier_hyb);
1605 UNUSED
REAL8 phiRef,
1607 UNUSED
REAL8 distance,
1608 UNUSED
REAL8 Mtot_sec,
1613 UNUSED
REAL8 deltaF,
1617 REAL8 sign_odd_modes,
1618 UNUSED SEOBNRROMdataDS *romdataset
1627 if (
q > 100.0)
nudge(&
q, 100.0, 1
e-6);
1629 if ( chi1 < -0.998 || chi2 < -0.998 || chi1 > 0.998 || chi2 > 0.998) {
1630 XLALPrintError(
"XLAL Error - %s: chi1 or chi2 smaller than -0.998 or larger than 0.998!\n"
1631 "SEOBNRv5HMROM is only available for spins in the range -0.998 <= a/M <= 0.998.\n",
1636 if (q<1.0 || q > 100.0) {
1637 XLALPrintError(
"XLAL Error - %s: q (%f) bigger than 100.0 or unphysical!\n"
1638 "SEOBNRv5HMROM is only available for q in the range 1 <= q <= 100.\n",
1648 ampPhaseSplineData,
q, chi1, chi2, nk_max,
nModes,romdataset);
1654 REAL8 fLow = freqs_in->data[0];
1655 REAL8 fHigh = freqs_in->data[freqs_in->length - 1];
1657 UNUSED
REAL8 fLow_geom = fLow * Mtot_sec;
1658 REAL8 fHigh_geom = fHigh * Mtot_sec;
1659 REAL8 deltaF_geom = deltaF * Mtot_sec;
1664 if (fHigh_geom == 0)
1670 if (fHigh_geom <= fLow_geom)
1671 XLAL_ERROR(
XLAL_EDOM,
"End frequency %g is smaller than (or equal to) starting frequency %g!\n", fHigh_geom, fLow_geom);
1674 for(
unsigned int nMode=0; nMode <
nModes; nMode++){
1685 npts =
NextPow2(fHigh_geom / deltaF_geom) + 1;
1686 if (fHigh_geom < fHigh * Mtot_sec)
1687 npts =
NextPow2(fHigh * Mtot_sec / deltaF_geom) + 1;
1695 double fHigh_temp = fHigh_geom / Mtot_sec;
1697 UINT4 iStop = (
UINT4) ceil(fHigh_temp / deltaF);
1701 freqs->
data[
i-iStart] =
i*deltaF_geom;
1720 REAL8 t_corr = 1000.;
1723 gsl_spline *spline_amp = ampPhaseSplineData[nMode]->
spline_amp;
1724 gsl_spline *spline_phase = ampPhaseSplineData[nMode]->
spline_phi;
1725 gsl_interp_accel *acc_amp = ampPhaseSplineData[nMode]->
acc_amp;
1726 gsl_interp_accel *acc_phase = ampPhaseSplineData[nMode]->
acc_phi;
1735 if (f > Mf_max_mode)
continue;
1736 if (f <=
Mf_low_22 * modeM/2.)
continue;
1738 REAL8 A = gsl_spline_eval(spline_amp, f, acc_amp);
1739 REAL8 phase = gsl_spline_eval(spline_phase, f, acc_phase);
1740 hlmdata[j] = amp0*A * (cos(phase) + I*sin(phase));
1742 COMPLEX16 t_factor = cos(phase_factor) + I*sin(phase_factor);
1743 hlmdata[j] *= t_factor;
1746 hlmdata[j] = pow(-1.,modeL)*conj(hlmdata[j]);
1750 hlmdata[j] = hlmdata[j]*sign_odd_modes;
1810 const char *model_name;
1812 model_name=
"SEOBNRv5_ROM";
1815 model_name=
"SEOBNRv5HM_ROM";
1822 for (
INT4 EMM = -ELL; EMM <= (
INT4)ELL; EMM++) {
1829 if ((modeL == ELL)&&(modeM == EMM)) {
1832 if ((modeL == ELL)&&(modeM == -EMM)) {
1838 if (flagTrue == 0) {
1839 XLALPrintError (
"Mode (%d,%d) is not available by the model %s\n", ELL,
1843 if (flagTrue == 2) {
1844 XLALPrintError (
"Mode (%d,%d) is not available by the model %s.\n"
1845 "In this function you can only select (l,-|m|) modes that are directly modeled in the ROM.\n"
1846 "The (l,+|m|) mode will be automatically added to the waveform using symmetry arguments.\n", ELL,
1868 LALValue *ModeArray,
1876 while ( hlms_temp ) {
1880 hlms_temp->
l, hlms_temp->
m, 1);
1882 hlms_temp = hlms_temp->
next;
1893 if (
l==2 &&
m==2)
return 0.;
1894 else if (
l==2 &&
m==1)
return LAL_PI/2;
1895 else if (
l==3 &&
m==3)
return -
LAL_PI/2;
1896 else if (
l==4 &&
m==4)
return LAL_PI;
1897 else if (
l==5 &&
m==5)
return LAL_PI/2;
1898 else if (
l==3 &&
m==2)
return 0;
1899 else if (
l==4 &&
m==3)
return -
LAL_PI/2;
1913 double chis = 1./2 * (chi1 + chi2);
1914 double chia = 1./2 * (chi1 - chi2);
1915 if (
l==2 &&
m==2)
return 1.;
1916 else if (
l==2 &&
m==1)
return v * (
delta/3 - 1./2*v*(chia +
delta*chis));
1917 else if (
l==3 &&
m==3)
return v * 3./4 * sqrt(15./14) *
delta;
1918 else if (
l==4 &&
m==4)
return v*v * 8*sqrt(35.)/63 * (1 - 3*eta);
1919 else if (
l==5 &&
m==5)
return v*v*v * 625*sqrt(66.)/6336 *
delta * (1 - 2*eta);
1920 else if (
l==3 &&
m==2)
return v*v * 9./8 *sqrt(5./7) * (8./27 * (-1 + 3*eta));
1921 else if (
l==4 &&
m==3)
return v*v*v * 8./9*sqrt(10./7)*81./320 *
delta * (-1 + 2*eta);
1943 gsl_vector **PNphase
1947 *PNphase = gsl_vector_alloc(Mfs->size);
1954 double m1OverM =
q / (1.0+
q);
1955 double m2OverM = 1.0 / (1.0+
q);
1965 for (
size_t i=0;
i < Mfs->size;
i++) {
1966 const double Mf = gsl_vector_get(Mfs,
i);
1967 const double Mf_m = 2./
m * Mf;
1968 const double v = cbrt(
LAL_PI * Mf_m);
1969 const double logv = log(v);
1970 const double v2 = v * v;
1971 const double v3 = v * v2;
1972 const double v4 = v * v3;
1973 const double v5 = v * v4;
1974 const double v6 = v * v5;
1975 const double v7 = v * v6;
1976 double phasing = 0.0;
1978 phasing +=
pn->v[7] * v7;
1979 phasing += (
pn->v[6] +
pn->vlogv[6] * logv) * v6;
1980 phasing += (
pn->v[5] +
pn->vlogv[5] * logv) * v5;
1981 phasing +=
pn->v[4] * v4;
1982 phasing +=
pn->v[3] * v3;
1983 phasing +=
pn->v[2] * v2;
1984 phasing +=
pn->v[1] * v;
1985 phasing +=
pn->v[0];
1994 phasing += Deltaphilm -
LAL_PI/4.;
1996 gsl_vector_set(*PNphase,
i, phasing);
2023 *PNamp = gsl_vector_alloc(Mfs->size);
2024 double eta =
q / ((1.+
q)*(1.+
q));
2028 double delta = (
q-1. + DBL_EPSILON) / (1.+
q);
2031 double ampN =
LAL_PI * sqrt(2*eta/3.);
2034 for (
size_t i=0;
i < Mfs->size;
i++) {
2035 const double Mf = gsl_vector_get(Mfs,
i);
2036 const double Mf_m = 2./
m * Mf;
2037 const double v = cbrt(
LAL_PI * Mf_m);
2038 const double vm72 = pow(v, -7./2);
2042 double amp = ampN * vm72 * sqrt(2./
m) * mode_amp_factor;
2043 gsl_vector_set(*PNamp,
i, amp);
2062 if (!(Mfmin < Mfmax))
2065 double eta =
q / ((1.+
q) * (1.+
q));
2070 double Lambda = 3.8 * pow(acc * eta, 1./4) * pow(
LAL_PI, 5./12);
2074 double Lambdatilde = 0.;
2075 N = 1 + ceil(12./5/
Lambda * (pow(Mfmin, -5./12) - pow(Mfmax, -5./12)));
2077 Lambdatilde = 12./5/(
N-1) * (pow(Mfmin, -5./12) - pow(Mfmax, -5./12));
2080 *Mfreq = gsl_vector_alloc(
N);
2083 double Mfmin_m512 = pow(Mfmin, -5./12);
2084 for (
int i=0;
i<
N;
i++) {
2085 (*Mfreq)->data[
i] = pow(Mfmin_m512 - 5./12*Lambdatilde*
i, -12./5);
2089 (*Mfreq)->data[0] = Mfmin;
2090 (*Mfreq)->data[
N-1] = Mfmax;
2096 gsl_spline **hyb_spline,
2098 gsl_vector *PN_freq,
2100 double f_hyb_win_lo,
2104 gsl_vector *ROM_amp_f = NULL;
2105 gsl_vector *ROM_amp = NULL;
2109 if ( (gsl_vector_get(PN_freq, 0) > f_hyb_win_lo)
2110 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_lo)
2111 || (gsl_vector_get(PN_freq, 0) > f_hyb_win_hi)
2112 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_hi) )
2113 XLAL_ERROR(
XLAL_EFUNC,
"Hybridization window for amplitude is not contained in PN frequencies.");
2114 if ( (gsl_vector_get(ROM_amp_f, 0) > f_hyb_win_lo)
2115 || (gsl_vector_get(ROM_amp_f, ROM_amp_f->size - 1) < f_hyb_win_lo)
2116 || (gsl_vector_get(ROM_amp_f, 0) > f_hyb_win_hi)
2117 || (gsl_vector_get(ROM_amp_f, ROM_amp_f->size - 1) < f_hyb_win_hi) )
2118 XLAL_ERROR(
XLAL_EFUNC,
"Hybridization window for amplitude is not contained in ROM frequencies.");
2121 gsl_spline *PN_amp_spline = gsl_spline_alloc(gsl_interp_cspline, PN_amp->size);
2122 gsl_spline_init(PN_amp_spline, PN_freq->data, PN_amp->data, PN_amp->size);
2123 gsl_interp_accel *acc_PN = gsl_interp_accel_alloc();
2124 gsl_interp_accel *acc_ROM = gsl_interp_accel_alloc();
2125 double PN_amp_i = gsl_spline_eval(PN_amp_spline, f_hyb_win_lo, acc_PN);
2126 double ROM_amp_i = gsl_spline_eval(ampPhaseSplineData_for_mode->
spline_amp, f_hyb_win_lo, acc_ROM);
2127 double fac = ROM_amp_i / PN_amp_i;
2128 for (
size_t i=0;
i < PN_amp->size;
i++) {
2129 double A = gsl_vector_get(PN_amp,
i);
2130 gsl_vector_set(PN_amp,
i, A * fac);
2132 gsl_spline_free(PN_amp_spline);
2133 gsl_interp_accel_free(acc_PN);
2134 gsl_interp_accel_free(acc_ROM);
2136 gsl_vector *hyb_freq = NULL;
2137 gsl_vector *hyb_amp = NULL;
2139 &hyb_freq, &hyb_amp,
2142 f_hyb_win_lo, f_hyb_win_hi
2145 *hyb_spline = gsl_spline_alloc(gsl_interp_cspline, hyb_amp->size);
2146 gsl_spline_init(*hyb_spline, hyb_freq->data, hyb_amp->data, hyb_amp->size);
2148 gsl_vector_free(ROM_amp_f);
2149 gsl_vector_free(ROM_amp);
2150 gsl_vector_free(hyb_freq);
2151 gsl_vector_free(hyb_amp);
2157 gsl_spline **hyb_spline,
2158 REAL8* Deltat_align,
2159 REAL8* Deltaphi_align,
2161 gsl_vector *PN_freq,
2162 gsl_vector *PN_phase,
2163 double f_hyb_win_lo,
2167 gsl_vector *ROM_phi_f = NULL;
2168 gsl_vector *ROM_phi = NULL;
2172 if ( (gsl_vector_get(PN_freq, 0) > f_hyb_win_lo)
2173 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_lo)
2174 || (gsl_vector_get(PN_freq, 0) > f_hyb_win_hi)
2175 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_hi) )
2177 if ( (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_lo)
2178 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_lo)
2179 || (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_hi)
2180 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_hi) )
2183 gsl_vector *hyb_freq = NULL;
2184 gsl_vector *hyb_phase = NULL;
2186 &hyb_freq, &hyb_phase, Deltat_align, Deltaphi_align,
2189 f_hyb_win_lo, f_hyb_win_hi
2193 *hyb_spline = gsl_spline_alloc(gsl_interp_cspline, hyb_phase->size);
2194 gsl_spline_init(*hyb_spline, hyb_freq->data, hyb_phase->data, hyb_phase->size);
2196 gsl_vector_free(ROM_phi_f);
2197 gsl_vector_free(ROM_phi);
2198 gsl_vector_free(hyb_freq);
2199 gsl_vector_free(hyb_phase);
2205 gsl_spline **hyb_spline,
2207 gsl_vector *PN_freq,
2208 gsl_vector *PN_phase,
2209 double f_hyb_win_lo,
2210 double f_hyb_win_hi,
2211 REAL8 Deltat_22_align,
2212 REAL8 Deltaphi_22_align,
2216 gsl_vector *ROM_phi_f = NULL;
2217 gsl_vector *ROM_phi = NULL;
2221 if ( (gsl_vector_get(PN_freq, 0) > f_hyb_win_lo)
2222 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_lo)
2223 || (gsl_vector_get(PN_freq, 0) > f_hyb_win_hi)
2224 || (gsl_vector_get(PN_freq, PN_freq->size - 1) < f_hyb_win_hi) )
2226 if ( (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_lo)
2227 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_lo)
2228 || (gsl_vector_get(ROM_phi_f, 0) > f_hyb_win_hi)
2229 || (gsl_vector_get(ROM_phi_f, ROM_phi_f->size - 1) < f_hyb_win_hi) )
2232 gsl_vector *hyb_freq = NULL;
2233 gsl_vector *hyb_phase = NULL;
2235 &hyb_freq, &hyb_phase,
2238 f_hyb_win_lo, f_hyb_win_hi,
2239 Deltat_22_align, Deltaphi_22_align, modeM
2243 *hyb_spline = gsl_spline_alloc(gsl_interp_cspline, hyb_phase->size);
2244 gsl_spline_init(*hyb_spline, hyb_freq->data, hyb_phase->data, hyb_phase->size);
2246 gsl_vector_free(ROM_phi_f);
2247 gsl_vector_free(ROM_phi);
2248 gsl_vector_free(hyb_freq);
2249 gsl_vector_free(hyb_phase);
2259 UNUSED
REAL8 phiRef,
2261 UNUSED
REAL8 distance,
2262 UNUSED
REAL8 Mtot_sec,
2267 UNUSED
REAL8 deltaF,
2274 REAL8 sign_odd_modes,
2275 UNUSED SEOBNRROMdataDS *romdataset,
2282 REAL8 fLow = freqs_in->data[0];
2283 REAL8 fHigh = freqs_in->data[freqs_in->length - 1];
2285 REAL8 fLow_geom = fLow * Mtot_sec;
2286 REAL8 fHigh_geom = fHigh * Mtot_sec;
2287 REAL8 deltaF_geom = deltaF * Mtot_sec;
2292 if (fHigh_geom == 0)
2299 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);
2301 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);
2302 if (fLow_geom <= 0.0) {
2303 XLALPrintError(
"XLAL Error - %s: Starting frequency in REAL8Sequence must be positive.\n", __func__);
2310 ampPhaseSplineData,
q, chi1, chi2, nk_max,
nModes,romdataset);
2315 const double f_hyb_win_lo_fac = 1.01;
2316 const double f_hyb_win_hi_fac = 2.0;
2325 double PN_Mf_low = fmin(fLow_geom / 2.0,
Mf_low_21);
2326 double PN_Mf_high = 1.1 * f_hyb_win_hi_fac *
Mf_low_55;
2328 gsl_vector *Mfs = NULL;
2329 const double acc = 1
e-4;
2334 gsl_spline *hybrid_spline_amp[
nModes];
2335 gsl_spline *hybrid_spline_phi[
nModes];
2337 hybrid_spline_amp[
i] = NULL;
2338 hybrid_spline_phi[
i] = NULL;
2343 REAL8 Deltat_22_align = 0.;
2344 REAL8 Deltaphi_22_align = 0.;
2352 XLALPrintInfo(
"%s : SEOBNRv5HM_ROM hybridization window for (2,2) mode: Mf in [%g, %g]\n",
2353 __func__, f_hyb_win_lo, f_hyb_win_hi);
2357 gsl_vector *PNamp = NULL;
2358 gsl_vector *PNphase = NULL;
2362 retcode |=
TaylorF2Phasing(Mtot,
q, chi1, chi2, modeL, modeM, Mfs, &PNphase);
2364 gsl_vector_free(PNamp);
2365 gsl_vector_free(PNphase);
2366 gsl_vector_free(Mfs);
2375 if (!(modeL==2 && modeM==2)) {
2381 &hybrid_spline_phi[k],
2384 ampPhaseSplineData[k],
2386 f_hyb_win_lo, f_hyb_win_hi
2392 &hybrid_spline_phi[k],
2393 ampPhaseSplineData[k],
2395 f_hyb_win_lo, f_hyb_win_hi,
2396 Deltat_22_align, Deltaphi_22_align, modeM
2402 &hybrid_spline_amp[k],
2403 ampPhaseSplineData[k],
2405 f_hyb_win_lo, f_hyb_win_hi
2409 gsl_interp_accel *acc_amp = gsl_interp_accel_alloc();
2410 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);
2478 const REAL8 m1 = Mtot*
q/(1 +
q);
2479 const REAL8 m2 = Mtot/(1 +
q);
2486 XLAL_CHECK(
XLAL_SUCCESS == ret, ret,
"Failed to generate tidal amplitude series to construct SEOBNRv5_ROM_NRTidalv3 waveform.");
2492 if (f > Mf_max_mode)
continue;
2496 REAL8 A = gsl_spline_eval(hybrid_spline_amp[k], f, acc_amp);
2497 REAL8 phase = gsl_spline_eval(hybrid_spline_phi[k], f, acc_phase);
2498 hlmdata[j] = amp0*(A+ampT/sh) * (cos(phase) + I*sin(phase));
2500 COMPLEX16 t_factor = cos(phase_factor) + I*sin(phase_factor);
2501 hlmdata[j] *= t_factor;
2504 hlmdata[j] = pow(-1.0, modeL) * conj(hlmdata[j]);
2508 hlmdata[j] = hlmdata[j] * sign_odd_modes;
2515 double f = freqs->
data[
i];
2516 if (f > Mf_max_mode)
continue;
2520 REAL8 A = gsl_spline_eval(hybrid_spline_amp[k], f, acc_amp);
2521 REAL8 phase = gsl_spline_eval(hybrid_spline_phi[k], f, acc_phase);
2522 hlmdata[j] = amp0*A * (cos(phase) + I*sin(phase));
2524 COMPLEX16 t_factor = cos(phase_factor) + I*sin(phase_factor);
2525 hlmdata[j] *= t_factor;
2528 hlmdata[j] = pow(-1.0, modeL) * conj(hlmdata[j]);
2532 hlmdata[j] = hlmdata[j] * sign_odd_modes;
2542 gsl_interp_accel_free(acc_amp);
2543 gsl_interp_accel_free(acc_phase);
2544 gsl_vector_free(PNamp);
2545 gsl_vector_free(PNphase);
2550 gsl_vector_free(Mfs);
2554 gsl_spline_free(hybrid_spline_amp[k]);
2555 gsl_spline_free(hybrid_spline_phi[k]);
2600 UNUSED
struct tagCOMPLEX16FrequencySeries **hptilde,
2601 UNUSED
struct tagCOMPLEX16FrequencySeries **hctilde,
2602 UNUSED
REAL8 phiRef,
2603 UNUSED
REAL8 deltaF,
2607 UNUSED
REAL8 distance,
2608 UNUSED
REAL8 inclination,
2615 bool use_hybridization,
2620 REAL8 sign_odd_modes = 1.;
2624 REAL8 m1temp = m1SI;
2625 REAL8 chi1temp = chi1;
2630 sign_odd_modes = -1.;
2636 REAL8 Mtot = mass1+mass2;
2643 if (ModeArray == NULL) {
2658 freqs->
data[0] = fLow;
2659 freqs->
data[1] = fHigh;
2661 SEOBNRROMdataDS *romdataset;
2664#ifdef LAL_PTHREAD_LOCK
2685 if (use_hybridization) {
2687 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
2688 nModes, sign_odd_modes, romdataset, LALParams, NRTidal_version);
2692 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
2693 nModes, sign_odd_modes, romdataset);
2706 memset(hPlustilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2707 memset(hCrosstilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2714 (*hptilde) = hPlustilde;
2715 (*hctilde) = hCrosstilde;
2722 const char*
s = getenv(
"FREE_MEMORY_SEOBNRv5HMROM");
2724 for(
unsigned int index_mode = 0; index_mode <
nModes;index_mode++){
2740 UNUSED
struct tagCOMPLEX16FrequencySeries **hptilde,
2741 UNUSED
struct tagCOMPLEX16FrequencySeries **hctilde,
2743 UNUSED
REAL8 phiRef,
2745 UNUSED
REAL8 distance,
2746 UNUSED
REAL8 inclination,
2757 REAL8 sign_odd_modes = 1.;
2761 REAL8 m1temp = m1SI;
2762 REAL8 chi1temp = chi1;
2767 sign_odd_modes = -1.;
2773 REAL8 Mtot = mass1+mass2;
2780 if (ModeArray == NULL) {
2791 SEOBNRROMdataDS *romdataset;
2794#ifdef LAL_PTHREAD_LOCK
2816 double deltaF = 0.0;
2821 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
2822 nModes, sign_odd_modes, romdataset, LALParams, NRTidal_version);
2831 double fLow = freqs->
data[0];
2834 "hptilde: FD waveform", &tGPS, fLow, deltaF, &
lalStrainUnit, npts);
2836 "hctilde: FD waveform", &tGPS, fLow, deltaF, &
lalStrainUnit, npts);
2837 memset(hPlustilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2838 memset(hCrosstilde->data->data, 0, npts *
sizeof(
COMPLEX16));
2845 (*hptilde) = hPlustilde;
2846 (*hctilde) = hCrosstilde;
2852 const char*
s = getenv(
"FREE_MEMORY_SEOBNRv5HMROM");
2854 for(
unsigned int index_mode = 0; index_mode <
nModes;index_mode++){
2871 UNUSED
REAL8 phiRef,
2872 UNUSED
REAL8 deltaF,
2883 bool use_hybridization,
2888 REAL8 sign_odd_modes = 1.;
2892 REAL8 m1temp = m1SI;
2893 REAL8 chi1temp = chi1;
2898 sign_odd_modes = -1.;
2903 XLAL_PRINT_ERROR(
"Requested number of modes not available. Set nModes = 0 to get all the available modes.\n");
2910 REAL8 Mtot = mass1+mass2;
2921 freqs->
data[0] = fLow;
2922 freqs->
data[1] = fHigh;
2924 SEOBNRROMdataDS *romdataset;
2927#ifdef LAL_PTHREAD_LOCK
2946 UNUSED
UINT8 retcode;
2948 if (use_hybridization) {
2951 Mtot_sec,
q, chi1, chi2, freqs,
2952 deltaF, nk_max, 7, sign_odd_modes, romdataset, LALParams, NRTidal_version);
2955 Mtot_sec,
q, chi1, chi2, freqs,
2956 deltaF, nk_max,
nModes, sign_odd_modes, romdataset, LALParams, NRTidal_version);
2961 Mtot_sec,
q, chi1, chi2, freqs,
2962 deltaF, nk_max, 7, sign_odd_modes, romdataset);
2965 Mtot_sec,
q, chi1, chi2, freqs,
2966 deltaF, nk_max,
nModes, sign_odd_modes, romdataset);
2983 UNUSED
REAL8 phiRef,
2985 UNUSED
REAL8 distance,
2986 UNUSED
REAL8 inclination,
2997 REAL8 sign_odd_modes = 1.;
3001 REAL8 m1temp = m1SI;
3002 REAL8 chi1temp = chi1;
3007 sign_odd_modes = -1.;
3013 REAL8 Mtot = mass1+mass2;
3020 if (ModeArray == NULL) {
3031 SEOBNRROMdataDS *romdataset;
3034#ifdef LAL_PTHREAD_LOCK
3055 double deltaF = 0.0;
3060 phiRef, fRef, distance, Mtot_sec,
q, chi1, chi2, freqs, deltaF, nk_max,
3061 nModes, sign_odd_modes, romdataset, LALParams, NRTidal_version);
3067 const char*
s = getenv(
"FREE_MEMORY_SEOBNRv5HMROM");
3069 for(
unsigned int index_mode = 0; index_mode <
nModes;index_mode++){
3079 gsl_spline **spline_phi,
3080 gsl_interp_accel **acc_phi,
3095 double Mtot = mass1 + mass2;
3096 double q = mass1 / mass2;
3097 double eta = mass1 * mass2 / (Mtot*Mtot);
3102 if (
q > 100.0)
nudge(&
q, 100.0, 1
e-6);
3104 if ( chi1 < -0.998 || chi2 < -0.998 || chi1 > 0.998 || chi2 > 0.998) {
3105 XLALPrintError(
"XLAL Error - %s: chi1 or chi2 smaller than -0.998 or larger than 0.998!\n"
3106 "SEOBNRv5HMROM is only available for spins in the range -0.998 <= a/M <= 0.998.\n",
3111 if (q<1.0 || q > 100.0) {
3112 XLALPrintError(
"XLAL Error - %s: q (%f) bigger than 100.0 or unphysical!\n"
3113 "SEOBNRv5HMROM is only available for q in the range 1 <= q <= 100.\n",
3118 SEOBNRROMdataDS *romdataset;
3121#ifdef LAL_PTHREAD_LOCK
3134 ampPhaseSplineData,
q, chi1, chi2, nk_max,
nModes,romdataset);
3140 const double f_hyb_win_lo_fac = 1.01;
3141 const double f_hyb_win_hi_fac = 2.0;
3144 double PN_Mf_low = fmin(Mf_start / 2.0,
Mf_low_21);
3145 double PN_Mf_high = 1.1 * f_hyb_win_hi_fac *
Mf_low_55;
3147 gsl_vector *Mfs = NULL;
3148 const double acc = 1
e-4;
3153 gsl_spline *hybrid_spline_phi[
nModes];
3155 hybrid_spline_phi[
i] = NULL;
3160 REAL8 Deltat_22_align = 0.;
3161 REAL8 Deltaphi_22_align = 0.;
3168 XLALPrintInfo(
"%s : SEOBNRv5HM_ROM hybridization window for (2,2) mode: Mf in [%g, %g]\n",
3169 __func__, f_hyb_win_lo, f_hyb_win_hi);
3173 gsl_vector *PNphase = NULL;
3176 retcode |=
TaylorF2Phasing(Mtot,
q, chi1, chi2, modeL, modeM, Mfs, &PNphase);
3178 gsl_vector_free(PNphase);
3179 gsl_vector_free(Mfs);
3184 if (!(modeL==2 && modeM==2)) {
3190 &hybrid_spline_phi[k],
3193 ampPhaseSplineData[k],
3195 f_hyb_win_lo, f_hyb_win_hi
3199 *spline_phi = hybrid_spline_phi[0];
3200 *acc_phi = ampPhaseSplineData[0]->
acc_phi;
3238 double m1temp = m1SI;
3239 double chi1temp = chi1;
3247 gsl_spline *spline_phi;
3248 gsl_interp_accel *acc_phi;
3249 double Mf_final, Mtot_sec;
3254 &Mtot_sec, m1SI, m2SI, chi1, chi2, Mf,
3260 double t_corr = gsl_spline_eval_deriv(spline_phi, Mf_final, acc_phi) / (2*
LAL_PI);
3264 gsl_spline_free(spline_phi);
3265 gsl_interp_accel_free(acc_phi);
3267 "Min / max / final Mf values are %g, %g, %g\n", frequency, Mf,
Mf_ROM_min,
Mf_ROM_max, Mf_final);
3271 double time_M = gsl_spline_eval_deriv(spline_phi, frequency * Mtot_sec, acc_phi) / (2*
LAL_PI) - t_corr;
3273 *t = -1. * time_M * Mtot_sec;
3275 gsl_spline_free(spline_phi);
3276 gsl_interp_accel_free(acc_phi);
struct tagLALH5File LALH5File
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
int XLALSimNRTunedTidesFDTidalAmplitudeFrequencySeries(const REAL8Sequence *amp_tidal, const REAL8Sequence *fHz, REAL8 m1_SI, REAL8 m2_SI, REAL8 lambda1, REAL8 lambda2)
Function to call amplitude tidal series only; done for convenience to use for PhenomD_NRTidalv2 and S...
Auxiliary functions related to HDF5 waveform data files.
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 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, LALDict *LALParams, NRTidal_version_type NRTidal_version)
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 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 * XLALMalloc(size_t n)
void * XLALCalloc(size_t m, size_t n)
@ NRTidalv3_V
version NRTidalv3
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, LALDict *LALParams, NRTidal_version_type NRTidal_version)
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, NRTidal_version_type NRTidal_version)
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, NRTidal_version_type NRTidal_version)
Compute waveform modes at user specified frequencies for the SEOBNRv5HM_ROM model.
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, NRTidal_version_type NRTidal_version)
Compute waveform in LAL format 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.
#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)
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