00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
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
00062 INT4 lalDebugLevel = 1;
00063
00064 int
00065 main(int argc, char **argv)
00066 {
00067
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
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
00096
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
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 }