LALInspiralUpdateParams.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, B.S. Sathyaprakash, 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="LALInspiralUpdateParamsCV">
00021 Author: Sathyaprakash, B. S., T. Cokelaer
00022 $Id: LALInspiralUpdateParams.c,v 1.13 2007/06/08 14:41:42 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralUpdateParams.c}}
00028 
00029 Module to update the parameters used in creating a coarse bank 
00030 based on a square lattice. 
00031 \subsubsection*{Prototypes}
00032 \vspace{0.1in}
00033 \input{LALInspiralUpdateParamsCP}
00034 \idx{LALInspiralUpdateParams()}
00035 \begin{itemize}
00036    \item \texttt{bankParams} Output, refreshed to get the next location
00037    \item \texttt{metric} Input, metric at the current location
00038    \item \texttt{minimalmatch} Input, the minimal match
00039 \end{itemize}
00040 
00041 \subsubsection*{Description}
00042 While scanning the $\tau_0$-direction after reaching the 
00043 boundary of the parameter space, we have to return to the 
00044 starting point of the same line and use the metric there
00045 to increment one step upwards in the direction of $\tau_{2(3)}.$ 
00046 to a {\it template list}.
00047 
00048 
00049 The $dx_i$ returned by this function gives the spacing for a 
00050 square lattice (e.g., $dx_i$ as given in Owen PRD 53).
00051 
00052 \subsubsection*{Algorithm}
00053 
00054 Copy the parameters in the temporary parameter structure
00055 to the current parameter structure.
00056 
00057 \subsubsection*{Uses}
00058 None.
00059 
00060 \subsubsection*{Notes}
00061 
00062 \vfill{\footnotesize\input{LALInspiralUpdateParamsCV}}
00063 
00064 </lalLaTeX>  */
00065 
00066 
00067 
00068 #include <lal/LALInspiralBank.h>
00069 
00070 NRCSID (LALINSPIRALUPDATEPARAMSC, "Id: $");
00071 
00072 /*  <lalVerbatim file="LALInspiralUpdateParamsCP"> */
00073 void LALInspiralUpdateParams(LALStatus          *status,
00074                              InspiralBankParams *bankParams,
00075                              InspiralMetric     metric,
00076                              REAL8              minimalmatch)
00077 {  /*  </lalVerbatim>  */
00078    REAL8 dx0, dx1, myphi, theta, fac;
00079 
00080    INITSTATUS (status, "LALInspiralUpdateParams", LALINSPIRALUPDATEPARAMSC);
00081    ATTATCHSTATUSPTR(status);
00082    ASSERT (bankParams,  status, LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL);
00083    ASSERT (metric.g00 > 0, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00084    ASSERT (metric.g11 > 0, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00085    ASSERT (minimalmatch < 1., status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00086    ASSERT (minimalmatch > 0., status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00087    ASSERT (metric.theta < LAL_PI_2, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00088    ASSERT (metric.theta > -LAL_PI_2, status, LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE);
00089    
00090    /* This dx0, dx1 are linked to a square placement only !! */
00091    dx0 = sqrt(2.L * (1.L - minimalmatch)/metric.g00 );
00092    dx1 = sqrt(2.L * (1.L - minimalmatch)/metric.g11 );
00093 
00094    if (metric.theta==0.L)
00095    {
00096            bankParams->dx0 = dx0;
00097            bankParams->dx1 = dx1;
00098    }
00099    else
00100    {
00101            myphi = atan2(dx1, dx0);
00102            theta = fabs(metric.theta);
00103            if (theta <= myphi) {
00104                    fac = cos(theta);
00105                    bankParams->dx0 = dx0 / fac;
00106                    bankParams->dx1 = dx1 * fac;
00107            } 
00108            else {
00109                    fac = sin(theta);
00110                    bankParams->dx0 = dx1 / fac;
00111                    bankParams->dx1 = dx0 * fac;
00112            }
00113    }
00114 
00115    DETATCHSTATUSPTR(status);
00116    RETURN(status);
00117 
00118 }

Generated on Sat Sep 6 03:07:11 2008 for LAL by  doxygen 1.5.2