Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
MetricTestPTF.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Duncan Brown, Yi Pan
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 Duncan Brown, Yi Pan
22 * \file
23 *
24 * \brief Creates the PTF metric for a single point in the parameter space.
25 *
26 * ### Usage ###
27 *
28 *
29 * ### Description ###
30 *
31 *
32 * ### Algorithm ###
33 *
34 *
35 * ### Uses ###
36 *
37 * \code
38 * lalDebugLevel
39 * \endcode
40 *
41 * ### Notes ###
42 *
43 */
44
45#include <math.h>
46#include <stdlib.h>
47#include <stdio.h>
48#include <lal/LALInspiralBank.h>
49#include <lal/LALStdio.h>
50#include <lal/AVFactories.h>
51#include <lal/SeqFactories.h>
52
53
54int main( void )
55{
56 UINT4 i;
58 INT4 errcode;
59 InspiralMetric metric;
60 /* create memory for the full metric */
61 REAL8Vector *fullmetric;
62 InspiralTemplate tmplt;
64 void (*noisemodel)(LALStatus*,REAL8*,REAL8) = LALLIGOIPsd;
65 REAL8 deltaT = 1.0/16384.0;
66 UINT4 N = 16384;
67 REAL8 deltaF = 1.0/((REAL8)N * deltaT);
68
69
70 fullmetric = XLALCreateREAL8Vector( 45 );
71
72 memset( &status, 0, sizeof(LALStatus) );
73 memset( &tmplt, 0, sizeof(InspiralTemplate) );
74 memset( &metric, 0, sizeof(InspiralMetric) );
75
76 tmplt.massChoice = m1Andm2;
77 tmplt.mass1 = 5.0;
78 tmplt.mass2 = 1.4;
79 tmplt.chi = 0.8;
80 tmplt.kappa = 0.5;
81
82 tmplt.fLower=100.0;
83 tmplt.fCutoff = 1.0 / (2.0 * deltaT);
84 tmplt.tSampling = deltaT;
85
86 tmplt.sourceTheta = LAL_PI / 3.;
87 tmplt.sourcePhi = LAL_PI / 6.;
88 tmplt.polarisationAngle = LAL_PI / 4.;
89 tmplt.startPhase = 0.;
90 tmplt.startTime = 0.;
91 tmplt.signalAmplitude = 1.0;
92
94 if ( status.statusCode )
95 {
97 exit( 1 );
98 }
99
100 /* create memory for the PSD */
101 memset( &psd, 0, sizeof(REAL8FrequencySeries) );
102 LALDCreateVector( &status, &(psd.data), N / 2 + 1 );
103 if ( status.statusCode )
104 {
106 exit( 1 );
107 }
108
109 psd.deltaF = deltaF;
110
111 /* create a LIGO PSD */
112 LALNoiseSpectralDensity( &status, psd.data, noisemodel, psd.deltaF );
113 if ( status.statusCode )
114 {
116 exit( 1 );
117 }
118
119 errcode = XLALInspiralComputePTFIntrinsicMetric( &metric, fullmetric, &psd, &tmplt );
120 if ( errcode != XLAL_SUCCESS )
121 {
122 fprintf( stderr, "XLALInspiralComputePTFIntrinsticMetric failed\n" );
123 exit( 1 );
124 }
125
126 fprintf( stderr, "Printing out components of the projected metric in the intrinsic parameter space\n");
127 for ( i = 0; i < 10; ++i )
128 {
129 fprintf( stderr, "Gamma[%d] = %e\n", i, metric.Gamma[i] );
130 }
131
132 /* destory memory for the fullmetric */
133 XLALDestroyREAL8Vector( fullmetric );
134
135 return 0;
136}
void REPORTSTATUS(LALStatus *status)
void LALInspiralParameterCalc(LALStatus *status, InspiralTemplate *params)
int main(void)
Definition: MetricTestPTF.c:54
#define fprintf
double i
#define LAL_PI
double REAL8
uint32_t UINT4
int32_t INT4
@ m1Andm2
component masses
Definition: LALInspiral.h:179
INT4 XLALInspiralComputePTFIntrinsicMetric(InspiralMetric *metric, REAL8Vector *fullmetric, REAL8FrequencySeries *psd, InspiralTemplate *params)
void LALNoiseSpectralDensity(LALStatus *status, REAL8Vector *psd, void(*NoisePsd)(LALStatus *status, REAL8 *shf, REAL8 f), REAL8 df)
void LALLIGOIPsd(LALStatus UNUSED *status, REAL8 *psd, REAL8 f)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void XLALDestroyREAL8Vector(REAL8Vector *vector)
XLAL_SUCCESS
int N
Structure to store metric at various points the signal manifold.
REAL4 Gamma[10]
3d metric co-efficients in coordinates; Gamma[6] is a vector that stores the upper triangular part o...
The inspiral waveform parameter structure containing information about the waveform to be generated.
Definition: LALInspiral.h:205
REAL8 signalAmplitude
dimensionless amplitude of the signal (input, currently unused)
Definition: LALInspiral.h:220
REAL8 startTime
starting time of the waveform (in sec); if different from zero, the waveform will start with an insta...
Definition: LALInspiral.h:222
REAL8 mass1
Mass of the primary in solar mass (input/output)
Definition: LALInspiral.h:211
REAL8 startPhase
starting phase of the waveform in radians (input)
Definition: LALInspiral.h:221
REAL8 fCutoff
upper frequency cutoff in Hz to be used in generating the waveform; If the last stable orbit frequenc...
Definition: LALInspiral.h:213
REAL8 sourcePhi
Azimuth angle in the direction to the source.
Definition: LALInspiral.h:268
REAL8 polarisationAngle
Definition: LALInspiral.h:269
REAL8 mass2
Mass of the secondary in solar mass (mass1 need not be larger than mass2 (input/output)
Definition: LALInspiral.h:212
InputMasses massChoice
The pair of (mass) parameters given (see structure defining this member for more details) (input)
Definition: LALInspiral.h:323
REAL8 fLower
lower frequency cutoff of the detector in Hz (input)
Definition: LALInspiral.h:217
REAL8 chi
dimensionless spin of black hole (ie mass1)
Definition: LALInspiral.h:274
REAL8 tSampling
Sampling rate in Hz (input)
Definition: LALInspiral.h:218
REAL8 sourceTheta
Co-latitute in the direction to the source.
Definition: LALInspiral.h:267
REAL8 kappa
cosine of angle between spin of mass1 and orb ang mom
Definition: LALInspiral.h:275
REAL8Sequence * data
double deltaT