LALInspiralComputeMetric.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, Peter Shawhan, B.S. Sathyaprakash, Anand Sengupta, Thomas Cokelaer
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 /*  <lalVerbatim file="LALInspiralComputeMetricCV">
00021 Author: Churches, D. K., Cokelaer, T., Sathyaprakash, B. S.
00022 $Id: LALInspiralComputeMetric.c,v 1.27 2008/03/05 12:02:19 thomas Exp $
00023 </lalVerbatim>  */
00024 
00025 
00026 /*  <lalLaTeX>
00027 
00028 \subsection{Module \texttt{LALInspiralComputeMetric.c}}
00029 
00030 Module to compute the components of the metric which is used 
00031 to describe distances on the signal manifold.
00032 
00033 \subsubsection*{Prototypes}
00034 \vspace{0.1in}
00035 \input{LALInspiralComputeMetricCP}
00036 \idx{LALInspiralComputeMetric()}
00037 \begin{itemize}
00038    \item \texttt{metric,} Output, the metric at the lattice point defined by \texttt{params}
00039    \item \texttt{params,} Input, the parameters where metric must be computed
00040    \item \texttt{moments,} Input, moments $J(1), \ldots, J(17),$ of the PSD and other constants needed
00041    in the computation of the metric.
00042 \end{itemize}
00043 
00044 \subsubsection*{Description}
00045 We calculate the components of the metric using the procedure outlined 
00046 in Owen \cite{Owen:96}. 
00047 This uses the moments of the noise curve,
00048 \begin{equation}
00049 I(q) \equiv S_{h}(f_{0}) \int^{f_{c}/f_{0}}_{f_{s}/f_{0}} \frac{x^{-q/3}}{S_{h}(x)}
00050 \, dx
00051 \end{equation}
00052 and
00053 \begin{equation}
00054 J(q) \equiv \frac{I(q)}{I(7)} \,.
00055 \end{equation}
00056 (Please note that the function {\tt LALInspiralMoments} doesn't compute $I(q)$ defined 
00057 here; the index $q$ is definted differently there and the normalisation is supplied by the user.
00058 For ease of writing, here we shall follow the standard notation.)
00059 Then the moment functional $\mathcal{J}$ is defined such that, for a function $a$,
00060 \begin{equation}
00061 \mathcal{J} [a] \equiv \frac{1}{I(7)} \int^{f_{c}/f_{0}}_{f_{s}/f_{0}} \frac{x^{-7/3}}{S_{h}(x)}
00062 a(x) \, dx
00063 \end{equation}
00064 which gives us
00065 \begin{equation}
00066 \mathcal{J} = \left[ \sum_{n} a_{n} x^{n} \right] = \sum_{n} a_{n} J(7-3n).
00067 \end{equation}
00068 The above equation is used to calculate the components of the metric using the following formula:
00069 \begin{equation}
00070 \gamma_{\alpha \beta} = \frac{1}{2} \left( \mathcal{J} [ \psi_{\alpha} \psi_{\beta} ] -
00071 \mathcal{J} [ \psi_{\alpha} ] \mathcal{J} [ \psi_{\beta} ] \right)
00072 \end{equation}
00073 where $\psi_\alpha$ is the derivative of the Fourier phase of the inspiral waveform
00074 with respect to the parameter $\lambda^\alpha,$ that is
00075 $\psi_\alpha \equiv \Psi_{,\alpha}.$  Writing the derivative index as
00076 $\alpha=0,j,$ with $j=1,\ldots,n$ we have 
00077 \begin{equation}
00078 \psi_{0} \equiv 2 \pi f, \ \ \ 
00079 \psi_{j} \equiv \frac{\partial \Delta \Psi}{\partial \Delta \lambda^{j}}.
00080 \end{equation}
00081 The phase $\Psi$ is that which appears in the usual stationary-phase formula for
00082 the Fourier transform:
00083 \begin{equation}
00084 \tilde{h}(f)  \propto f^{-7/6} e^{i[-\pi/4 - \Phi_{0} + 2 \pi f t_{0} + \Psi(f;\vec{\lambda}]}.
00085 \end{equation}
00086 If we take the usual chirp times and multiply each by $(\pi f_{0})$ then we get
00087 \emph{dimensionless
00088 chirp times} $\tau_{k}$, and then the phase $\Psi$ may be written in the form
00089 \begin{equation}
00090 \Psi = 2 \pi f t_{c} + \sum_{k} \Psi_{k}(f) \tau_{k}
00091 \end{equation}
00092 where, defining $v_0 = (\pi m f_0)^{1/3}$ ($m$ being total mass and $f_0$ a
00093 fiducial starting frequency), the chirptimes $\tau_{k},$ up to 2nd PN order,
00094 are given by
00095 $$
00096 \tau_{0} = \frac{5}{256 \eta v_{0}^{5}},\ \ 
00097 \tau_{2} = \frac{5}{192 \eta v_{0}^{3}} \left( \frac{743}{336} + \frac{11}{4} \eta \right),
00098 $$
00099 \begin{equation}
00100 \tau_{3} = \frac{\pi}{8 \eta v_{0}^{2}},\ \ 
00101 \tau_{4} = \frac{5}{128 \eta v_{0}} \left( \frac{3\,058\,673}{1\,016\,064} + \frac{5429}{1008}
00102 \eta +
00103 \frac{617}{144} \eta^{2} \right).
00104 \end{equation}
00105 Up to second post-Newtonian approximation the $\Psi_{k}$ are given by
00106 \begin{equation}
00107 \Psi_{0} = \frac{6}{5 \nu^{5/3}},\ \ 
00108 \Psi_{2} = \frac{2}{\nu},\ \ 
00109 \Psi_{3} = - \frac{3}{\nu^{2/3}},\ \ 
00110 \Psi_{4} = \frac{6}{\nu^{1/3}}.
00111 \end{equation}
00112 where $\nu = f/f_{0}$.
00113 
00114 If we now make the substitution $f = v^{3}/\pi m$ we then the find that the phase may be
00115 expressed in a simpler form
00116 \begin{equation}
00117 \Psi(v) = 2 \pi f t_{c} + \sum_{k} \theta_{k} v^{k-5}
00118 \end{equation}
00119 where the \emph{chirp parameters} $\theta_{k}$ are given by
00120 $$
00121 \theta_{0} = \frac{3}{128 \eta}, \ \ 
00122 \theta_{2} = \frac{5}{96 \eta} \left( \frac{743}{336} + \frac{11}{4} \eta \right),
00123 $$
00124 \begin{equation}
00125 \theta_{3} = - \frac{3 \pi}{8 \eta},\ \ 
00126 \theta_{4} = \frac{15}{64 \eta} \left( \frac{3\,058\,673}{1\,016\,064} + \frac{5429}{1008} \eta
00127 + \frac{617}{144}
00128 \eta^{2} \right).
00129 \end{equation}
00130  
00131 If we want to express $\Psi$ in terms of $f$ rather than $v$ we simply substitute $v = (\pi m
00132 f)^{1/3}$
00133 to obtain
00134 \begin{equation}
00135 \Psi(f) = 2 \pi f t_{c} + \sum_{k} \theta^{\prime}_{k} f^{(k-5)/3}
00136 \label{phaselabel}
00137 \end{equation}
00138 where
00139 \begin{equation}
00140 \theta^{\prime}_{k} = (\pi m)^{(k-5)/3} \theta_{k}.
00141 \end{equation}
00142  
00143 We are now in a position to start calculating components of $\gamma_{\alpha \beta}$. We had
00144 \begin{equation}
00145 \psi_{j} \equiv \frac{\partial \Delta \Psi}{\partial \Delta \lambda^{j}}
00146 \end{equation}
00147 where $\Psi$ is given by Eq.(\ref{phaselabel}). Therefore we may write
00148 \begin{equation}
00149 \Delta \Psi = \Delta \theta^{\prime}_{0} f^{-5/3} + \Delta \theta^{\prime}_{2} f^{-1} + \Delta
00150 \theta^{\prime}_{3} f^{-2/3} + \Delta \theta^{\prime}_{4} f^{-1/3}
00151 \end{equation}
00152 All we need to do now is specify the coordinates $\lambda^{j}$ with respect to which the
00153 derivatives
00154 will be taken. In general, the template placement algorithm works in $(\tau_{0},\tau_{3})$
00155 coordinates. It is simplest for us to calculate the components of $\gamma_{\alpha \beta}$ in
00156 the $(m,\eta)$ coordinate system and then perform a coordinate transformation to get the
00157 components in
00158 the $(\tau_{0},\tau_{3})$ system.
00159 So, we first of all calculate the components of $\gamma_{\alpha \beta}$ in the $(m,\eta)$
00160 system.
00161  
00162 This involves calculating the following:
00163 \begin{equation}
00164 \frac{\partial \Delta \Psi}{\partial \Delta m} = \frac{\Delta \theta^{\prime}_{0}}{\Delta m}
00165 f^{-5/3} +
00166 \frac{\Delta \theta^{\prime}_{2}}{\Delta m} f^{-1} - \frac{\Delta \theta^{\prime}_{3}}{\Delta m}
00167 f^{-2/3} + \frac{\delta \theta^{\prime}_{4}}{\Delta m} f^{-1/3}
00168 \end{equation}
00169 and
00170 \begin{equation}
00171 \frac{\partial \Delta \Psi}{\partial \Delta \eta} = \frac{\Delta \theta^{\prime}_{0}}{\Delta
00172 \eta} f^{-5/3} +
00173 \frac{\Delta \theta^{\prime}_{2}}{\Delta \eta} f^{-1} - \frac{\Delta \theta^{\prime}_{3}}{\Delta
00174 \eta}
00175 f^{-2/3} + \frac{\delta \theta^{\prime}_{4}}{\Delta \eta} f^{-1/3}
00176 \end{equation}
00177 where all of the derivatives are easily calculable. This gives us the terms $\psi_{j}$ as a
00178 power
00179 series in $f$. These are then used in the formula
00180 \begin{equation}
00181 \gamma_{\alpha \beta} = \frac{1}{2} \left( \mathcal{J} [ \psi_{\alpha} \psi_{\beta} ] -
00182 \mathcal{J} [
00183 \psi_{\alpha}] \mathcal{J} [\psi_{\beta}] \right)
00184 \end{equation}
00185 to calculate the components of $\gamma_{\alpha \beta}$. The fact that each of the $\psi_{j}$ is
00186 in the
00187 form of a power series in $f$ allows us to calculate $\gamma_{\alpha \beta}$ using
00188 \begin{equation}
00189 \mathcal{J} \left[ \sum_{n} a_{n} x^{n} \right] = \sum_{n} J(7-3n).
00190 \end{equation}
00191 i.e.\ we can express all the $\mathcal{J}[]$ in terms of the integral $J(q)$ which we calculate
00192 numerically at the outset for the required values of $q$.
00193  
00194  
00195 Once we have obtained $\gamma_{\alpha \beta}$ in this way, we take the inverse of this matrix to
00196 give us $\gamma^{\alpha \beta}$ in the $(m,\eta)$ system. Then
00197 we perform the following coordinate transformation to give us the components of
00198 $\gamma^{\alpha^{\prime}
00199 \beta^{\prime}}$ in our chosen system,
00200 \begin{equation}
00201 \gamma^{\alpha^{\prime} \beta^{\prime}} = \Lambda^{\alpha^{\prime}}_{\,\,\sigma}
00202 \Lambda^{\beta^{\prime}}_{\,\,\delta} \gamma^{\sigma \delta}
00203 \end{equation}
00204 where the transformation matrix $\Lambda^{\alpha^{\prime}}_{\,\,\beta}$ is defined by
00205 \begin{equation}
00206 \Lambda^{\alpha^{\prime}}_{\,\,\beta} = \frac{\partial x^{\alpha^{\prime}}}{\partial x^{\beta}}
00207 \end{equation}
00208 Finally, we take the inverse of this matrix to obtain $\gamma_{\alpha^{\prime} \beta^{\prime}}$
00209 in the
00210 chosen system.
00211 Since the unprimed system corresponds to $(t_{c},m,\eta)$ coordinates and the primed system to
00212 $(t_{c},\tau_{0},\tau_{3})$ coordinates, the matrix
00213 $\Lambda^{\alpha^{\prime}}_{\,\,\beta^{\prime}}$ has
00214 element
00215 \begin{equation}
00216 \Lambda^{\alpha^{\prime}}_{\,\,\beta} = \left(
00217 \begin{array}{ccc}
00218 1  &  0  &  0  \\
00219 0  & \frac{\partial \tau_{0}}{\partial m}  &  \frac{\partial \tau_{0}}{\partial \eta}  \\
00220 0  & \frac{\partial \tau_{3}}{\partial m}  &  \frac{\partial \tau_{3}}{\partial \eta}
00221 \end{array}
00222 \right) = \left(
00223 \begin{array}{ccc}
00224 1  &  0  &  0  \\
00225 0  &  -\frac{5 \tau_{0}}{3m}  &  -\frac{\tau_{0}}{\eta}  \\
00226 0  &  -\frac{2 \tau_{3}}{3m}  &  -\frac{\tau_{3}}{\eta}
00227 \end{array}
00228 \right)
00229 \end{equation}
00230 
00231 Finally, what is needed in laying a lattice in the space of dynamical parameters
00232 (also referred to as intrinsic parameters) is the metric with the kinematical
00233 parameter (also called extrinsic parameter) projected out: In other words one defines
00234 the 2-dimensional metric $g_{mn}$ by
00235 \begin{equation}
00236 g_{mn} = \gamma_{mn} - \frac{\gamma_{0m} \gamma_{0n}}{\gamma_{00}}.
00237 \end{equation}
00238 
00239 \subsubsection*{Metric computation in the $\tau_0-\tau_3$ space}
00240 
00241 The metric cannot be directly computed in the $(\tau_0,\tau_2)$ space.
00242 Therefore, in the previous Section we first computed the metric
00243 in the $(m,\eta)$ space and then transformed to $(\tau_0,\tau_2)$ space.
00244 The same method can also be used to find the metric in the $(\tau_0,\tau_3)$ space.
00245 However, in $(\tau_0,\tau_3)$ space one can directly compute the
00246 metric without recourse to $(m,\eta)$ coordinates. It is of interest to see
00247 whether this yields the same results as the previous method.
00248 
00249 The starting point of our derivation is Eq.~(3.7) of Owen and Sathyaprakash
00250 (Phys. Rev. D 60, 022002, 1999) for the Fourier domain phase which we shall
00251 write as:
00252 \begin{eqnarray}
00253 \Psi(f; \theta_1, \theta_2) & = & a_{01}\theta_1 v^{-5}  
00254 + \left [a_{21} \frac {\theta_1}{\theta_2} + a_{22} \left ( \theta_1 \theta_2^2 \right )^{1/3} \right ] v^{-3}
00255 + a_{31} \theta_2 v^{-2} \nonumber \\
00256 & + & \left [a_{41} \frac {\theta_1}{\theta_2^2} + a_{42} \left ( \frac {\theta_1}{\theta_2} \right )^{1/3} 
00257 + a_{43} \left ( \frac{\theta_2^4}{\theta_1} \right )^{1/3} \right ] v^{-1},
00258 \end{eqnarray}
00259 to 2nd post-Newtonain order.  Here $v=(f/f_0)^{1/3},$ $\theta_1$ and $\theta_2$ are 
00260 identical to the  $\theta^1$ and $\theta^2$ parameters
00261 of Owen and Sathyaprakash defined in Eq.~(3.3) there and the $a$ coefficients are given by:
00262 \begin{eqnarray}
00263 a_{01} = \frac{3}{5}, \ \ a_{21} = \frac{11\pi}{12}, \ \ 
00264 a_{22} = \frac{743}{2016} \left ( \frac {25}{2\pi^2} \right )^{1/3}, \ \ a_{31} = -\frac{3}{2}, \nonumber \\
00265 a_{41} = \frac {617}{384} \pi^2, \ \ a_{42} = \frac{5429}{5376} \left ( \frac{25 \pi}{2} \right )^{1/3},\ \ 
00266 a_{43} = \frac {15293365}{10838016} \left ( \frac{5}{4\pi^4} \right )^{1/3}.
00267 \end{eqnarray}
00268 Differentials of the phase with respect to the coordinates $\theta_1$ and $\theta_2$ appear in the
00269 metric which we write as:
00270 \begin{equation}
00271 \psi_m \equiv \frac{\partial \Psi}{\partial \theta_m} = \sum_0^N \Psi_{mk} v^{k-5}.
00272 \end{equation}
00273 where $N$ is the post-Newtonian order up to which the phase is known, or the post-Newtonian
00274 order at which the metric is desired.
00275 Expansion coefficients $\Psi_{mn}$ can be considered be $(2\times N)$ matrix which to
00276 second post-Newtonian order is given by: 
00277 \begin{equation}
00278 \Psi = 
00279 \left [ \matrix { 
00280           a_{01} 
00281         & 0 
00282         & {a_{21}}/{\theta_2} + ({a_{22}}/{3}) \left ( {\theta_2}/{\theta_1} \right )^{2/3} 
00283         & 0 
00284         & {a_{41}}/{\theta_2^2} + {a_{42}}/\left ({3 \left ( \theta_1^2\theta_2 \right )^{1/3} } \right ) 
00285         - ({a_{43}}/{3}) \left ( {\theta_2}/{\theta_1} \right )^{4/3} \cr 
00286           0
00287         & 0 
00288         & - {a_{21}\theta_1}/{\theta_2^2} + (2 {a_{22}}/{3}) \left ( {\theta_1}/{\theta_2} \right )^{1/3} 
00289         & a_{31} 
00290         & - {2a_{41} \theta_1}/{\theta_2^3} - ({a_{42}}/{3}) \left ( {\theta_1}/{\theta_2^4} \right )^{1/3}  
00291         + ({4a_{43}}/{3}) \left ( {\theta_2}/{\theta_1} \right )^{1/3} }
00292 \right ].
00293 \end{equation}
00294 
00295 Using the definition of the
00296 metric introduced earlier and projecting out the $t_c$ coordinate, one finds that
00297 \begin{eqnarray}
00298 g_{mn}  & = & \frac{1}{2}\sum_{k,l=0}^N \Psi_{mk} \Psi_{nl} 
00299 \biggl  [ J(17-k-l) - J(12-k) J(12-l) \biggr . \nonumber \\
00300         & - &   \biggl . \frac { \left ( J(9-k) - J(4)J(12-k) \right )
00301                 \left ( J(9-l) - J(4)J(12-l) \right )} {\left (J(1) - J(4)^2 \right)}
00302 \biggr ]
00303 \end{eqnarray}
00304 where $J$'s are the moments introduced earlier. 
00305 
00306 
00307 \subsubsection*{Algorithm}
00308  
00309  
00310 \subsubsection*{Uses}
00311 \begin{verbatim}
00312 LALMAlloc
00313 LALInspiralMoments
00314 LALInverse3
00315 LALMatrixTransform
00316 LALFree
00317 \end{verbatim}
00318  
00319 \subsubsection*{Notes}
00320  
00321 \vfill{\footnotesize\input{LALInspiralComputeMetricCV}}
00322  
00323 </lalLaTeX>  */
00324 
00325 /*
00326         Created: 7.9.96.
00327         Author: B.S.Sathyaprakash, Caltech, Cardiff University.
00328         Purpose: To compute the metric and the template bank
00329               parameters, corresponding to 2PN chirps.
00330         Revision History: Updates 15.7.97; 31.8.97.; 18.3.99; 25.05.02
00331         First C version October 2000.
00332         Major revision in May 2002: Direct computation in (tau0, tau3)
00333         space avoid (m, eta) space. This means the code won't create
00334         template parameters in (tau0, tau2) space. An interface to the
00335         old code will have to be provided, if that is necessary.
00336 
00337         Dependencies: moments.f, inverse.f transform.f (not needed in the version of 02/05)
00338         Outputs:
00339             det: Determinant of the metric. (not in versions after 02/05)
00340             g00: 
00341             g11: 
00342           theta: Angle which the t0-axis makes with semi-major (dx0) axis.
00343          srate: The minimal sampling rate required (computed but not outputted.
00344         Notes: Owen and Sathyaprakash (Caltech collaboration notes).
00345               Also Sathyaprakash, note from October 2000, May 24/25, 2002.
00346 */
00347 
00348 #include <stdlib.h>
00349 #include <lal/LALInspiralBank.h>
00350 #include <lal/LALNoiseModels.h>
00351 
00352 #define METRIC_DIMENSION 2
00353 #define METRIC_ORDER 5
00354 
00355 static void 
00356 InspiralComputeMetricGetPsiCoefficients (
00357     REAL8              Psi[METRIC_DIMENSION][METRIC_ORDER], 
00358     InspiralTemplate   *params, 
00359     InspiralMomentsEtc *moments
00360     );
00361 
00362 NRCSID(LALINSPIRALCOMPUTEMETRICC, "$Id: LALInspiralComputeMetric.c,v 1.27 2008/03/05 12:02:19 thomas Exp $");
00363 
00364 /* <lalVerbatim file="LALInspiralComputeMetricCP">  */
00365 void 
00366 LALInspiralComputeMetric (
00367     LALStatus          *status,
00368     InspiralMetric     *metric,
00369     InspiralTemplate   *params,
00370     InspiralMomentsEtc *moments
00371     )
00372 /* </lalVerbatim> */
00373 {
00374   static REAL8 Psi[METRIC_DIMENSION][METRIC_ORDER];
00375   static REAL8 g[METRIC_DIMENSION][METRIC_DIMENSION];
00376 
00377   REAL8 a, b, c, q, det;
00378   UINT4 PNorder, m, n;
00379 
00380   INITSTATUS(status, "LALInspiralComputeMetric", LALINSPIRALCOMPUTEMETRICC );
00381 
00382   ASSERT( metric, status, 
00383       LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
00384   ASSERT( params, status, 
00385       LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
00386   ASSERT( moments, status, 
00387       LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
00388   ASSERT( params->t0 > 0.L, status, 
00389       LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00390   ASSERT( params->t3 > 0.L, status, 
00391       LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00392 
00393   /* use the order of the waveform to compute the metric */
00394   /* summation below will be carried out up to PNorder   */
00395   if ( params->order != onePN && 
00396       params->order != onePointFivePN &&
00397       params->order != twoPN )
00398   {
00399     /* Let us force the order to be twoPN because that is the only order
00400      * available for the template bank anyway. */
00401     PNorder = twoPN;
00402   }
00403   else
00404   {
00405     PNorder = (UINT4) params->order;
00406   }
00407 
00408   
00409   /* Setting up \Psi_{mn} coefficients  */
00410   InspiralComputeMetricGetPsiCoefficients( Psi, params, moments );
00411 
00412   for ( m = 0; m < METRIC_DIMENSION; m++ )
00413   {
00414     for ( n = m; n < METRIC_DIMENSION; n++ )
00415     {
00416       UINT4 k, l;
00417       g[m][n] = 0.L;
00418 
00419       for ( k = 0 ; k < PNorder; k++ )
00420       {
00421         for ( l = 0; l < PNorder; l++ )
00422         { 
00423           g[m][n] += Psi[m][k] * Psi[n][l] * (
00424               moments->j[17-k-l] - moments->j[12-k] * moments->j[12-l]
00425               - ( moments->j[9-k] - moments->j[4] * moments->j[12-k] )
00426               * ( moments->j[9-l] - moments->j[4] * moments->j[12-l] )
00427               / ( moments->j[1]   - moments->j[4] * moments->j[4]    )   
00428               );
00429         }
00430       }
00431       g[m][n] /= 2.;
00432       g[n][m] = g[m][n];
00433     }
00434   }
00435 
00436 #if 0 
00437   The minimum sampling rate for given MM is
00438     srate = 
00439     2 * LAL_PI * f0 sqrt( (moments.j[1] - moments.j[4]*moments.j[4]) / 
00440         (2.0*(1.-MM)));
00441 #endif
00442 
00443   /* The calculation above gives the metric in coordinates   */
00444   /* (t0=2\pi f_0 \tau0, t3=2\pi f_0 \tau3). Re-scale metric */
00445   /* coefficients to get metric in (tau0, tau3) coordinates  */
00446   a = g[0][0] * pow(2.*LAL_PI*params->fLower,2.); 
00447   b = g[0][1] * pow(2.*LAL_PI*params->fLower,2.); 
00448   c = g[1][1] * pow(2.*LAL_PI*params->fLower,2.); 
00449 
00450 
00451   /* The metric in tau0-tau2,3 space. */
00452   metric->G00 = a;
00453   metric->G01 = b;
00454   metric->G11 = c;
00455 
00456   /* Diagonalize the metric. */
00457   det = a * c - b * b;
00458   q = sqrt( (a-c)*(a-c) + 4. * b*b );
00459 
00460   metric->g00 = 0.5 * (a + c - q);
00461   metric->g11 = 0.5 * (a + c + q);
00462 
00463   if ( a == c )
00464   {
00465     metric->theta = LAL_PI/2.;
00466   }
00467   else
00468   {
00469     /* metric->theta = 0.5 * atan(2.*b/(a-c));                  */
00470     /* We want to always measure the angle from the             */
00471     /* semi-major axis to the tau0 axis which is given by       */
00472     /* the following line as opposed to the line above          */
00473     metric->theta = atan( b / (metric->g00 - c) );
00474   }
00475 
00476   /* memset the metric->Gamma array to zero before populating them with correct
00477    * values. This prevents junk getting stored in unused fields */
00478   memset (metric->Gamma, 0, 10*sizeof(REAL4));
00479 
00480   /* Now we compute the 3d metric in tc,\tau_0,\tau_3 co-ordinates */
00481   /* We only need metric->Gamma[0,...,5].                          */
00482   metric->Gamma[0] = 0.5*pow(2.*LAL_PI*params->fLower,2.)*
00483           ( moments->j[1] - (moments->j[4]*moments->j[4]) );
00484   
00485   metric->Gamma[1] = 0.5*pow(2.*LAL_PI*params->fLower,2.)*
00486           ( Psi[0][0]*(moments->j[9] - (moments->j[4]*moments->j[12]) ) 
00487           + Psi[0][2]*(moments->j[7] - (moments->j[4]*moments->j[10]) ) 
00488           + Psi[0][4]*(moments->j[5] - (moments->j[4]*moments->j[8]) ));
00489   
00490   metric->Gamma[2] = 0.5*pow(2.*LAL_PI*params->fLower,2.)*
00491           ( Psi[1][2]*(moments->j[7] - (moments->j[4]*moments->j[10]) ) 
00492           + Psi[1][3]*(moments->j[6] - (moments->j[4]*moments->j[9])  ) 
00493           + Psi[1][4]*(moments->j[5] - (moments->j[4]*moments->j[8])  ));
00494 
00495 
00496   metric->Gamma[3] = metric->G00 + metric->Gamma[1]*metric->Gamma[1]/metric->Gamma[0];
00497   metric->Gamma[4] = metric->G01 + metric->Gamma[1]*metric->Gamma[2]/metric->Gamma[0];
00498   metric->Gamma[5] = metric->G11 + metric->Gamma[2]*metric->Gamma[2]/metric->Gamma[0];
00499 
00500 
00501   RETURN( status );
00502 }
00503 
00504 static void 
00505 InspiralComputeMetricGetPsiCoefficients (
00506     REAL8              Psi[METRIC_DIMENSION][METRIC_ORDER], 
00507     InspiralTemplate   *params, 
00508     InspiralMomentsEtc *moments
00509     )
00510 {
00511   REAL8 t1 = 2.L * LAL_PI * params->fLower * params->t0; 
00512   REAL8 t2 = 2.L * LAL_PI * params->fLower * params->t3; 
00513 
00514   Psi[0][0] = moments->a01;
00515   Psi[0][1] = 0.L;
00516   Psi[0][2] = moments->a21/t2 + moments->a22/3.L * pow(t2/t1,2.L/3.L);
00517   Psi[0][3] = 0.L;
00518   Psi[0][4] = moments->a41/(t2*t2) + moments->a42/(3.L* pow(t1*t1*t2,1.L/3.L)) 
00519     - moments->a43/3.L * pow(t2/t1,4.L/3.L);
00520 
00521   Psi[1][0] = 0.L;
00522   Psi[1][1] = 0.L;
00523   Psi[1][2] = -moments->a21*t1/pow(t2,2.L) + 2.L * 
00524     moments->a22/3.L * pow(t1/t2,1.L/3.L);
00525   Psi[1][3] =  moments->a31;
00526   Psi[1][4] = - 2.L * moments->a41*t1 / pow(t2,3.L) - 
00527     moments->a42/3.L * pow(t1/pow(t2,4.L),1.L/3.L) + 
00528     4.L * moments->a43/3.L * pow(t2/t1,1.L/3.L);
00529 }
00530 
00531 /* <lalVerbatim file="LALInspiralComputeMetricCP">  */
00532 void 
00533 LALInspiralComputeMetricBCV (
00534     LALStatus             *status,
00535     InspiralMetric        *metric,
00536     REAL8FrequencySeries  *psd,
00537     InspiralTemplate      *params
00538     )
00539 { /* </lalVerbatim> */
00540   REAL8 g[METRIC_DIMENSION][METRIC_DIMENSION];
00541   InspiralMomentsEtcBCV moments;
00542   REAL8 num;
00543   REAL8 a, b, c, q, det;
00544 
00545   INITSTATUS( status, 
00546       "LALInspiralComputeMetricBCV ", LALINSPIRALCOMPUTEMETRICC );
00547   ATTATCHSTATUSPTR( status );
00548 
00549   moments.alpha = params->alpha;
00550   moments.n0 = 5.L/3.L;
00551   moments.n15 = 2.L/3.L;
00552 
00553   LALGetInspiralMomentsBCV( status->statusPtr, &moments, psd, params );
00554   CHECKSTATUSPTR( status );
00555 
00556   num =  moments.M3[0][0] *moments.M3[1][1] 
00557     - moments.M3[0][1] * moments.M3[1][0];
00558 
00559   g[0][0] =moments.M2[0][0]*(moments.M3[1][1]*moments.M2[0][0]
00560       -moments.M3[0][1]*moments.M2[0][1])
00561     +moments.M2[0][1]*(-moments.M3[0][1]*moments.M2[0][0]
00562         +moments.M3[0][0]*moments.M2[0][1]);
00563   g[0][0] /= num;
00564 
00565 
00566   g[1][1] =moments.M2[0][1]*(moments.M3[1][1]*moments.M2[0][1]
00567       -moments.M3[0][1]*moments.M2[1][1])
00568     +moments.M2[1][1]*(-moments.M3[0][1]*moments.M2[0][1]
00569         +moments.M3[0][0]*moments.M2[1][1]);
00570   g[1][1] /= num;
00571 
00572 
00573   g[0][1] = moments.M2[0][0]*(moments.M3[1][1]*moments.M2[0][1]
00574       -moments.M3[0][1]*moments.M2[1][1])
00575     +moments.M2[0][1]*(-moments.M3[0][1]*moments.M2[0][1]
00576         +moments.M3[0][0]*moments.M2[1][1]);
00577   g[0][1] /= num ;
00578 
00579   metric->G00 = .5 *(moments.M1[0][0] - g[0][0] );
00580   metric->G01 = .5 *(moments.M1[0][1] - g[0][1] );
00581   metric->G11 = .5 *(moments.M1[1][1] - g[1][1] );
00582 
00583   a = metric->G00;
00584   b = metric->G01;
00585   c = metric->G11;
00586   det = a * c - b * b;
00587   q = sqrt( (a-c)*(a-c) + 4. * b*b );
00588   metric->g00 = 0.5 * (a + c - q);
00589   metric->g11 = 0.5 * (a + c + q);
00590   if ( a == c )
00591   { 
00592     metric->theta = LAL_PI/2.;
00593   }
00594   else
00595   {
00596     /* metric->theta = 0.5 * atan(2.*b/(a-c));                  */
00597     /* We want to always measure the angle from the             */
00598     /* semi-major axis to the tau0 axis which is given by       */
00599     /* the following line as opposed to the line above          */
00600     metric->theta = atan(b/(metric->g00 - c));
00601   }
00602 
00603   DETATCHSTATUSPTR( status );
00604   RETURN( status );
00605 }
00606 
00607 #undef METRIC_ORDER
00608 #undef METRIC_DIMENSION

Generated on Sun Sep 7 03:06:54 2008 for LAL by  doxygen 1.5.2