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
PrecessWaveformTest.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 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 TaylorT1 waveform.
26 */
27
28
29#include <lal/LALSimInspiralPrecess.h>
30
31int main(void){
32
33 FILE* h_ref = fopen("h_ref.txt", "w");
34 FILE* h_rot = fopen("h_rot.txt", "w");
35 REAL8TimeSeries *hp = NULL, *hx = NULL;
36
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 waveform modes
58 dt,
59 m1, m2,
60 0., 0., 0., 0., 0., 0.,
61 f_min, f_ref,
62 dist,
63 LALpars,
64 Lmax,
66 );
67
68 // Generate the unrotated polarizations from the modes
70 inclination, psi);
71 if( ret != XLAL_SUCCESS ) XLAL_ERROR( XLAL_EFUNC );
72
73 // Write out unrotated polarizations
74 REAL8 t0 = XLALGPSGetREAL8(&(hp->epoch));
75 for(i=0; i<hp->data->length; i++)
76 fprintf( h_ref, "%.16g %.16g %.16g\n", t0 + i * hp->deltaT,
77 hp->data->data[i], hx->data->data[i] );
78
79 // Transform waveform so L moves on a constant precession cone
81 &hp, &hx,
82 ts,
83 precess_freq,
84 cone_opening, cone_azimuth,
85 J_azimuth, J_zenith );
86 if( ret != XLAL_SUCCESS ) XLAL_ERROR( XLAL_EFUNC );
87
89
90 // Write out rotated waveform
91 for(i=0; i<hp->data->length; i++)
92 fprintf( h_rot, "%.16g %.16g %.16g\n", t0 + i * hp->deltaT,
93 hp->data->data[i], hx->data->data[i] );
94
95 // We're done.
96 XLALDestroyDict(LALpars);
99
100 fclose(h_ref);
101 fclose(h_rot);
102
103 return 0;
104}
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.
@ TaylorT1
Time domain Taylor approximant in which the energy and flux are both kept as Taylor expansions and a ...
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