LALInspiralGetApproximantString.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2008 Craig Robinson
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 #if 0
00021 <lalVerbatim file="LALInspiralGetApproximantStringCV">
00022 Author: Craig Robinson
00023 $Id: LALInspiralGetApproximantString.c,v 1.1 2008/06/26 13:55:56 spxcar Exp $
00024 </lalVerbatim>
00025 
00026 <lalLaTeX>
00027 \subsection{Module \texttt{LALInspiralGetApproximantString.c}}
00028 
00029 Function for creating the approximant string which gets written to output
00030 files for a given approximant and PN order of the phasing.
00031 
00032 \subsubsection*{Prototypes}
00033 \vspace{0.1in}
00034 \input{XLALInspiralGetApproximantStringCP}
00035 \idx{XLALXLALInspiralGetApproximantString()}
00036 \begin{itemize}
00037    \item \texttt{output,} Output, Pointer to the string in which to place the output
00038    \item \texttt{length,} Input, the length of the output string
00039    \item \texttt{approx,} Input, enumeration of the waveform approximant
00040    \item \texttt{order,} Input, post-Newtonian order of the phasing.
00041 \end{itemize}
00042 
00043 \subsubsection*{Description}
00044 
00045 \subsubsection*{Algorithm}
00046 
00047 \subsubsection*{Uses}
00048 
00049 \begin{verbatim}
00050 LALSnprintf
00051 \end{verbatim}
00052 
00053 \subsubsection*{Notes}
00054  
00055 \vfill{\footnotesize\input{LALInspiralRingdownWaveCV}}
00056 
00057 </lalLaTeX>
00058 #endif
00059 
00060 #include <lal/LALStdlib.h>
00061 #include <lal/LALError.h>
00062 
00063 #include <lal/LALInspiral.h>
00064 
00065 NRCSID (LALINSPIRALGETAPPROXIMANTSTRINGC, "$Id: LALInspiralGetApproximantString.c,v 1.1 2008/06/26 13:55:56 spxcar Exp $");
00066 
00067 int XLALInspiralGetApproximantString( CHAR        *output,
00068                                       UINT4       length,
00069                                       Approximant approx,
00070                                       Order       order
00071                                     )
00072 {
00073 
00074   static const char *func = "XLALInspiralGetApproximantString";
00075 
00076   CHAR approxString[LIGOMETA_SEARCH_MAX];
00077   CHAR orderString[LIGOMETA_SEARCH_MAX];
00078 
00079 #ifndef LAL_NDEBUG
00080   if (!output)
00081     XLAL_ERROR( func, XLAL_EFAULT );
00082 
00083   if (length < 1)
00084     XLAL_ERROR( func, XLAL_EINVAL );
00085 #endif
00086 
00087   /* Set the approximant string */
00088 
00089   switch ( approx )
00090   {
00091     case TaylorT1:
00092       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00093           "TaylorT1" );
00094       break;
00095 
00096     case TaylorT2:
00097       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00098           "TaylorT2" );
00099       break;
00100 
00101     case TaylorT3:
00102       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00103           "TaylorT3" );
00104       break;
00105 
00106     case TaylorF1:
00107       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00108           "TaylorF1" );
00109       break;
00110 
00111     case TaylorF2:
00112       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00113           "TaylorF2" );
00114       break;
00115 
00116     case PadeT1: 
00117       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00118           "PadeT1" );
00119       break;
00120 
00121     case PadeF1: 
00122       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00123           "PadeF1" );
00124       break;
00125 
00126     case EOB:
00127       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00128           "EOB" );
00129       break;
00130 
00131     case BCV:
00132       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00133           "BCV" );
00134       break;
00135 
00136     case BCVSpin:
00137       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00138           "BCVSpin" );
00139       break;
00140 
00141     case SpinTaylorT3: 
00142       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00143           "SpinTaylorT3" ); 
00144       break;
00145 
00146     case SpinTaylor:
00147       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00148           "SpinTaylor" );
00149       break;
00150 
00151     case FindChirpSP:
00152       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00153           "FindChirpSP" );
00154       break;
00155  
00156     case FindChirpPTF:
00157       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00158           "FindChirpPTF" );
00159       break;
00160 
00161     case GeneratePPN:
00162       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00163           "GeneratePPN" );
00164       break;
00165 
00166     case BCVC: 
00167       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00168           "BCVC" ); 
00169       break;
00170 
00171     case Eccentricity: 
00172       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00173           "Eccentricity" ); 
00174       break;
00175 
00176     case EOBNR: 
00177       LALSnprintf( approxString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00178           "EOBNR" ); 
00179       break;
00180 
00181     default:
00182       XLALPrintError("Unknown or unsupported approximant.\n");
00183       XLAL_ERROR( func, XLAL_EINVAL );
00184       break;
00185   }
00186 
00187 
00188   /* Now set the order */
00189   switch ( order )
00190   {
00191     case newtonian:
00192       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00193           "newtonian" );
00194       break;
00195 
00196     case oneHalfPN: 
00197       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00198           "oneHalfPN" );
00199       break;
00200 
00201     case onePN: 
00202       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00203           "onePN" );
00204       break;
00205 
00206     case onePointFivePN: 
00207       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00208           "onePointFivePN" );
00209       break;
00210 
00211     case twoPN: 
00212       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00213           "twoPN" );
00214       break;
00215 
00216     case twoPointFivePN: 
00217       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00218           "twoPointFivePN" );
00219       break;
00220 
00221     case threePN: 
00222       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00223           "threePN" );
00224       break;
00225 
00226     case threePointFivePN: 
00227       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00228           "threePointFivePN" );
00229       break;
00230 
00231     case pseudoFourPN: 
00232       LALSnprintf( orderString, LIGOMETA_SEARCH_MAX * sizeof(CHAR),
00233           "pseudoFourPN" );
00234       break;
00235 
00236     default:
00237       XLALPrintError( "Unknown or unsupported order.\n" );
00238       XLAL_ERROR( func, XLAL_EINVAL );
00239       break;
00240   }
00241 
00242   /* Now build the output and return */
00243   LALSnprintf( output, length * sizeof(CHAR), "%s%s",
00244       approxString, orderString );
00245 
00246   return XLAL_SUCCESS;
00247 }

Generated on Sat Aug 30 03:12:48 2008 for LAL by  doxygen 1.5.2