BCVSpinTemplates.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 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="BCVSpinTemplatesCV">
00021 Author: B.S. Sathyaprakash
00022 $Id: BCVSpinTemplates.c,v 1.11 2008/03/10 16:19:15 vdbroeck Exp $
00023 **************************************************** </lalVerbatim> */
00024 
00025 /********************************************************** <lalLaTeX>
00026 
00027 \subsection{Program \texttt{BCVSpinTemplates.c}}
00028 \label{ss:BCVSpinTemplates.c}
00029 
00030 Creates a template mesh for BCVSpin using the mismatch metric.
00031 
00032 \subsubsection*{Usage}
00033 
00034 \subsubsection*{Description}
00035 
00036 \subsubsection*{Exit codes}
00037 ****************************************** </lalLaTeX><lalErrTable> */
00038 /******************************************** </lalErrTable><lalLaTeX>
00039 
00040 \subsubsection*{Algorithm}
00041 
00042 \subsubsection*{Uses}
00043 \begin{verbatim}
00044 lalDebugLevel
00045 \end{verbatim}
00046 
00047 \subsubsection*{Notes}
00048 
00049 \vfill{\footnotesize\input{BCVSpinTemplatesCV}}
00050 
00051 ******************************************************* </lalLaTeX> */
00052 
00053 #include <math.h>
00054 #include <stdlib.h>
00055 #include <lal/LALInspiralBank.h>
00056 #include <lal/AVFactories.h>
00057 #include <lal/SeqFactories.h>
00058 
00059 NRCSID(FLATMESHTESTC,"$Id: BCVSpinTemplates.c,v 1.11 2008/03/10 16:19:15 vdbroeck Exp $");
00060 
00061 /* Default parameter settings. */
00062 INT4 lalDebugLevel = 1;
00063 
00064 int
00065 main(int argc, char **argv)
00066 {
00067   /* top-level status structure */
00068  UINT4   numPSDpts=8193;
00069   static LALStatus status;     
00070   static InspiralCoarseBankIn coarseIn;
00071   void *noisemodel = LALLIGOIPsd;
00072   double beta;
00073   SnglInspiralTable *tiles=NULL, *first=NULL;
00074   FILE *fpr;
00075 
00076 /* Number of templates is nlist */
00077   INT4 nlist1, j;
00078 
00079 
00080   fpr = fopen("BCVSpinTemplates.out", "w");
00081   nlist1 = 0;
00082   coarseIn.HighGM = 6.; 
00083   coarseIn.LowGM = -4.;
00084   coarseIn.fLower = 40.L;
00085   coarseIn.fUpper = 400.L;
00086   coarseIn.tSampling = 4096.L;
00087   coarseIn.order = twoPN;
00088   coarseIn.mmCoarse = 0.90;
00089   coarseIn.mmFine = 0.90;
00090   coarseIn.iflso = 0.0L;
00091   coarseIn.mMin = 3.0;
00092   coarseIn.mMax = 20.0;
00093   coarseIn.MMax = coarseIn.mMax * 2.;
00094   coarseIn.massRange = MinMaxComponentMass; 
00095   /* coarseIn.massRange = MinComponentMassMaxTotalMass;*/
00096   /* minimum value of eta */
00097   coarseIn.etamin = coarseIn.mMin * ( coarseIn.MMax - coarseIn.mMin) / pow(coarseIn.MMax,2.);
00098   coarseIn.psi0Min = 1.0e4;
00099   coarseIn.psi0Max = 6.0e4;
00100   coarseIn.psi3Min = -5.0e2;
00101   coarseIn.psi3Max = 1.0e1;
00102   coarseIn.alpha = 0.L;
00103   coarseIn.numFcutTemplates = 1;
00104   coarseIn.betaMin = 10.0;
00105   coarseIn.betaMax = 700.;
00106   coarseIn.spinBank = 2;
00107   coarseIn.iseed = 9295883;
00108   coarseIn.nTIni = 10000;
00109   coarseIn.ShMaxSz = 1024;
00110   coarseIn.gridSpacing = Hexagonal;
00111   coarseIn.insidePolygon = True;
00112 
00113   memset( &(coarseIn.shf), 0, sizeof(REAL8FrequencySeries) );
00114   coarseIn.shf.f0 = 0;
00115   LALDCreateVector( &status, &(coarseIn.shf.data), numPSDpts );
00116   coarseIn.shf.deltaF = coarseIn.tSampling / (2.*(REAL8) coarseIn.shf.data->length + 1.L);
00117   LALNoiseSpectralDensity (&status, coarseIn.shf.data, noisemodel, coarseIn.shf.deltaF );
00118 
00119   coarseIn.approximant = BCVSpin;
00120   coarseIn.space       = Psi0Psi3;
00121   
00122   
00123   LALInspiralBCVSpinRandomBank (&status, &tiles, &nlist1, &coarseIn);
00124 /*
00125   LALInspiralBankGeneration(&status, &coarseIn, &tiles, &nlist1);
00126 */
00127   LALDDestroyVector( &status, &(coarseIn.shf.data) );
00128 
00129   fprintf (fpr, "#numtemplaes=%d %e %e %e %e %e %e\n", nlist1, coarseIn.psi0Min, coarseIn.psi0Max, coarseIn.psi3Min, coarseIn.psi3Max, coarseIn.betaMin, coarseIn.betaMax);
00130   beta = tiles->beta;
00131   first = tiles;
00132   for (j=0; j<nlist1; j++)
00133   {
00134           fprintf(fpr, "%7.3f %e %e\n", beta, tiles->psi0, tiles->psi3);
00135           tiles = tiles->next;
00136           if (tiles != NULL && beta != tiles->beta)
00137           {
00138                   beta = tiles->beta;
00139           }
00140   }
00141   fclose(fpr);
00142 
00143   tiles = first;
00144   for (j=0; j<nlist1; j++)
00145   {
00146           first = tiles ->next;
00147           if (tiles != NULL) LALFree(tiles);
00148           tiles = first;
00149   }
00150   LALCheckMemoryLeaks();
00151   return 0;
00152 }

Generated on Wed Jul 23 03:16:44 2008 for LAL by  doxygen 1.5.2