LALInspiralAmplitudeCorrectedWave.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Duncan Brown, David McKechan, 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="LALInspiralAmplitudeCorrectedWaveCV">
00021 Author: Cokelaer T, McKechan D
00022 $Id: LALInspiralAmplitudeCorrectedWave.c,v 1.10 2008/05/29 15:25:08 thomas Exp $
00023 </lalVerbatim>  */
00024 
00025 /*  <lalLaTeX>
00026 
00027 \subsection{Module \texttt{LALInspiralAmplitudeCorrectedWave.c} and \texttt{LALInspiralAmplitudeCorrectedWaveTemplates.c}}
00028 
00029 The code \texttt{LALInspiralAmplitudeCorrectedWave} generates an time-domain inspiral waveform corresponding to the 
00030 \texttt{approximant} \texttt{TaylorT1} and \texttt{PadeT1} as outlined in the
00031 documentation for the function \texttt{LALInspiralWave}. 
00032 
00033 \subsubsection*{Prototypes}
00034 \vspace{0.1in}
00035 \input{LALInspiralAmplitudeCorrectedWaveCP}
00036 \index{\verb&LALInspiralAmplitudeCorrectedWave()&}
00037 \begin{itemize}
00038 \item {\tt signal:} Output containing the inspiral waveform.
00039 \item {\tt params:} Input containing binary chirp parameters.
00040 \end{itemize}
00041 
00042 \input{LALInspiralAmplitudeCorrectedWaveTemplatesCP}
00043 \index{\verb&LALInspiralAmplitudeCorrectedWaveTemplates()&}
00044 \begin{itemize}
00045 \item {\tt signal1:} Output containing the 0-phase inspiral waveform.
00046 \item {\tt signal2:} Output containing the $\pi/2$-phase inspiral waveform.
00047 \item {\tt params:} Input containing binary chirp parameters.
00048 \end{itemize}
00049 
00050 \subsubsection*{Description}
00051 
00052 \texttt{LALInspiralAmplitudeCorrectedWave} is called if the user has specified the 
00053 \texttt{enum} \texttt{approximant} to be
00054 either \texttt{TaylorT1} or \texttt{PadeT1}.
00055 {\tt LALInspiralAmplitudeCorrectedWaveTemplates} is exactly the same as \texttt{LALInspiralAmplitudeCorrectedWave,} except that
00056 it generates two templates one for which the starting phase is 
00057 \texttt{params.startPhase} and the other for which the phase is
00058 \texttt{params.startPhase + $\pi/2$}.
00059 
00060 
00061 \subsubsection*{Algorithm}
00062 This code uses a fourth-order Runge-Kutta algorithm to solve the ODEs 
00063 in Equation (\ref{eq:ode2}).
00064 
00065 \subsubsection*{Uses}
00066 
00067 \texttt{LALInspiralSetup}\\
00068 \texttt{LALInspiralChooseModel}\\
00069 \texttt{LALInspiralVelocity}\\
00070 \texttt{LALInspiralPhasing1}\\
00071 \texttt{LALInspiralDerivatives}\\
00072 \texttt{LALRungeKutta4}.
00073  
00074 
00075 \subsubsection*{Notes}
00076 
00077 \vfill{\footnotesize\input{LALInspiralAmplitudeCorrectedWaveCV}}
00078 
00079 </lalLaTeX>  */
00080 
00081 /* 
00082    Interface routine needed to generate time-domain T- or a P-approximant
00083    waveforms by solving the ODEs using a 4th order Runge-Kutta; April 5, 00.
00084 */
00085 #include <lal/LALInspiral.h>
00086 #include <lal/LALStdlib.h>
00087 #include <lal/Units.h>
00088 #include <lal/SeqFactories.h>
00089 #include <lal/GenerateInspiral.h>
00090 #include <lal/GeneratePPNInspiral.h>
00091 #include <lal/DetResponse.h>
00092 #include <lal/LIGOMetadataUtils.h>
00093 static void
00094 LALInspiralAmplitudeCorrectedWaveEngine(
00095    LALStatus        *status,
00096    REAL4Vector      *signal1,
00097    REAL4Vector      *signal2,
00098    REAL4Vector      *a,
00099    REAL4Vector      *ff,
00100    REAL8Vector      *phi,
00101    INT4             *countback,
00102    InspiralTemplate *params
00103    );
00104 
00105 
00106 NRCSID (LALINSPIRALAMPLITUDECORRECTEDWAVEC, "$Id: LALInspiralAmplitudeCorrectedWave.c,v 1.10 2008/05/29 15:25:08 thomas Exp $");
00107 
00108 /*  <lalVerbatim file="LALInspiralAmplitudeCorrectedWaveCP"> */
00109 void 
00110 LALInspiralAmplitudeCorrectedWave(
00111    LALStatus        *status,
00112    REAL4Vector      *signal,
00113    InspiralTemplate *params
00114    )
00115  { /* </lalVerbatim>  */
00116 
00117    INT4 count;
00118    
00119    INITSTATUS(status, "LALInspiralAmplitudeCorrectedWave",LALINSPIRALAMPLITUDECORRECTEDWAVEC);
00120    ATTATCHSTATUSPTR(status);
00121 
00122    ASSERT(signal, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00123    ASSERT(signal->data, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00124 
00125    /* Initially the waveform is empty*/
00126    memset(signal->data, 0, signal->length*sizeof(REAL4));
00127 
00128    /*Call the engine function*/
00129    LALInspiralAmplitudeCorrectedWaveEngine(status->statusPtr, signal, NULL, NULL, NULL, NULL, &count, params);
00130    CHECKSTATUSPTR(status);
00131    
00132    DETATCHSTATUSPTR(status);
00133    RETURN (status);
00134 }
00135 
00136 
00137 
00138 NRCSID (LALINSPIRALAMPLITUDECORRECTEDWAVETEMPLATESC, "$Id: LALInspiralAmplitudeCorrectedWave.c,v 1.10 2008/05/29 15:25:08 thomas Exp $");
00139 
00140 /*  <lalVerbatim file="LALInspiralAmplitudeCorrectedWaveTemplatesCP"> */
00141 void 
00142 LALInspiralAmplitudeCorrectedWaveTemplates(
00143    LALStatus        *status,
00144    REAL4Vector      *signal1,
00145    REAL4Vector      *signal2,
00146    InspiralTemplate *params
00147    )
00148  { /* </lalVerbatim>  */
00149 
00150    INT4 count;
00151    
00152    INITSTATUS(status, "LALInspiralAmplitudeCorrectedWaveTemplates",LALINSPIRALAMPLITUDECORRECTEDWAVETEMPLATESC);
00153    ATTATCHSTATUSPTR(status);
00154 
00155    ASSERT(signal1, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00156    ASSERT(signal2, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00157    ASSERT(signal1->data, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00158    ASSERT(signal2->data, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00159 
00160    /* Initially the waveforms are empty */
00161    memset(signal1->data, 0, signal1->length * sizeof(REAL4));
00162    memset(signal2->data, 0, signal2->length * sizeof(REAL4));
00163 
00164    /* Call the engine function */
00165    LALInspiralAmplitudeCorrectedWaveEngine(status->statusPtr, signal1, signal2, NULL, NULL, NULL, &count, params);
00166    CHECKSTATUSPTR(status);   
00167 
00168    DETATCHSTATUSPTR(status);
00169    RETURN (status);
00170 }
00171 
00172 /* 
00173    Interface routine needed to generate time-domain T- or a P-approximant
00174    waveforms for injection packages T.Cokelaer sept 2003
00175 */
00176 
00177 NRCSID (LALINSPIRALAMPLITUDECORRECTEDWAVEFORINJECTIONC, "$Id: LALInspiralAmplitudeCorrectedWave.c,v 1.10 2008/05/29 15:25:08 thomas Exp $");
00178 
00179 /*  <lalVerbatim file="LALInspiralAmplitudeCorrectedWaveForInjectionCP"> */
00180 void 
00181 LALInspiralAmplitudeCorrectedWaveForInjection(
00182                              LALStatus        *status,
00183                              CoherentGW       *waveform,
00184                              InspiralTemplate *params,
00185                              PPNParamStruc  *ppnParams                       
00186                              )
00187 { /* </lalVerbatim>  */
00188  
00189   INT4        count, i;
00190   REAL8       p, phiC;  
00191   
00192   REAL4Vector a;           /* pointers to generated amplitude  data */
00193   REAL4Vector ff;          /* pointers to generated  frequency data */
00194   REAL8Vector phi;         /* generated phase data */
00195   
00196   CreateVectorSequenceIn in;
00197   
00198   CHAR message[256];
00199   
00200   InspiralInit paramsInit;  
00201 
00202   INITSTATUS(status,"LALInspiralAmplitudeCorrectedWaveForInjection",
00203   LALINSPIRALAMPLITUDECORRECTEDWAVETEMPLATESC);
00204   ATTATCHSTATUSPTR(status);
00205   
00206   /* Make sure parameter and waveform structures exist. */
00207   ASSERT( params, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
00208   ASSERT(waveform, status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);  
00209   ASSERT( !( waveform->a ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
00210   ASSERT( !( waveform->f ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
00211   ASSERT( !( waveform->phi ), status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL );
00212   
00213   /* Compute some parameters*/
00214   LALInspiralInit(status->statusPtr, params, &paramsInit);
00215   CHECKSTATUSPTR(status);   
00216     
00217   if (paramsInit.nbins == 0){
00218       DETATCHSTATUSPTR(status);
00219       RETURN (status);
00220   }
00221 
00222   /* Now we can allocate memory and vector for coherentGW structure*/     
00223 
00224   ff.length  = paramsInit.nbins;
00225   a.length   = 2* paramsInit.nbins;
00226   phi.length = paramsInit.nbins;
00227   
00228   ff.data = (REAL4 *) LALCalloc(paramsInit.nbins, sizeof(REAL4));
00229   a.data  = (REAL4 *) LALCalloc(2 * paramsInit.nbins, sizeof(REAL4));
00230   phi.data= (REAL8 *) LALCalloc(paramsInit.nbins, sizeof(REAL8));
00231 
00232   /* Check momory allocation is okay */
00233   if (!(ff.data) || !(a.data) || !(phi.data))
00234   {
00235     if (ff.data)  LALFree(ff.data);
00236     if (a.data)   LALFree(a.data);
00237     if (phi.data) LALFree(phi.data);
00238 
00239   
00240     ABORT( status, LALINSPIRALH_EMEM, LALINSPIRALH_MSGEMEM );
00241   }
00242 
00243   count = 0;
00244 
00245   /* Call the engine function */
00246   LALInspiralAmplitudeCorrectedWaveEngine(status->statusPtr, NULL, NULL, &a, &ff, &phi, &count, params);
00247   BEGINFAIL( status )
00248   {
00249     LALFree(ff.data);
00250     LALFree(a.data);
00251     LALFree(phi.data);
00252   }
00253   ENDFAIL( status );
00254      
00255   p = phi.data[count-1];
00256   
00257   params->fFinal = ff.data[count-1];
00258   sprintf(message, "cycles = %f", p/(double)LAL_TWOPI);
00259   LALInfo(status, message);
00260 
00261   if ( (INT4)(p/LAL_TWOPI) < 2 ){
00262     sprintf(message, "The waveform has only %f cycles; we don't keep waveform with less than 2 cycles.", 
00263                p/(double)LAL_TWOPI );
00264     XLALPrintError(message);
00265     LALWarning(status, message);
00266   }
00267 
00268       /*wrap the phase vector*/
00269       phiC =  phi.data[count-1] ;
00270       for (i = 0; i < count; i++)
00271         {
00272           phi.data[i] =  phi.data[i] - phiC + ppnParams->phi;
00273         }
00274       
00275       /* Allocate the waveform structures. */
00276       if ( ( waveform->a = (REAL4TimeVectorSeries *)
00277              LALCalloc(1, sizeof(REAL4TimeVectorSeries) ) ) == NULL ) {
00278         ABORT( status, LALINSPIRALH_EMEM,
00279                LALINSPIRALH_MSGEMEM );
00280       }
00281       if ( ( waveform->f = (REAL4TimeSeries *)
00282              LALCalloc(1, sizeof(REAL4TimeSeries) ) ) == NULL ) {
00283         LALFree( waveform->a ); waveform->a = NULL;
00284         ABORT( status, LALINSPIRALH_EMEM,
00285                LALINSPIRALH_MSGEMEM );
00286       }
00287       if ( ( waveform->phi = (REAL8TimeSeries *)
00288              LALCalloc(1, sizeof(REAL8TimeSeries) ) ) == NULL ) {
00289         LALFree( waveform->a ); waveform->a = NULL;
00290         LALFree( waveform->f ); waveform->f = NULL;
00291         ABORT( status, LALINSPIRALH_EMEM,
00292                LALINSPIRALH_MSGEMEM );
00293       }
00294       
00295       
00296       in.length = (UINT4)(count);
00297       in.vectorLength = 2;
00298       
00299       LALSCreateVectorSequence( status->statusPtr, &( waveform->h->data ), &in );
00300       CHECKSTATUSPTR(status);      
00301       
00302       LALSCreateVectorSequence( status->statusPtr, &( waveform->a->data ), &in );
00303       CHECKSTATUSPTR(status);      
00304       
00305       LALSCreateVector( status->statusPtr, &( waveform->f->data ), count);
00306       CHECKSTATUSPTR(status);      
00307       
00308       LALDCreateVector( status->statusPtr, &( waveform->phi->data ), count );
00309       CHECKSTATUSPTR(status);        
00310      
00311       memcpy(waveform->f->data->data , ff.data, count*(sizeof(REAL4)));
00312       memcpy(waveform->h->data->data , a.data, 2*count*(sizeof(REAL4)));
00313       memcpy(waveform->a->data->data , a.data, 2*count*(sizeof(REAL4)));
00314       memcpy(waveform->phi->data->data ,phi.data, count*(sizeof(REAL8)));
00315       
00316       waveform->a->deltaT = waveform->f->deltaT = waveform->phi->deltaT = waveform->h->deltaT
00317         = ppnParams->deltaT;
00318       
00319       waveform->a->sampleUnits    = lalStrainUnit;
00320       waveform->f->sampleUnits    = lalHertzUnit;
00321       waveform->phi->sampleUnits  = lalDimensionlessUnit;
00322       waveform->position = ppnParams->position;
00323       waveform->psi = ppnParams->psi;
00324 
00325       LALSnprintf( waveform->a->name, LALNameLength,   "T1 inspiral amplitude" );
00326       LALSnprintf( waveform->f->name, LALNameLength,   "T1 inspiral frequency" );
00327       LALSnprintf( waveform->phi->name, LALNameLength, "T1 inspiral phase" );
00328       
00329       /* --- fill some output ---*/
00330       ppnParams->tc     = (double)(count-1) / params->tSampling ;
00331       ppnParams->length = count;
00332       ppnParams->dfdt   = ((REAL4)(waveform->f->data->data[count-1] 
00333                                    - waveform->f->data->data[count-2]))
00334         * ppnParams->deltaT;
00335       ppnParams->fStop  = params->fFinal;
00336       ppnParams->termCode        = GENERATEPPNINSPIRALH_EFSTOP;
00337       ppnParams->termDescription = GENERATEPPNINSPIRALH_MSGEFSTOP;
00338       
00339       ppnParams->fStart   = ppnParams->fStartIn;
00340 
00341   /* --- free memory --- */
00342   LALFree(ff.data);
00343   LALFree(a.data);
00344   LALFree(phi.data); 
00345  
00346   DETATCHSTATUSPTR(status);
00347   RETURN (status);
00348 }
00349 
00350 /*
00351  *  Engine function for use by other LALInspiralAmplitudeCorrectedWave* functions
00352  *  Craig Robinson April 2005
00353  */
00354 
00355 NRCSID (LALINSPIRALAMPLITUDECORRECTEDWAVEENGINEC, "$Id: LALInspiralAmplitudeCorrectedWave.c,v 1.10 2008/05/29 15:25:08 thomas Exp $");
00356 
00357 void
00358 LALInspiralAmplitudeCorrectedWaveEngine(
00359                 LALStatus        *status,
00360                 REAL4Vector      *signal1,
00361                 REAL4Vector      *signal2,
00362                 REAL4Vector      *a,
00363                 REAL4Vector      *ff,
00364                 REAL8Vector      *phi,
00365                 INT4             *countback,
00366                 InspiralTemplate *params)
00367 {
00368    PPNParamStruc ppnParams;
00369    CoherentGW   waveform; 
00370    INT4 i, count;
00371    REAL8 dt;
00372    REAL8 mTot = 0;
00373    REAL8 unitHz = 0;
00374    REAL8 mu = 0; 
00375    REAL8 cosI = 0;/* cosine of system inclination */
00376    REAL8 etab = 0;
00377    REAL8 fFac = 0; /* SI normalization for f and t */
00378    REAL8 f2aFac = 0;/* factor multiplying f in amplitude function */
00379    REAL8 apFac = 0, acFac = 0;/* extra factor in plus and cross amplitudes */
00380  
00381    REAL4 hPlus, hCross;
00382    double fPlus, fCross; 
00383   
00384   /* LALDetector det;
00385    InterferometerNumber ifoNumber = LAL_UNKNOWN_IFO;
00386    REAL4 longitude,latitude,polarization,gmst;
00387 */
00388    INITSTATUS(status, "LALInspiralAmplitudeCorrectedWaveEngine", LALINSPIRALAMPLITUDECORRECTEDWAVEENGINEC);
00389    ATTATCHSTATUSPTR(status);
00390 
00391    ASSERT (params,  status, LALINSPIRALH_ENULL, LALINSPIRALH_MSGENULL);
00392    ASSERT (params->nStartPad >= 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00393    ASSERT (params->nEndPad >= 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00394    ASSERT (params->fLower > 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00395    ASSERT (params->tSampling > 0, status, LALINSPIRALH_ESIZE, LALINSPIRALH_MSGESIZE);
00396 
00397 
00398    /* First, we compute the fplus and fcross*/
00399 /*   memset( &det, 0, sizeof(LALDetector));
00400    ifoNumber = XLALIFONumber("H1");
00401    XLALReturnDetector(&det, ifoNumber);
00402    longitude = 0.4;
00403    latitude = 0.4;
00404    gmst = 0.4;
00405    XLALComputeDetAMResponse(&fPlus, &fCross, det.response, longitude, latitude, params->polarisationAngle, gmst);
00406   */
00407   /* For  overhead injection, we just need to compute these 2 expresions for fplus and fcross */
00408   fPlus = cos(2.*params->polarisationAngle);
00409   fCross = sin(2.*params->polarisationAngle);
00410 
00411    dt = 1./params->tSampling;
00412 
00413    /* some values to be used to compute h(t)*/ 
00414    {
00415       mTot   = params->mass1 + params->mass2;
00416       etab   = params->mass1 * params->mass2;
00417       etab  /= mTot;
00418       etab  /= mTot;
00419       unitHz = mTot *LAL_MTSUN_SI*(REAL8)LAL_PI;
00420       /*cosI and the following parameters are probably useless. apFac and acFac 
00421        * are computed within GeneratePPNAmpCor*/
00422       cosI   = cos( params->inclination );
00423       mu     = etab * mTot;  
00424       fFac   = 1.0 / ( 4.0*LAL_TWOPI*LAL_MTSUN_SI*mTot );
00425       f2aFac = LAL_PI*LAL_MTSUN_SI*mTot*fFac;   
00426       apFac  = acFac = -2.0 * mu * LAL_MRSUN_SI/params->distance;
00427       apFac *= 1.0 + cosI*cosI;
00428       acFac *= 2.0*cosI;
00429       params->nStartPad = 0;
00430    }
00431    
00432    /* this parameters are not used in GeneratePPNAmp*/
00433    ppnParams.position.latitude = ppnParams.position.longitude = 0.;
00434    ppnParams.position.system = COORDINATESYSTEM_EQUATORIAL;
00435    ppnParams.psi = 0.0;
00436    ppnParams.lengthIn = 0.0;
00437 
00438    /* The following fields are used by GeneratePPNAmpCor function */
00439    /* Variable Parameters */
00440    ppnParams.mTot = mTot;
00441    ppnParams.eta = etab;
00442    ppnParams.d = LAL_PC_SI*1.0e3;
00443    ppnParams.inc = params->inclination;
00444    /* GeneratePPN does not set the starting phase.*/
00445    ppnParams.phi = params->startPhase;
00446    ppnParams.fStartIn = params->fLower;
00447    /* set to zero so that GeneratePPNAmp recomputes the flso*/
00448    ppnParams.fStopIn = 0.;
00449    ppnParams.ppn = NULL;
00450    ppnParams.ampOrder = params->ampOrder;
00451    /* set ther PN order of the flux */
00452    LALSCreateVector( status->statusPtr, &(ppnParams.ppn), params->order + 1 );
00453    ppnParams.ppn->data[0] = 1.0;
00454    if ( params->order > 0 )
00455      ppnParams.ppn->data[1] = 0.0;
00456    for ( i = 2; i <= (INT4)( params->order ); i++ )
00457      ppnParams.ppn->data[i] = 1.0;
00458         ppnParams.fStopIn = 0;
00459         ppnParams.deltaT = dt;
00460         
00461 
00462    count = 0;
00463    if (signal2) {
00464    params->nStartPad = 0;
00465    } /* for template genera  memset( &waveform, 0, sizeof(CoherentGW) );
00466 tion, that value must be zero*/   
00467    else if (signal1) {
00468      count = params->nStartPad;
00469    }
00470 
00471    memset( &waveform, 0, sizeof(CoherentGW) );
00472    LALGeneratePPNAmpCorInspiral( status->statusPtr, &waveform, &ppnParams );
00473 
00474 
00475   
00476 
00477 
00478    count = 0; 
00479   for (i=0;i<(INT4)waveform.h->data->length; i++)
00480   {
00481            /* Non-injection case */
00482       if (signal1)
00483       {
00484          /* For amplitude corrected waveforms, we do not want only h+ or only hx but F+h+ + FxHx*/
00485          hPlus  = (REAL4) waveform.h->data->data[2*i];
00486          hCross = (REAL4) waveform.h->data->data[2*i+1];
00487          *(signal1->data + count) = fPlus * hPlus + fCross * hCross;
00488          /* todo: add an Abort if signal2<>0*/
00489          if (signal2)
00490          {
00491          *(signal2->data + count) = (REAL4) waveform.h->data->data[2*i+1];
00492          }
00493       }
00494 
00495       /* Injection case */
00496       else if (a)
00497       {
00498           #if 0
00499           omega = v*v*v;    
00500           ff->data[count]       = (REAL4)(omega/unitHz);
00501           f2a                   = pow (f2aFac * omega, 2./3.);
00502           /* waveform->a does not exist. Only waveform->h is populated within 
00503           GeneratePPNAmpCorr function.
00504           */
00505           a->data[2*count]      = (REAL4) waveform.a->data->data[count];
00506           a->data[2*count+1]    = (REAL4) waveform.a->data->data[count];
00507           phi->data[count]      = (REAL8) waveform.phi->data->data[count];
00508           #endif
00509       }
00510     
00511                 count++;                       
00512    }
00513  
00514  
00515    params->tC = count*dt;
00516    
00517    /* The final frequency needs to take into account the amplitude corrected order */
00518    params->fFinal = waveform.f->data->data[count-1] * (params->ampOrder+2.)/2.; 
00519   
00520  
00521    *countback = count;
00522 
00523         /* destroy the waveform signal */
00524    if ( waveform.a ){
00525      LALSDestroyVectorSequence( status->statusPtr, &(waveform.a->data) );
00526      CHECKSTATUSPTR( status );
00527      LALFree( waveform.a );
00528    }
00529    if ( waveform.shift )
00530     {
00531       LALSDestroyVector( status->statusPtr, &(waveform.shift->data) );
00532       CHECKSTATUSPTR( status );
00533       LALFree( waveform.shift );
00534     }
00535    
00536     if ( waveform.f ){
00537     LALSDestroyVector( status->statusPtr, &(waveform.f->data) );
00538     CHECKSTATUSPTR( status );
00539       LALFree( waveform.f );
00540     }
00541 
00542     if ( waveform.phi ){
00543     LALDDestroyVector( status->statusPtr, &(waveform.phi->data) );
00544     CHECKSTATUSPTR( status );
00545       LALFree( waveform.phi );
00546     }
00547 
00548    if ( waveform.h ){ 
00549     LALSDestroyVectorSequence( status->statusPtr, &(waveform.h->data) );
00550     CHECKSTATUSPTR( status );
00551     LALFree( waveform.h );
00552     }
00553     
00554 
00555    DETATCHSTATUSPTR(status);
00556    RETURN (status);
00557 
00558 }                      

Generated on Mon Sep 8 03:06:57 2008 for LAL by  doxygen 1.5.2