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
LALInspiralUpdateParams.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2007 David Churches, Duncan Brown, 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#include <lal/LALInspiralBank.h>
21
22/**
23 * \ingroup LALInspiralBank_h
24 * \brief Function to update the parameters used in creating a coarse bank based on a square lattice.
25 * \author Sathyaprakash, B. S., T. Cokelaer
26 *
27 * While scanning the \f$\tau_0\f$-direction after reaching the
28 * boundary of the parameter space, we have to return to the
29 * starting point of the same line and use the metric there
30 * to increment one step upwards in the direction of \f$\tau_{2(3)}.\f$
31 * to a <em>template list</em>.
32 *
33 * The \f$dx_i\f$ returned by this function gives the spacing for a
34 * square lattice (e.g., \f$dx_i\f$ as given in \cite Owen_96 .
35 *
36 * ### Algorithm ###
37 *
38 * Copy the parameters in the temporary parameter structure
39 * to the current parameter structure.
40 */
41void LALInspiralUpdateParams(LALStatus *status, /**< LAL status pointer */
42 InspiralBankParams *bankParams, /**< [out] refreshed to get the next location */
43 InspiralMetric metric, /**< [in] metric at the current location */
44 REAL8 minimalmatch /**< [in] the minimal match */
45 )
46{
47 REAL8 dx0, dx1, myphi, theta, fac;
48
51 ASSERT (bankParams, status, LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL);
52 ASSERT (metric.g00 > 0, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
53 ASSERT (metric.g11 > 0, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
54 ASSERT (minimalmatch < 1., status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
55 ASSERT (minimalmatch > 0., status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
56 ASSERT (metric.theta < LAL_PI_2, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
57 ASSERT (metric.theta > -LAL_PI_2, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
58
59 /* This dx0, dx1 are linked to a square placement only !! */
60 dx0 = sqrt(2.L * (1.L - minimalmatch)/metric.g00 );
61 dx1 = sqrt(2.L * (1.L - minimalmatch)/metric.g11 );
62
63 if (metric.theta==0.L)
64 {
65 bankParams->dx0 = dx0;
66 bankParams->dx1 = dx1;
67 }
68 else
69 {
70 myphi = atan2(dx1, dx0);
71 theta = fabs(metric.theta);
72 if (theta <= myphi) {
73 fac = cos(theta);
74 bankParams->dx0 = dx0 / fac;
75 bankParams->dx1 = dx1 * fac;
76 }
77 else {
78 fac = sin(theta);
79 bankParams->dx0 = dx1 / fac;
80 bankParams->dx1 = dx0 * fac;
81 }
82 }
83
86
87}
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
double theta
#define LAL_PI_2
double REAL8
void LALInspiralUpdateParams(LALStatus *status, InspiralBankParams *bankParams, InspiralMetric metric, REAL8 minimalMatch)
Function to update the parameters used in creating a coarse bank based on a square lattice.
#define LALINSPIRALBANKH_ENULL
Null pointer.
#define LALINSPIRALBANKH_ESIZE
Invalid input range.
This is a structure needed in the inner workings of the LALInspiralCreateCoarseBank code.
REAL8 dx0
increment in the x0-direction
REAL8 dx1
increment in the x1-direction
Structure to store metric at various points the signal manifold.
REAL8 g11
11-component of the diagonalised metric
REAL8 g00
00-component of the diagonalised metric
REAL8 theta
Angle from tau0 to semi-major axis of the ellipse.