LALSimulation  5.4.0.1-fe68b98
LALSimIMRPhenomXHM_multiband.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Cecilio García Quirós, Sascha Husa
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with with program; see the file COPYING. If not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19  /* This code applies the multibanding technique described in arXiv:2001.10897 to the model IMRPhenomXHM described in arXiv:2001.10914. */
20 
21 #ifndef _LALSIM_IMR_PHENOMXHM_MULTIBAND_H
22 #define _LALSIM_IMR_PHENOMXHM_MULTIBAND_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26  #endif
27  #ifdef __GNUC__
28  #define UNUSED __attribute__ ((unused))
29  #else
30  #define UNUSED
31  #endif
32 
34 
35 /*** Core functions to call the waveform with multibanding ***/
37  COMPLEX16FrequencySeries **htildelm, /**< [out] FD waveform **/
38  IMRPhenomXWaveformStruct *pWF, /**< Structure of 22 mode **/
39  UINT4 ell, /**< First index (l,m) mode **/
40  UINT4 emm, /**< Second incex (l,m) mode **/
41  LALDict *lalParams /**< LAL dictionary **/
42 );
43 
45  COMPLEX16FrequencySeries **htildelm, /**< [out] FD waveform */
46  COMPLEX16FrequencySeries *htilde22, /**< Recycle the 22 mode if previously computed **/
47  IMRPhenomXWaveformStruct *pWF, /**< Structure of 22 mode **/
48  UINT4 ell, /**< First index (l,m) mode **/
49  UINT4 emm, /**< Second incex (l,m) mode **/
50  LALDict *lalParams /**< LAL dictionary **/
51 );
52 
53 /*** Set up frequency array and initialize amplitude/phase frequency series ***/
54 static int SetupWFArraysReal(
55  REAL8Sequence **freqs, /**<[out] Frequency array to evaluate model **/
56  REAL8FrequencySeries **amphase, /**<[out] Initialize amplitude or phase with the length of freqs **/
57  const REAL8Sequence *freqs_In, /**< Input frequency array or fmin, fmax **/
58  IMRPhenomXWaveformStruct *pWF, /**< Structure of the 22 mode **/
59  LIGOTimeGPS ligotimegps_zero /**< Needed to initialize amphase **/
60 );
61 
62 /*** Functions to compute coarse amplitude and phase ***/
63 
65  REAL8FrequencySeries **amplm, /**<[out] amplitude of hlm mode **/
66  const REAL8Sequence *freqs_In, /**< Frequency array to evaluate model or fmin, fmax **/
67  IMRPhenomXWaveformStruct *pWF, /**< Structure of the 22 mode **/
68  IMRPhenomXAmpCoefficients *pAmp22, /**< Amplitude coefficients 22 */
69  IMRPhenomXPhaseCoefficients *pPhase22, /**< Phase coefficients 22 */
70  IMRPhenomXHMWaveformStruct *pWFHM, /**< waveform parameters lm mode */
71  IMRPhenomXHMAmpCoefficients *pAmp, /**< Amplitude coefficients lm */
72  IMRPhenomXHMPhaseCoefficients *pPhase /**< Phase coefficients 22 */
73 );
74 
76  REAL8FrequencySeries **amplm, /**<[out] amplitude of hlm mode **/
77  const REAL8Sequence *freqs_In, /**< Frequency array to evaluate model or fmin, fmax **/
78  IMRPhenomXWaveformStruct *pWF, /**< Structure of the 22 mode **/
79  IMRPhenomXHMWaveformStruct *pWFHM, /**< waveform parameters lm mode */
80  IMRPhenomXHMAmpCoefficients *pAmp, /**< Amplitude coefficients lm */
81  IMRPhenomXHMPhaseCoefficients *pPhase /**< Phase coefficients 22 */
82 );
83 
84 static int IMRPhenomXHM_Phase(
85  REAL8FrequencySeries **phaselm, /**<[out] phase of hlm mode **/
86  const REAL8Sequence *freqs_In, /**< Frequency array to evaluate model or fmin, fmax **/
87  IMRPhenomXWaveformStruct *pWF, /**< Structure of the 22 mode **/
88  IMRPhenomXAmpCoefficients *pAmp22, /**< Amplitude coefficients 22 */
89  IMRPhenomXPhaseCoefficients *pPhase22, /**< Phase coefficients 22 */
90  IMRPhenomXHMWaveformStruct *pWFHM, /**< waveform parameters lm mode */
91  IMRPhenomXHMAmpCoefficients *pAmp, /**< Amplitude coefficients lm */
92  IMRPhenomXHMPhaseCoefficients *pPhase /**< Phase coefficients 22 */
93 );
94 
96  REAL8FrequencySeries **phaselm, /**<[out] phase of hlm mode **/
97  const REAL8Sequence *freqs_In, /**< Frequency array to evaluate model or fmin, fmax **/
98  IMRPhenomXWaveformStruct *pWF, /**< Structure of the 22 mode **/
99  IMRPhenomXHMWaveformStruct *pWFHM, /**< waveform parameters lm mode */
100  IMRPhenomXHMPhaseCoefficients *pPhase /**< Phase coefficients 22 */
101 );
102 
103 /* Log function */
104 static double logbase(double base, double x);
105 
106 
107 /**** Multibanding grids ****/
108 
109 typedef struct tagIMRPhenomXMultiBandingGridStruct
110 {
111  /* Debug flag */
113 
114  /* Model Version Parameters */
118 
124 
126 
127 /* Equally spaced grid */
129  REAL8 fSTART, /**< Starting frequency of the uniform bin **/
130  REAL8 fEND, /**< Ending frequency of the uniform bin **/
131  REAL8 mydf /**< Frequency spacing of the bin **/
132 );
133 
134 /* Non-uniform spaced grid */
136  REAL8 fstartIn, /**< Minimun frequency in NR unit s**/
137  REAL8 fend, /**< End of inspiral frequency bins **/
138  REAL8 MfLorentzianEnd, /**< Determines the last frequency bin **/
139  REAL8 Mfmax, /**< Maximun frequency in NR units **/
140  REAL8 evaldMf, /**< Spacing of the uniform frequency grid (NR units) **/
141  REAL8 dfpower, /**< decaying frequency power to estimate frequency spacing **/
142  REAL8 dfcoefficient, /**< multiplying factor to the estimate of the frequency spacing **/
143  IMRPhenomXMultiBandingGridStruct *allGrids, /**<[out] list of non-uniform frequency bins**/
144  REAL8 dfmerger, /**<[out] Spacing merger bin**/
145  REAL8 dfringdown /**<[out] Spacing ringdown bin**/
146 );
147 
148 /**** Interpolating functions ****/
150  double *fineAmp, /**<[out] amplitude in the fine uniform grid **/
151  double coarsefreqs[], /**< non-uniform frequency array**/
152  double coarseAmp[], /**< amplitude in the non-uniform frequency array **/
153  double finefreqs[], /**< uniform fine frequency grid**/
154  int lengthCoarse, /**< length of non-uniform freq array **/
155  int lengthFine, /**< length of uniform fine freq array **/
156  int ampinterpolorder /**< order of the gsl interpolation **/
157 );
158 
160  double *fineAmp, /**<[out] amplitude in the fine uniform grid **/
161  double *fineAmpSS, /**<[out] spheroidal amplitude in the fine uniform grid **/
162  double coarsefreqs[], /**< non-uniform frequency array**/
163  double coarsefreqsSS[], /**< non-uniform frequency array spheroidal **/
164  double coarseAmp[], /**< amplitude in the non-uniform frequency array **/
165  double coarseAmpSS[], /**< spheroidal amplitude in the non-uniform frequency array **/
166  double finefreqs[], /**< uniform fine frequency grid**/
167  int lengthCoarse, /**< length of non-uniform freq array **/
168  int lengthCoarseSS, /**< length of non-uniform freq array Sphroidal **/
169  int lengthFine, /**< length of uniform fine freq array **/
170  int sphericalfinecount, /**< length of spherical fine grid **/
171  int sphericalfinecountMax, /**< length of spherical fine grid **/
172  int ampinterpolorder /**< order of interpolation **/
173 );
174 
175 static double deltaF_mergerBin(REAL8 fdamp, REAL8 alpha4, REAL8 abserror);
176 static double deltaF_ringdownBin(REAL8 fdamp, REAL8 alpha4, REAL8 LAMBDA, REAL8 abserror);
177 
179 
180  #ifdef __cplusplus
181 }
182 #endif
183 
184 #endif /* LALSimIMRPhenomXHM_multiband_h */
static double fdamp(double eta, double chi1, double chi2, double finspin)
fdamp is the complex part of the ringdown frequency 1508.07250 figure 9
static double deltaF_ringdownBin(REAL8 fdamp, REAL8 alpha4, REAL8 LAMBDA, REAL8 abserror)
static int interpolateAmplitudeMixing(double *fineAmp, double *fineAmpSS, double coarsefreqs[], double coarsefreqsSS[], double coarseAmp[], double coarseAmpSS[], double finefreqs[], int lengthCoarse, int lengthCoarseSS, int lengthFine, int sphericalfinecount, int sphericalfinecountMax, int ampinterpolorder)
INT4 XLALSimIMRPhenomXMultibandingGrid(REAL8 fstartIn, REAL8 fend, REAL8 MfLorentzianEnd, REAL8 Mfmax, REAL8 evaldMf, REAL8 dfpower, REAL8 dfcoefficient, IMRPhenomXMultiBandingGridStruct *allGrids, REAL8 dfmerger, REAL8 dfringdown)
INT4 deltaF_MergerRingdown(REAL8 *dfmerger, REAL8 *dfringdown, REAL8 resTest, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
static int IMRPhenomXHM_AmplitudeMixing(REAL8FrequencySeries **amplm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
static double logbase(double base, double x)
static int interpolateAmplitude(double *fineAmp, double coarsefreqs[], double coarseAmp[], double finefreqs[], int lengthCoarse, int lengthFine, int ampinterpolorder)
static int IMRPhenomXHM_PhaseMixing(REAL8FrequencySeries **phaselm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMPhaseCoefficients *pPhase)
static int SetupWFArraysReal(REAL8Sequence **freqs, REAL8FrequencySeries **amphase, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, LIGOTimeGPS ligotimegps_zero)
IMRPhenomXMultiBandingGridStruct XLALSimIMRPhenomXGridComp(REAL8 fSTART, REAL8 fEND, REAL8 mydf)
static double deltaF_mergerBin(REAL8 fdamp, REAL8 alpha4, REAL8 abserror)
static int IMRPhenomXHM_Amplitude(REAL8FrequencySeries **amplm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
static int IMRPhenomXHM_Phase(REAL8FrequencySeries **phaselm, const REAL8Sequence *freqs_In, IMRPhenomXWaveformStruct *pWF, IMRPhenomXAmpCoefficients *pAmp22, IMRPhenomXPhaseCoefficients *pPhase22, IMRPhenomXHMWaveformStruct *pWFHM, IMRPhenomXHMAmpCoefficients *pAmp, IMRPhenomXHMPhaseCoefficients *pPhase)
int IMRPhenomXHMMultiBandOneModeMixing(COMPLEX16FrequencySeries **htildelm, COMPLEX16FrequencySeries *htilde22, IMRPhenomXWaveformStruct *pWF, UINT4 ell, UINT4 emm, LALDict *lalParams)
int IMRPhenomXHMMultiBandOneMode(COMPLEX16FrequencySeries **htildelm, IMRPhenomXWaveformStruct *pWF, UINT4 ell, UINT4 emm, LALDict *lalParams)
double REAL8
uint32_t UINT4
int32_t INT4