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
00054 #include <math.h>
00055 #include <stdlib.h>
00056 #include <lal/LALInspiralBank.h>
00057 #include <lal/AVFactories.h>
00058 #include <lal/SeqFactories.h>
00059
00060 NRCSID(FLATMESHTESTC,"$Id: BCVTemplates.c,v 1.17 2007/06/08 14:41:42 bema Exp $");
00061
00062
00063 INT4 lalDebugLevel = 0;
00064
00065 int
00066 main(int argc, char **argv)
00067 {
00068
00069 static LALStatus status;
00070 static InspiralCoarseBankIn coarseIn;
00071 static InspiralTemplateList *list1, *list2;
00072
00073 static RectangleIn RectIn;
00074 static RectangleOut RectOut;
00075 void (*noisemodel)(LALStatus*,REAL8*,REAL8) = LALLIGOIPsd;
00076
00077 UINT4 j, valid, numPSDpts=262144;
00078 FILE *fpr;
00079 INT4 nlist1, nlist2;
00080
00081
00082
00083 fpr = fopen("BCVTemplates.out", "w");
00084 nlist1 = 0;
00085 nlist2 = 0;
00086 coarseIn.HighGM =6.;
00087 coarseIn.LowGM = 3.;
00088 coarseIn.fLower = 40.L;
00089 coarseIn.fUpper = 2000.L;
00090 coarseIn.tSampling = 4096.L;
00091 coarseIn.order = twoPN;
00092 coarseIn.space = Tau0Tau3;
00093 coarseIn.mmCoarse = 0.95;
00094 coarseIn.mmFine = 0.97;
00095 coarseIn.iflso = 0.0L;
00096 coarseIn.mMin = 3.0;
00097 coarseIn.mMax = 20.0;
00098 coarseIn.MMax = coarseIn.mMax * 2.;
00099 coarseIn.massRange = MinMaxComponentMass;
00100
00101
00102 coarseIn.etamin = coarseIn.mMin * ( coarseIn.MMax - coarseIn.mMin) / pow(coarseIn.MMax,2.);
00103 coarseIn.psi0Min = 1.e0;
00104 coarseIn.psi0Max = 2.5e4;
00105 coarseIn.psi3Min = -2.2e3;
00106 coarseIn.psi3Max = 8.e2;
00107 coarseIn.alpha = 0.L;
00108 coarseIn.numFcutTemplates = 4;
00109
00110 memset( &(coarseIn.shf), 0, sizeof(REAL8FrequencySeries) );
00111 coarseIn.shf.f0 = 0;
00112 LALDCreateVector( &status, &(coarseIn.shf.data), numPSDpts );
00113 coarseIn.shf.deltaF = coarseIn.tSampling / (2.*(REAL8) coarseIn.shf.data->length + 1.L);
00114 LALNoiseSpectralDensity (&status, coarseIn.shf.data, noisemodel, coarseIn.shf.deltaF );
00115
00116 coarseIn.approximant = BCV;
00117 coarseIn.space = Psi0Psi3;
00118
00119 LALInspiralCreateCoarseBank(&status, &list1, &nlist1, coarseIn);
00120 for (j=0; j<nlist1; j++)
00121 {
00122 fprintf(fpr, "%e %e %e %e\n",
00123 list1[j].params.psi0,
00124 list1[j].params.psi3,
00125 list1[j].params.totalMass,
00126 list1[j].params.fFinal);
00127 }
00128 fprintf(fpr, "&\n");
00129 coarseIn.approximant = TaylorT1;
00130 coarseIn.space = Tau0Tau3;
00131
00132 LALInspiralCreateCoarseBank(&status, &list2, &nlist2, coarseIn);
00133
00134 for (j=0; j<nlist2; j++)
00135 {
00136 fprintf(fpr, "%e %e %e %e\n",
00137 list2[j].params.t0,
00138 list2[j].params.t3,
00139 list2[j].params.mass1,
00140 list2[j].params.mass2
00141 );
00142 }
00143
00144 fprintf(fpr, "&\n");
00145
00146
00147
00148 RectIn.dx = sqrt(2.0 * (1. - coarseIn.mmCoarse)/list1[0].metric.g00 );
00149 RectIn.dy = sqrt(2.0 * (1. - coarseIn.mmCoarse)/list1[0].metric.g11 );
00150 RectIn.theta = list1[0].metric.theta;
00151
00152
00153 for (j=0; j<nlist1; j++)
00154 {
00155
00156
00157
00158 RectIn.x0 = (REAL8) list1[j].params.psi0;
00159 RectIn.y0 = (REAL8) list1[j].params.psi3;
00160
00161
00162
00163 valid = 1;
00164 if (valid)
00165 {
00166 LALRectangleVertices(&status, &RectOut, &RectIn);
00167 fprintf(fpr, "%e %e\n%e %e\n%e %e\n%e %e\n%e %e\n",
00168 RectOut.x1, RectOut.y1,
00169 RectOut.x2, RectOut.y2,
00170 RectOut.x3, RectOut.y3,
00171 RectOut.x4, RectOut.y4,
00172 RectOut.x5, RectOut.y5);
00173 fprintf(fpr, "&\n");
00174 }
00175 }
00176
00177
00178 if (list1 != NULL) LALFree (list1);
00179 if (list2 != NULL) LALFree (list2);
00180 LALDDestroyVector( &status, &(coarseIn.shf.data) );
00181 LALCheckMemoryLeaks();
00182 fclose(fpr);
00183 return 0;
00184 }