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
MetricTestBCV.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 Bernd Machenschalk, Jolien Creighton, B.S. Sathyaprakash, Thomas Cokelaer
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 B.S. Sathyaprakash
22 * \file
23 *
24 * \brief Creates a template mesh for BCV (or, alternatively, for SPA but
25 * assuing a constant metric) using the mismatch metric.
26 *
27 * ### Usage ###
28 *
29 *
30 * ### Description ###
31 *
32 *
33 * ### Algorithm ###
34 *
35 *
36 * ### Uses ###
37 *
38 * \code
39 * lalDebugLevel
40 * \endcode
41 *
42 * ### Notes ###
43 *
44 */
45
46#include <stdio.h>
47#include <lal/LALInspiralBank.h>
48#include <lal/LALNoiseModels.h>
49#include <lal/AVFactories.h>
50
51
52int
53main ( void )
54{
55 InspiralMetric metric;
56 static LALStatus status;
59 void (*noisemodel)(LALStatus*,REAL8*,REAL8) = LALLIGOIPsd;
60 UINT4 numPSDpts = 65536;
61 REAL8 tSampling;
62 REAL8 mismatch;
63 FILE *fpr;
64 fpr = fopen("MetricTestBCV.out", "w");
65
66 mismatch = 0.03;
68
69 params->alpha = 0.L;
70 params->fLower = 30;
71 params->fCutoff = 400;
72
73 tSampling = 4096.L;
74
75 memset( &(psd), 0, sizeof(REAL8FrequencySeries) );
76 psd.f0 = 0;
77 LALDCreateVector(&status, &(psd.data), numPSDpts );
78 psd.deltaF = tSampling / (2.L*(REAL8) psd.data->length + 1.L);
79 LALNoiseSpectralDensity (&status, psd.data, noisemodel, psd.deltaF );
80
82
83 fprintf(fpr, "#%e %e %e\n", metric.G00, metric.G01, metric.G11);
84 fprintf(fpr, "#%e %e %e\n", metric.g00, metric.g11, metric.theta);
85 fprintf(fpr, "#dp0=%e dp1=%e\n", sqrt (mismatch/metric.G00), sqrt (mismatch/metric.G11));
86 fprintf(fpr, "#dP0=%e dP1=%e\n", sqrt (mismatch/metric.g00), sqrt (mismatch/metric.g11));
87
88
89 {
90 double MM;
91 double dp0, dp1;
92 long n=100;
93 double dp0min=-5750;
94 double dp0max=5750;
95 double dp1min=-220;
96 double dp1max=220;
97 double d0=(dp0max-dp0min)/(double)n;
98 double d1=(dp1max-dp1min)/(double)n;
99 for ( dp0= dp0min; dp0<=dp0max ; dp0+=d0)
100 {
101 for ( dp1= dp1min; dp1<=dp1max ; dp1+=d1)
102 {
103 MM = 1. - (metric.G00 * dp0 * dp0 + metric.G01 * dp0 * dp1
104 + metric.G01 * dp1 * dp0 + metric.G11 * dp1 * dp1);
105 fprintf(fpr, "%f %f %f\n", dp0, dp1, MM);
106 }
107 fprintf(fpr, "\n");
108 }
109 }
110 fclose(fpr);
112 LALDDestroyVector(&status, &(psd.data) );
114 return 0;
115
116}
void LALCheckMemoryLeaks(void)
#define LALMalloc(n)
#define LALFree(p)
int main(void)
Definition: MetricTestBCV.c:53
#define fprintf
double REAL8
uint32_t UINT4
void LALInspiralComputeMetricBCV(LALStatus *status, InspiralMetric *metric, REAL8FrequencySeries *psd, InspiralTemplate *params)
UNDOCUMENTED.
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)
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
int n
Structure to store metric at various points the signal manifold.
REAL8 g11
11-component of the diagonalised metric
REAL8 G01
01-component of the metric in coordinates
REAL8 g00
00-component of the diagonalised metric
REAL8 theta
Angle from tau0 to semi-major axis of the ellipse.
REAL8 G00
00-component of the metric in coordinates
REAL8 G11
11-component of the metric in coordinates
The inspiral waveform parameter structure containing information about the waveform to be generated.
Definition: LALInspiral.h:205
REAL8Sequence * data