Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALSimulation 6.2.0.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
PrecessWaveformEOBNRTest.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Chris Pankow, Evan Ochsner
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 * \author Chris Pankow
22 *
23 * \file
24 *
25 * \brief Testing constant precession code on EOBNRv2 waveform.
26 */
27
28#include <complex.h>
29
30#include <lal/LALSimInspiralPrecess.h>
31
32int main(void){
33
34 FILE* h_ref = fopen("h_ref_EOBNR.txt", "w");
35 FILE* h_rot = fopen("h_rot_EOBNR.txt", "w");
36 REAL8TimeSeries *hp = NULL, *hx = NULL;
37 int ret;
38 unsigned int i;
39
40 // Waveform parameters
41 REAL8 m1 = 2.0*LAL_MSUN_SI, m2 = 5.0*LAL_MSUN_SI;
42 REAL8 f_min = 40.0, f_ref = 0., dist = 1e6*LAL_PC_SI;
43 REAL8 dt = 1/16384.0;
44 REAL8 inclination = LAL_PI_4, psi = 0.;
45 int Lmax = 5;
46 LALDict *LALpars=XLALCreateDict();
48
49 // Parameters define a constant precession cone
50 REAL8 precess_freq = 10.; // Freq. of L's motion about cone (Hz)
51 REAL8 cone_opening = LAL_PI_4; // Opening angle of precession cone
52 REAL8 cone_azimuth = 0.; // Initial azimuthal angle of L on its cone
53 REAL8 J_azimuth = 0.;//azimuth btwn center of cone (J) and line of sight
54 REAL8 J_zenith = inclination; // zenith angle btwn J and line of sight
55
56 // Generate all available EOBNRv2 waveform modes
57 // These are the (2,2), (2,1), (3,3), (4,4), (5,5)
59 dt,
60 m1, m2,
61 0., 0., 0., 0., 0., 0.,
62 f_min, f_ref,
63 dist,
64 LALpars,
65 Lmax,
67 );
68
69 // Generate the unrotated polarizations from the modes
71 inclination, psi);
72 if( ret != XLAL_SUCCESS ) XLAL_ERROR( XLAL_EFUNC );
73
74 // Write out unrotated polarizations
75 REAL8 t0 = XLALGPSGetREAL8(&(hp->epoch));
76 for(i=0; i<hp->data->length; i++)
77 fprintf( h_ref, "%.16g %.16g %.16g\n", t0 + i * hp->deltaT,
78 hp->data->data[i], hx->data->data[i] );
79
80 // Transform waveform so L moves on a constant precession cone
82 &hp, &hx,
83 ts,
84 precess_freq,
85 cone_opening, cone_azimuth,
86 J_azimuth, J_zenith );
87 if( ret != XLAL_SUCCESS ) XLAL_ERROR( XLAL_EFUNC );
88
90
91 // Write out rotated waveform
92 for(i=0; i<hp->data->length; i++)
93 fprintf( h_rot, "%.16g %.16g %.16g\n", t0 + i * hp->deltaT,
94 hp->data->data[i], hx->data->data[i] );
95
96 // We're done.
97 XLALDestroyDict(LALpars);
100
101 fclose(h_ref);
102 fclose(h_rot);
103
104 return 0;
105}
void XLALDestroyDict(LALDict *dict)
LALDict * XLALCreateDict(void)
int main(void)
#define fprintf
double dt
Definition: bh_ringdown.c:113
double i
Definition: bh_ringdown.c:118
#define LAL_MSUN_SI
#define LAL_PC_SI
#define LAL_PI_4
double REAL8
int XLALSimInspiralPolarizationsFromSphHarmTimeSeries(REAL8TimeSeries **hp, REAL8TimeSeries **hc, SphHarmTimeSeries *hlms, REAL8 iota, REAL8 phiRef)
Compute the polarizations from all the -2 spin-weighted spherical harmonic modes stored in 'hlms'.
SphHarmTimeSeries * XLALSimInspiralChooseTDModes(UNUSED REAL8 phiRef, REAL8 deltaT, REAL8 m1, REAL8 m2, REAL8 S1x, REAL8 S1y, REAL8 S1z, REAL8 S2x, REAL8 S2y, REAL8 S2z, REAL8 f_min, REAL8 f_ref, REAL8 distance, LALDict *params, int lmax, Approximant approximant)
Interface to compute a set of -2 spin-weighted spherical harmonic modes for a binary inspiral for a g...
Approximant
Enum that specifies the PN approximant to be used in computing the waveform.
@ EOBNRv2HM
UNDOCUMENTED.
int XLALSimInspiralConstantPrecessionConeWaveform(REAL8TimeSeries **hp, REAL8TimeSeries **hx, SphHarmTimeSeries *h_lm, double precess_freq, double a, double phi_precess, double alpha_0, double beta_0)
Takes in the spherical harmonic decomposed modes as a strain time series and imposes the effect of a ...
void XLALDestroySphHarmTimeSeries(SphHarmTimeSeries *ts)
Delete list from current pointer to the end of the list.
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
#define XLAL_ERROR(...)
XLAL_SUCCESS
XLAL_EFUNC
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
REAL8Sequence * data
LIGOTimeGPS epoch
REAL8 * data
Structure to carry a collection of spherical harmonic modes in COMPLEX16 time series.
double f_min
Definition: unicorn.c:22