LALInspiralSetSearchLimits.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 David Churches, Duncan Brown, Jolien Creighton, Peter Shawhan, Craig Robinson , 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="LALInspiralSetSearchLimitsCV">
00021 Author: Churches, D. K.
00022 $Id: LALInspiralSetSearchLimits.c,v 1.16 2007/06/08 14:41:42 bema Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralSetSearchLimits.c}}
00028 
00029 Function which calculates the minimum and maximum values of $\tau_{0}$ and $\tau_{3}$.
00030 \subsubsection*{Prototypes}
00031 \vspace{0.1in}
00032 \input{LALInspiralSetSearchLimitsCP}
00033 \idx{LALInspiralSetSearchLimits()}
00034 \begin{itemize}
00035    \item \texttt{bankParams,} Output containing the boundary of search, current lattice point, etc.
00036    \item \texttt{coarseIn,} Input, specifies the parameters of the search space.
00037 \end{itemize}
00038 
00039 This Function calculates the minimum and maximum values of $\tau_{0}$ and $\tau_{3}$
00040 as determined by the total mass of the binary $m$ and the symmetric 
00041 mass ratio $\eta$.  The function also calulates the coordinates of the
00042 first template in the bank. These coordinates are $\tau_{0}=\tau_{0min}$,
00043 $\tau_{3}=\tau_{3min}$. 
00044 
00045 \subsubsection*{Description}
00046 
00047 We start with the definition of the chirp times $\tau_{0}$ and $\tau_{3}$,
00048 \begin{equation}
00049 \tau_{0} = \frac{5}{256 (\pi f_{a} )^{8/3} m^{5/3} \eta}
00050 \end{equation}
00051 
00052 and
00053 
00054 \begin{equation}
00055 \tau_{3} = \frac{1}{8 (\pi^{2} f_{a}^{5} )^{1/3} m^{2/3} \eta}
00056 \end{equation}
00057 
00058 $\tau_{0}$ is minimised when $\eta=1/4$ and $\mathtt{m=MMax}$.
00059 $\tau_{0}$ is maximised when $\eta=1/4$ and $\mathtt{m=2mMin}$.
00060 $\tau_{3}$ is minimised when $\eta=1/4$ and $\mathtt{m=MMax}$.
00061 $\tau_{3}$ is maximised when
00062 $\eta=\mathtt{ mMin(MMax-mMin)/MMax^{2} }$.
00063 
00064 
00065 \subsubsection*{Algorithm}
00066 
00067 
00068 \subsubsection*{Uses}
00069 
00070 \subsubsection*{Notes}
00071 
00072 \vfill{\footnotesize\input{LALInspiralSetSearchLimitsCV}}
00073 
00074 </lalLaTeX>  */
00075 
00076 
00077 
00078 #include <lal/LALInspiralBank.h>
00079 #include <lal/LALStdlib.h>
00080 
00081 
00082 NRCSID (LALINSPIRALSETSEARCHLIMITSC, "$Id: LALInspiralSetSearchLimits.c,v 1.16 2007/06/08 14:41:42 bema Exp $");
00083 
00084 /*  <lalVerbatim file="LALInspiralSetSearchLimitsCP">  */
00085 void
00086 LALInspiralSetSearchLimits (
00087     LALStatus            *status,
00088     InspiralBankParams   *bankParams,
00089     InspiralCoarseBankIn  coarseIn
00090     )
00091 /* </lalVerbatim> */
00092 {  
00093    InspiralTemplate *Pars1=NULL, *Pars2=NULL, *Pars3=NULL, *Pars4=NULL;
00094 
00095    INITSTATUS( status, "LALInspiralSetSearchLimits", 
00096        LALINSPIRALSETSEARCHLIMITSC );
00097    ATTATCHSTATUSPTR( status );
00098 
00099    ASSERT( bankParams, status, 
00100        LALINSPIRALBANKH_ENULL, LALINSPIRALBANKH_MSGENULL );
00101    ASSERT( coarseIn.space == Tau0Tau2 || coarseIn.space == Tau0Tau3, status,
00102        LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
00103    ASSERT( coarseIn.mMin > 0, status, 
00104        LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00105    ASSERT( coarseIn.MMax >= 2. * coarseIn.mMin, status, 
00106        LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00107    ASSERT( coarseIn.mmCoarse > 0., status, 
00108        LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00109    ASSERT( coarseIn.mmCoarse < 1., status, 
00110        LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00111    ASSERT( coarseIn.fLower > 0., status, 
00112        LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00113    ASSERT( coarseIn.tSampling > 0., status, 
00114        LALINSPIRALBANKH_ESIZE, LALINSPIRALBANKH_MSGESIZE );
00115 
00116    Pars1 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
00117    Pars2 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
00118    Pars3 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
00119    Pars4 = (InspiralTemplate *) LALCalloc( 1, sizeof(InspiralTemplate) );
00120 
00121    if ( ! Pars1 || ! Pars2 || ! Pars3 || !Pars4 )
00122    {
00123      ABORT( status, LALINSPIRALBANKH_EMEM, LALINSPIRALBANKH_MSGEMEM );
00124    }
00125 
00126    /* Initiate three parameter vectors consistent with the coarseIn structure */
00127    LALInspiralSetParams(status->statusPtr, Pars1, coarseIn);
00128    CHECKSTATUSPTR(status);
00129    LALInspiralSetParams(status->statusPtr, Pars2, coarseIn);
00130    CHECKSTATUSPTR(status);
00131    LALInspiralSetParams(status->statusPtr, Pars3, coarseIn);
00132    CHECKSTATUSPTR(status);
00133    LALInspiralSetParams(status->statusPtr, Pars4, coarseIn);
00134    CHECKSTATUSPTR(status);
00135 
00136    Pars1->massChoice = Pars2->massChoice = Pars3->massChoice = m1Andm2;
00137    Pars4->massChoice = m1Andm2;
00138 
00139    /* Calculate the value of the parameters at the three corners */
00140    /* of the search space                                        */
00141    Pars1->mass1 = Pars1->mass2 = coarseIn.MMax/2.;
00142    LALInspiralParameterCalc( status->statusPtr, Pars1 );
00143    CHECKSTATUSPTR( status );
00144 
00145    if ( coarseIn.massRange == MinMaxComponentTotalMass )
00146    {
00147      Pars2->mass1 = Pars2->mass2 = coarseIn.MMin/2.;
00148    }
00149    else
00150    {   
00151      Pars2->mass1 = Pars2->mass2 = coarseIn.mMin;
00152    }
00153    LALInspiralParameterCalc( status->statusPtr, Pars2 );
00154    CHECKSTATUSPTR( status );
00155    
00156    Pars3->mass1 = coarseIn.mMin;
00157    Pars3->mass2 = coarseIn.MMax - coarseIn.mMin;
00158    LALInspiralParameterCalc( status->statusPtr, Pars3 ); 
00159    CHECKSTATUSPTR( status );
00160 
00161    if ( coarseIn.massRange == MinMaxComponentTotalMass )
00162    {
00163      Pars4->mass1 = coarseIn.mMin;
00164      Pars4->mass2 = coarseIn.MMin - coarseIn.mMin;
00165      LALInspiralParameterCalc( status->statusPtr, Pars4 );
00166      CHECKSTATUSPTR( status );
00167    }
00168    else
00169    {
00170      Pars4->t0 = 0.0;
00171    }
00172 
00173    /* Find the minimum and maximum values of the parameters and set     */
00174    /* the search space.  (The minimum values of chirp times are those   */
00175    /* corresponding to m1 = m2 = MMax/2, i.e., Pars1 structure.         */
00176    bankParams->x0 = bankParams->x0Min = Pars1->t0;
00177    bankParams->x0Max = (Pars2->t0 > Pars4->t0) ? Pars2->t0 : Pars4->t0;
00178 
00179    switch ( coarseIn.space ) 
00180    {
00181      case Tau0Tau2:
00182        bankParams->x1 = bankParams->x1Min = Pars1->t2;
00183        bankParams->x1Max = (Pars2->t2 > Pars3->t2) ? Pars2->t2 : Pars3->t2;
00184        break;
00185        
00186      case Tau0Tau3:
00187        bankParams->x1 = bankParams->x1Min = Pars1->t3;
00188        bankParams->x1Max = (Pars2->t3 > Pars3->t3) ? Pars2->t3 : Pars3->t3;
00189        break;
00190    
00191      default:
00192        ABORT( status, LALINSPIRALBANKH_ECHOICE, LALINSPIRALBANKH_MSGECHOICE );
00193    }
00194    
00195    LALFree( Pars1 );
00196    LALFree( Pars2 );
00197    LALFree( Pars3 );
00198    LALFree( Pars4 );
00199 
00200    DETATCHSTATUSPTR( status );
00201    RETURN( status );
00202 }

Generated on Sun Oct 12 02:32:05 2008 for LAL by  doxygen 1.5.2