Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInspiral 5.0.3.1-6c6b863
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInspiralSetSearchLimits.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, Peter Shawhan, Craig Robinson , 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#include <lal/LALInspiralBank.h>
21#include <lal/LALStdlib.h>
22
23/**
24 * \ingroup LALInspiralBank_h
25 * \brief Function which calculates the minimum and maximum values of \f$\tau_{0}\f$ and \f$\tau_{3}\f$.
26 * \author Churches, D. K.
27 *
28 * This Function calculates the minimum and maximum values of \f$\tau_{0}\f$ and \f$\tau_{3}\f$
29 * as determined by the total mass of the binary \f$m\f$ and the symmetric
30 * mass ratio \f$\eta\f$. The function also calulates the coordinates of the
31 * first template in the bank. These coordinates are \f$\tau_{0}=\tau_{0min}\f$,
32 * \f$\tau_{3}=\tau_{3min}\f$.
33 *
34 * ### Description ###
35 *
36 * We start with the definition of the chirp times \f$\tau_{0}\f$ and \f$\tau_{3}\f$,
37 * \f{equation}{
38 * \tau_{0} = \frac{5}{256 (\pi f_{a} )^{8/3} m^{5/3} \eta}
39 * \f}
40 *
41 * and
42 *
43 * \f{equation}{
44 * \tau_{3} = \frac{1}{8 (\pi^{2} f_{a}^{5} )^{1/3} m^{2/3} \eta}
45 * \f}
46 *
47 * \f$\tau_{0}\f$ is minimised when \f$\eta=1/4\f$ and \f$\mathtt{m=MMax}\f$.
48 * \f$\tau_{0}\f$ is maximised when \f$\eta=1/4\f$ and \f$\mathtt{m=2mMin}\f$.
49 * \f$\tau_{3}\f$ is minimised when \f$\eta=1/4\f$ and \f$\mathtt{m=MMax}\f$.
50 * \f$\tau_{3}\f$ is maximised when
51 * \f$\eta=\mathtt{ mMin(MMax-mMin)/MMax^{2} }\f$.
52 */
53void
55 LALStatus *status, /**< LAL status pointer */
56 InspiralBankParams *bankParams, /**< [out] containing the boundary of search, current lattice point, etc. */
57 InspiralCoarseBankIn coarseIn /**< [in] specifies the parameters of the search space */
58 )
59
60{
61 InspiralTemplate *Pars1=NULL, *Pars2=NULL, *Pars3=NULL, *Pars4=NULL;
62
65
66 ASSERT( bankParams, status,
67 LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
68 ASSERT( coarseIn.space == Tau0Tau2 || coarseIn.space == Tau0Tau3, status,
69 LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
70 ASSERT( coarseIn.mMin > 0, status,
71 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
72 ASSERT( coarseIn.MMax >= 2. * coarseIn.mMin, status,
73 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
74 ASSERT( coarseIn.mmCoarse > 0., status,
75 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
76 ASSERT( coarseIn.mmCoarse < 1., status,
77 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
78 ASSERT( coarseIn.fLower > 0., status,
79 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
80 ASSERT( coarseIn.tSampling > 0., status,
81 LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
82
83 Pars1 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
84 Pars2 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
85 Pars3 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
86 Pars4 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
87
88 if ( ! Pars1 || ! Pars2 || ! Pars3 || !Pars4 )
89 {
90 ABORT( status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM );
91 }
92
93 /* Initiate three parameter vectors consistent with the coarseIn structure */
94 LALInspiralSetParams(status->statusPtr, Pars1, coarseIn);
96 LALInspiralSetParams(status->statusPtr, Pars2, coarseIn);
98 LALInspiralSetParams(status->statusPtr, Pars3, coarseIn);
100 LALInspiralSetParams(status->statusPtr, Pars4, coarseIn);
102
103 Pars1->massChoice = Pars2->massChoice = Pars3->massChoice = m1Andm2;
104 Pars4->massChoice = m1Andm2;
105
106 /* Calculate the value of the parameters at the three corners */
107 /* of the search space */
108 Pars1->mass1 = Pars1->mass2 = coarseIn.MMax/2.;
109 LALInspiralParameterCalc( status->statusPtr, Pars1 );
111
112 if ( coarseIn.massRange == MinMaxComponentTotalMass )
113 {
114 Pars2->mass1 = Pars2->mass2 = coarseIn.MMin/2.;
115 }
116 else
117 {
118 Pars2->mass1 = Pars2->mass2 = coarseIn.mMin;
119 }
120 LALInspiralParameterCalc( status->statusPtr, Pars2 );
122
123 Pars3->mass1 = coarseIn.mMin;
124 Pars3->mass2 = coarseIn.MMax - coarseIn.mMin;
125 LALInspiralParameterCalc( status->statusPtr, Pars3 );
127
128 if ( coarseIn.massRange == MinMaxComponentTotalMass )
129 {
130 Pars4->mass1 = coarseIn.mMin;
131 Pars4->mass2 = coarseIn.MMin - coarseIn.mMin;
132 LALInspiralParameterCalc( status->statusPtr, Pars4 );
134 }
135 else
136 {
137 Pars4->t0 = 0.0;
138 }
139
140 /* Find the minimum and maximum values of the parameters and set */
141 /* the search space. (The minimum values of chirp times are those */
142 /* corresponding to m1 = m2 = MMax/2, i.e., Pars1 structure. */
143 bankParams->x0 = bankParams->x0Min = Pars1->t0;
144 bankParams->x0Max = (Pars2->t0 > Pars4->t0) ? Pars2->t0 : Pars4->t0;
145
146 switch ( coarseIn.space )
147 {
148 case Tau0Tau2:
149 bankParams->x1 = bankParams->x1Min = Pars1->t2;
150 bankParams->x1Max = (Pars2->t2 > Pars3->t2) ? Pars2->t2 : Pars3->t2;
151 break;
152
153 case Tau0Tau3:
154 bankParams->x1 = bankParams->x1Min = Pars1->t3;
155 bankParams->x1Max = (Pars2->t3 > Pars3->t3) ? Pars2->t3 : Pars3->t3;
156 break;
157
158 default:
159 ABORT( status, LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
160 }
161
162 LALFree( Pars1 );
163 LALFree( Pars2 );
164 LALFree( Pars3 );
165 LALFree( Pars4 );
166
168 RETURN( status );
169}
void LALInspiralParameterCalc(LALStatus *status, InspiralTemplate *params)
#define LALCalloc(m, n)
#define LALFree(p)
#define ABORT(statusptr, code, mesg)
#define CHECKSTATUSPTR(statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
@ m1Andm2
component masses
Definition: LALInspiral.h:179
#define LALINSPIRALBANKH_ECHOICE
Invalid choice for an input parameter.
#define LALINSPIRALBANKH_ENULL
Null pointer.
void LALInspiralSetParams(LALStatus *status, InspiralTemplate *tempPars, InspiralCoarseBankIn coarseIn)
A routine that fills an InspiralTemplate structure based on the values in the InspiralCoarseBankIn st...
void LALInspiralSetSearchLimits(LALStatus *status, InspiralBankParams *bankParams, InspiralCoarseBankIn coarseIn)
Function which calculates the minimum and maximum values of and .
#define LALINSPIRALBANKH_ESIZE
Invalid input range.
#define LALINSPIRALBANKH_EMEM
Memory allocation failure.
@ MinMaxComponentTotalMass
@ Tau0Tau2
space of chirptimes
@ Tau0Tau3
space of chirptimes
This is a structure needed in the inner workings of the LALInspiralCreateCoarseBank code.
REAL8 x1Max
maximum value of the second coordinate as defined by the search region
REAL8 x1Min
minimum value of the second coordinate as defined by the search region
REAL8 x1
the second coordinate, chosen to be either or
REAL8 x0Min
minimum value of the first coordinate as defined by the search region
REAL8 x0Max
maximum value of the first coordinate as defined by the search region
REAL8 x0
the first coordinate, chosen to be always
Input for choosing a template bank.
REAL8 mMin
minimum mass of components to search for
InspiralBankMassRange massRange
enum that determines whether templates should be chosen using fixed ranges for component masses or to...
REAL8 tSampling
Sampling rate.
REAL8 MMax
alternatively, maximum total mass of binary to search for
REAL8 fLower
Lower frequency cutoff.
REAL8 mmCoarse
Coarse grid minimal match.
CoordinateSpace space
enum that decides whether to use or in constructing the template bank
REAL8 MMin
UNDOCUMENTED.
The inspiral waveform parameter structure containing information about the waveform to be generated.
Definition: LALInspiral.h:205
REAL8 t2
first post-Newtonian chirp time in seconds (input/output)
Definition: LALInspiral.h:295
REAL8 mass1
Mass of the primary in solar mass (input/output)
Definition: LALInspiral.h:211
REAL8 t3
1.5 post-Newtonian chirp time in seconds (input/output)
Definition: LALInspiral.h:296
REAL8 t0
Newtonain chirp time in seconds (input/output)
Definition: LALInspiral.h:294
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