LALInspiral 5.0.3.1-eeff03c
FindChirpPhenomWaveform.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Santamaria L, Krishnan B, Dias M, Parameswaran A
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
20/*-----------------------------------------------------------------------
21 *
22 * File Name: FindChirpSPData.c
23 *
24 * Author: Santamaria L, Krishnan B, Dias M, Parameswaran A
25 *
26 *
27 *-----------------------------------------------------------------------
28 */
29
30
31#include <lal/LALDatatypes.h>
32#include <lal/ComplexFFT.h>
33#include <lal/LALInspiral.h>
34#include <lal/LALInspiralBank.h>
35#include <lal/GeneratePPNInspiral.h>
36#include <lal/LALConfig.h>
37#include <lal/LALStdio.h>
38#include <lal/LALStdlib.h>
39#include <lal/LALError.h>
40#include <lal/LALDatatypes.h>
41#include <lal/AVFactories.h>
42#include <lal/NRWaveIO.h>
43#include <lal/NRWaveInject.h>
44#include <lal/FileIO.h>
45#include <lal/Units.h>
46#include <lal/FrequencySeries.h>
47#include <lal/TimeSeries.h>
48#include <lal/TimeFreqFFT.h>
49#include <lal/VectorOps.h>
50#include <lal/LALDetectors.h>
51#include <lal/ComplexFFT.h>
52
53#ifdef __cplusplus
54extern "C" {
55#pragma }
56#endif
57
58typedef struct tagPhenomCoeffs{
89}
91
92typedef struct tagPhenomParams{
103}
105
107 PhenomCoeffs *co);
108
111 PhenomCoeffs *coeffs,
112 REAL8 eta,
113 REAL8 M);
114
118 REAL8 fLow,
119 REAL8 df,
120 REAL8 eta,
121 REAL8 M,
122 UINT4 len );
123
127 REAL8 fLow,
128 REAL8 df,
129 REAL8 eta,
130 REAL8 M,
131 UINT4 len );
132
133REAL8
135 REAL8 freq,
136 REAL8 fRing,
137 REAL8 sigma );
138
139
140
141
142
143/**
144 * This function contains the coeffs from the matching with the LONG
145 * Jena waveforms (those are not the ones published in the paper)
146 */
147void
149 PhenomCoeffs *co)
150{
151 co->fMerg_a = 6.6389e-01; co->fMerg_b = -1.0321e-01; co->fMerg_c = 1.0979e-01;
152 co->fRing_a = 1.3278e+00; co->fRing_b = -2.0642e-01; co->fRing_c = 2.1957e-01;
153 co->sigma_a = 1.1383e+00; co->sigma_b = -1.7700e-01; co->sigma_c = 4.6834e-02;
154 co->fCut_a = 1.7086e+00; co->fCut_b = -2.6592e-01; co->fCut_c = 2.8236e-01;
155
156 co->psi0_x = -1.5829e-01; co->psi0_y = 8.7016e-02; co->psi0_z = -3.3382e-02;
157 co->psi2_x = 3.2967e+01; co->psi2_y = -1.9000e+01; co->psi2_z = 2.1345e+00;
158 co->psi3_x = -3.0849e+02; co->psi3_y = 1.8211e+02; co->psi3_z = -2.1727e+01;
159 co->psi4_x = 1.1525e+03; co->psi4_y = -7.1477e+02; co->psi4_z = 9.9692e+01;
160 co->psi6_x = 1.2057e+03; co->psi6_y = -8.4233e+02; co->psi6_z = 1.8046e+02;
161 co->psi7_x = -0.0000e+00; co->psi7_y = 0.0000e+00; co->psi7_z = 0.0000e+00;
162}
163
164
165REAL8
167 REAL8 freq,
168 REAL8 fRing,
169 REAL8 sigma )
170{
171 REAL8 out;
172
173 out = sigma / (2 * LAL_PI * ((freq - fRing)*(freq - fRing)
174 + sigma*sigma / 4.0));
175
176 return(out);
177}
178
179
180/** Computes effective phase as in arXiv:0710.2335 [gr-qc] */
184 REAL8 fLow,
185 REAL8 df,
186 REAL8 eta,
187 REAL8 M,
188 UINT4 n )
189{
190 UINT4 k;
191 REAL8 piM;
192 REAL8 f, psi0, psi2, psi3, psi4, psi6, psi7;
193 REAL8 softfLow, softfCut;
194
195 REAL4FrequencySeries *Phieff = NULL;
196
198
199 psi0 = params -> psi0;
200 psi2 = params -> psi2;
201 psi3 = params -> psi3;
202 psi4 = params -> psi4;
203 psi6 = params -> psi6;
204 psi7 = params -> psi7;
205
206 piM = LAL_PI * M * LAL_MTSUN_SI;
207
208 /* Allocate memory for the frequency series */
209 epoch.gpsSeconds = 0;
210 epoch.gpsNanoSeconds = 0;
211 Phieff =
213
214 /* We will soften the discontinuities of this function by multiplying it by
215 the function (1/4)[1+tanh(k(f-fLow))][1-tanh(k(f-fCut))] with k=1.0.
216 The step function is now a soft step. We estimate its width by requiring
217 that the step function at the new boundaries takes the value 0.001
218 Solving the eq. with Mathematica leads to a width = 3.45338, we take 3.5 */
219
220 softfLow = fLow - 3.5;
221 softfCut = params->fCut + 3.5;
222
223 f = 0.0;
224
225 for( k = 0 ; k < n ; k++ ) {
226
227 if ( f <= softfLow || f > softfCut ) {
228 Phieff->data->data[k] = 0.0;
229 }
230 else {
231
232 /* QUESTION: what happens with the 2*pi*f*t_0 and psi_0 terms? */
233 /* for the moment they're set to zero abd this seems to work */
234 /* (see Eq. (4.19) of the paper */
235
236 Phieff->data->data[k] = psi0 * pow(f*piM , -5./3.) +
237 psi2 * pow(f*piM , -3./3.) +
238 psi3 * pow(f*piM , -2./3.) +
239 psi4 * pow(f*piM , -1./3.) +
240 psi6 * pow(f*piM , 1./3.) +
241 psi7 * pow(f*piM , 2./3.);
242
243 Phieff->data->data[k] /= eta;
244 }
245 f += df;
246 }
247
248 return Phieff;
249}
250
251
255 REAL8 fLow,
256 REAL8 df,
257 REAL8 eta,
258 REAL8 M,
259 UINT4 n )
260{
261 UINT4 k;
262 REAL8 cConst;
263 REAL8 f, fNorm, fMerg, fRing, fCut, sigma;
264 REAL8 softfLow, softfCut, softFact;
265
266 REAL4FrequencySeries *Aeff = NULL;
267
269
270 INT4 sharpNess;
271
272 fMerg = params->fMerger;
273 fCut = params->fCut;
274 fRing = params->fRing;
275 sigma = params->sigma;
276
277 /* Set amplitude of the wave (Ajith et al. Eq. 4.17) */
278 cConst = pow(LAL_MTSUN_SI*M, 5./6.)*pow(fMerg,-7./6.)/pow(LAL_PI,2./3.);
279 cConst *= pow(5.*eta/24., 1./2.);
280
281 /* Allocate memory for the frequency series */
282 epoch.gpsSeconds = 0;
283 epoch.gpsNanoSeconds = 0;
284 Aeff =
286
287 f = 0.0;
288
289 /* We will soften the discontinuities of this function by multiplying it by
290 the function (1/4)[1+tanh(k(f-fLow))][1-tanh(k(f-fCut))] with k=1.0.
291 The step function is now a soft step. We estimate its width by requiring
292 that the step function at the new boundaries takes the value 0.001
293 Solving the eq. with Mathematica leads to a width = 3.45338, we take 3.5 */
294
295 softfLow = fLow - 3.5;
296 softfCut = fCut + 3.5;
297
298 sharpNess = 1;
299 for( k = 0 ; k < n ; k++ ) {
300
301 fNorm = f / fMerg;
302 softFact = (1+tanh(sharpNess*(f-fLow)))*(1-tanh(sharpNess*(f-fCut)))/4.;
303
304 if ( f <= softfLow || f > softfCut ) {
305 Aeff->data->data[k] = 0.0;
306 }
307 else if ( f > softfLow && f <= fMerg ) {
308 Aeff->data->data[k] = pow (fNorm, -7./6.);
309 Aeff->data->data[k] *= softFact;
310 }
311 else if ( f > fMerg && f <= fRing ) {
312 Aeff->data->data[k] = pow (fNorm, -2./3.);
313 Aeff->data->data[k] *= softFact;
314 }
315 else if ( f > fRing && f <= softfCut ) {
316 Aeff->data->data[k] = XLALLorentzian ( f, fRing, sigma);
317 Aeff->data->data[k] *= LAL_PI_2*pow(fRing/fMerg,-2./3.)*sigma;
318 Aeff->data->data[k] *= softFact;
319 }
320 Aeff->data->data[k] *= cConst;
321 f += df;
322 }
323
324 return Aeff;
325}
326
327
328void
331 PhenomCoeffs *coeffs,
332 REAL8 eta,
333 REAL8 M)
334{
335 REAL8 piM;
336 piM = LAL_PI * M * LAL_MTSUN_SI;
337
338 params->fMerger = (coeffs->fMerg_a * eta * eta + coeffs->fMerg_b * eta +
339 coeffs->fMerg_c)/piM;
340 params->fRing = (coeffs->fRing_a * eta * eta + coeffs->fRing_b * eta +
341 coeffs->fRing_c)/piM;
342 params->fCut = (coeffs->fCut_a * eta * eta + coeffs->fCut_b * eta +
343 coeffs->fCut_c)/piM;
344 params->sigma = (coeffs->sigma_a * eta * eta * coeffs->sigma_b * eta +
345 coeffs->sigma_c)/piM;
346
347 params->psi0 = coeffs->psi0_x * eta * eta + coeffs->psi0_y * eta +
348 coeffs->psi0_z ;
349 params->psi2 = coeffs->psi2_x * eta * eta + coeffs->psi2_y * eta +
350 coeffs->psi2_z ;
351 params->psi3 = coeffs->psi3_x * eta * eta + coeffs->psi3_y * eta +
352 coeffs->psi3_z ;
353 params->psi4 = coeffs->psi4_x * eta * eta + coeffs->psi4_y * eta +
354 coeffs->psi4_z ;
355 params->psi6 = coeffs->psi6_x * eta * eta + coeffs->psi6_y * eta +
356 coeffs->psi6_z ;
357 params->psi7 = coeffs->psi7_x * eta * eta + coeffs->psi7_y * eta +
358 coeffs->psi7_z ;
359
360 return;
361
362}
REAL4FrequencySeries * XLALHybridP1Phase(PhenomParams *params, REAL8 fLow, REAL8 df, REAL8 eta, REAL8 M, UINT4 len)
Computes effective phase as in arXiv:0710.2335 [gr-qc].
void GetPhenomCoeffsLongJena(PhenomCoeffs *co)
This function contains the coeffs from the matching with the LONG Jena waveforms (those are not the o...
REAL4FrequencySeries * XLALHybridP1Amplitude(PhenomParams *params, REAL8 fLow, REAL8 df, REAL8 eta, REAL8 M, UINT4 len)
void ComputeParamsFromCoeffs(PhenomParams *params, PhenomCoeffs *coeffs, REAL8 eta, REAL8 M)
REAL8 XLALLorentzian(REAL8 freq, REAL8 fRing, REAL8 sigma)
REAL4FrequencySeries * XLALCreateREAL4FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
#define LAL_PI_2
#define LAL_PI
#define LAL_MTSUN_SI
double REAL8
uint32_t UINT4
int32_t INT4
const LALUnit lalDimensionlessUnit
M
int n
REAL4Sequence * data
REAL4 * data
enum @1 epoch
double df