21#include <lal/LALInspiralBank.h>
22#include <lal/AVFactories.h>
23#include <lal/SeqFactories.h>
24#include <lal/LALStdio.h>
25#include <lal/FindRoot.h>
28#define UNUSED __attribute__ ((unused))
118 bankParams.
metric = &metric;
153 *nlist = tempList->
length;
162 for ( j = 0; j < *nlist; ++j )
164 (*list)[j].params.psi0 = (
REAL8) tempList->
data[2*j];
165 (*list)[j].params.psi3 = (
REAL8) tempList->
data[2*j+1];
166 (*list)[j].params.fLower =
params.fLower;
167 (*list)[j].
params.nStartPad = 0;
168 (*list)[j].params.nEndPad = 0;
169 (*list)[j].params.tSampling = coarseIn.
tSampling;
170 (*list)[j].params.distance = 1.;
171 (*list)[j].params.signalAmplitude = 1.;
172 (*list)[j].params.approximant =
BCV;
175 (*list)[j].metric = metric;
176 (*list)[j].params.alpha = coarseIn.
alpha;
195 list, nlist, coarseIn);
198 else if (coarseIn.
LowGM == -1)
201 list, nlist, coarseIn);
207 list, nlist, coarseIn);
214 "LALInspiralBCVBank: template numbers before %d and after %d calling LALInspiralBCVBank\n",
290 metric = bankParams->
metric;
293 bankParams, *metric, minimalMatch );
297 for (x1 = bankParams->
x1Min; x1 <= bankParams->x1Max; x1 += bankParams->
dx1)
299 for (x0 = bankParams->
x0Min; x0 <= bankParams->x0Max; x0 += bankParams->
dx0)
301 UINT4 ndx = 2 * nlist;
307 list->
data[ndx] = x0;
308 list->
data[ndx + 1] = x1;
411 ndx = nlist = *NList;
413 LowGM = coarseIn.
LowGM;
424 frac = (1.L - 1.L/pow(HighGM/3., 1.5L)) / (nf-1.L);
428 for ( j = 0; j < nlist; ++j )
439 fMax = (*list)[j].params.fFinal;
441 for (
i = 0;
i < nf; ++
i )
443 fendBCV = fMax * (1.L - (
REAL8)
i * frac);
445 if ( (*list)[j].
params.tSampling <= 0 )
451 if ( fendBCV > (*list)[j].
params.fLower &&
452 fendBCV < (*list)[j].
params.tSampling / 2.0 )
463 (*list)[ndx-1] = (*list)[j];
464 (*list)[ndx-1].params.fFinal = fendBCV;
465 (*list)[ndx-1].metric = (*list)[0].metric;
466 (*list)[ndx-1].nLayer =
i;
472 for ( j = nlist; j < ndx; ++j )
474 (*list)[j-nlist] = (*list)[j];
477 *NList = ndx - nlist;
512 totalMass =
params->totalMass;
530 params->t0 = 5.0 / ( 256.0*eta*pow(totalMass, (5./3.)) *
561 ndx = nlist = *NList;
566 for ( j = 0; j < nlist; ++j )
570 &((*list)[j].
params), &valid , LowGM);
577 fMax = (*list)[j].params.fFinal;
578 if ( (*list)[j].
params.tSampling <= 0 )
589 frac = (1.L - 1.L/pow(HighGM/3., 1.5L)) / (nf-1.L);
596 if (((fMax * (1.L - (
REAL4) (nf-1) * frac)) >= (*list)[j].
params.tSampling/2.0))
598 fMax = (*list)[j].params.tSampling/2.0 - 1. ;
610 fendBCV = fMax * (1.L - (
REAL4)
i * frac);
612 if ( fendBCV >= (*list)[j].
params.fLower * 1.5 &&
613 fendBCV < (*list)[j].
params.tSampling / 2.0 )
623 (*list)[ndx-1] = (*list)[j];
624 (*list)[ndx-1].params.fFinal = fendBCV;
625 (*list)[ndx-1].metric = (*list)[0].metric;
626 (*list)[ndx-1].nLayer =
i;
631 for ( j = nlist; j < ndx; ++j )
633 (*list)[j-nlist] = (*list)[j];
635 *NList = ndx - nlist;
658 UINT4 i,nf, nlist, j, ndx;
664 ndx = nlist = *NList;
666 for ( j = 0; j < nlist; ++j )
668 for (
i = 1;
i <=nf; ++
i )
670 fendBCV = (*list)[j].params.fLower
671 +
i * ((*list)[j].params.tSampling/2.0 - (*list)[j].params.fLower) / nf ;
681 (*list)[ndx-1] = (*list)[j];
682 (*list)[ndx-1].params.fFinal = fendBCV;
683 (*list)[ndx-1].metric = (*list)[0].metric;
684 (*list)[ndx-1].nLayer =
i;
689 for ( j = nlist; j < ndx; ++j )
691 (*list)[j-nlist] = (*list)[j];
694 *NList = ndx - nlist;
753 REAL8 x0, x1, dx1=0, dx0=0,
x=0,
y=0;
757 REAL4 xp[8] = {3000, 40000, 100000, 300000, 550000, 550000, 250000,3000};
758 REAL4 yp[8] = {0, -3000, -3000, -2000, -1500, -300, -300, 0};
769 metric = bankParams->
metric;
776 dx0 = sqrt(2.L * (1.L - minimalMatch)/metric->
g00 );
777 dx1 = sqrt(2.L * (1.L - minimalMatch)/metric->
g11 );
778 dx0 *=3./2./sqrt(2.);
782 dx0 = sqrt(2.L * (1.L - minimalMatch)/metric->
g00 );
783 dx1 = sqrt(2.L * (1.L - minimalMatch)/metric->
g11 );
787 bankParams, *metric, minimalMatch );
789 dx0 = bankParams->
dx0 * 3./2./sqrt(2.);
790 dx1 = bankParams->
dx1 * sqrt(3./2.);
795 bankParams, *metric, minimalMatch );
797 dx0 = bankParams->
dx0;
798 dx1 = bankParams->
dx1;
811 for (x1 = bankParams->
x1Min -1e6; x1 <= bankParams->x1Max + 1e6; x1 += dx1)
814 for (x0 = bankParams->
x0Min - 1e6 +dx0/2.*(layer%2); x0 <= bankParams->x0Max+1e6; x0 += dx0 )
816 UINT4 ndx = 2 * nlist;
819 x = x0 *cos(metric->
theta) + sin(metric->
theta)* x1;
820 y = x0 *sin(metric->
theta) - cos(metric->
theta)* x1;
828 if ( (
x > bankParams->
x0Min -dx0/2.) && (y < bankParams->x1Max + dx1/2.) &&
829 (x < bankParams->x0Max +dx0/2.) && (
y > bankParams->
x1Min - dx1/2.))
850 list->
data[ndx + 1] =
y;
863 for (x1 = bankParams->
x1Min -1e6; x1 <= bankParams->x1Max + 1e6; x1 += dx1)
865 for (x0 = bankParams->
x0Min - 1e6 ; x0 <= bankParams->x0Max+1e6; x0 += dx0 )
867 UINT4 ndx = 2 * nlist;
871 x = x0 *cos(metric->
theta) + sin(metric->
theta)* x1 ;
872 y = x0 *sin(metric->
theta) - cos(metric->
theta)* x1;
879 if ( (
x > bankParams->
x0Min - dx0/2.) && (y < bankParams->x1Max + dx1/2.) &&
880 (x < bankParams->x0Max + dx0/2.) && (
y > bankParams->
x1Min - dx1/2.))
900 list->
data[ndx + 1] =
y;
929 REAL4 psi0Int = 2500000.;
930 REAL4 psi3Int = -10000.;
935 if (
x > psi0Int &&
y < psi3Int )
void LALInspiralParameterCalc(LALStatus *status, InspiralTemplate *params)
#define ABORT(statusptr, code, mesg)
#define CHECKSTATUSPTR(statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
void LALSDestroyVectorSequence(LALStatus *status, REAL4VectorSequence **vectorSequence)
void LALSCreateVectorSequence(LALStatus *status, REAL4VectorSequence **vectorSequence, CreateVectorSequenceIn *vSeqParams)
int LALPrintError(const char *fmt,...)
@ psi0Andpsi3
BCV parameters and .
void LALInspiralBCVRegularFcutBank(LALStatus *status, InspiralTemplateList **list, INT4 *NList, InspiralCoarseBankIn coarseIn)
UNDOCUMENTED.
void LALInspiralCreateBCVBank(LALStatus *status, InspiralTemplateList **list, INT4 *nlist, InspiralCoarseBankIn coarseIn)
Lay a flat grid of BCV templates in the user specified range of the parameters in coarseIn structure...
void LALPSItoMasses(LALStatus *status, InspiralTemplate *params, UINT4 *valid, REAL4 HighGM)
UNDOCUMENTED.
void LALInspiralBCVBankFcutS3S4(LALStatus *status, InspiralTemplateList **list, INT4 *NList, InspiralCoarseBankIn coarseIn)
UNDOCUMENTED.
void LALInspiralCreateFlatBank(LALStatus *status, REAL4VectorSequence *list, InspiralBankParams *bankParams)
The code expects list->vectorLength=2 and allocates just the requisite amount of memory to list and r...
void LALEmpiricalPSItoMassesConversion(LALStatus *status, InspiralTemplate *params, UINT4 *valid, REAL4 lightring)
UNDOCUMENTED.
void LALInspiralCreateFlatBankS3S4(LALStatus *status, REAL4VectorSequence *list, InspiralBankParams *bankParams, InspiralCoarseBankIn coarseIn)
UNDOCUMENTED.
void LALExcludeTemplate(LALStatus *status, INT4 *valid, InspiralBankParams UNUSED *bankParams, REAL4 x, REAL4 y)
Thomas: 31 Aug 2006.
void LALInspiralBCVFcutBank(LALStatus *status, InspiralTemplateList **list, INT4 *NList, InspiralCoarseBankIn coarseIn)
Given a grid of templates with distinct values of this routine returns a new grid in which every tem...
void LALInsidePolygon(LALStatus *status, REAL4 *inputx, REAL4 *inputy, INT4 n, REAL4 x, REAL4 y, INT4 *valid)
Module to check whether a point with coordinates (x,y) is inside a polygon defined by the vectors (vx...
void LALInspiralUpdateParams(LALStatus *status, InspiralBankParams *bankParams, InspiralMetric metric, REAL8 minimalMatch)
Function to update the parameters used in creating a coarse bank based on a square lattice.
void LALInspiralComputeMetricBCV(LALStatus *status, InspiralMetric *metric, REAL8FrequencySeries *psd, InspiralTemplate *params)
UNDOCUMENTED.
#define LALINSPIRALBANKH_ESIZE
Invalid input range.
#define LALINSPIRALBANKH_EMEM
Memory allocation failure.
@ SquareNotOriented
UNDOCUMENTED.
@ HexagonalNotOriented
UNDOCUMENTED.
@ HybridHexagonal
UNDOCUMENTED.
This is a structure needed in the inner workings of the LALInspiralCreateCoarseBank code.
REAL8 x1Max
maximum value of the second coordinate as defined by the search region
REAL8 x1Min
minimum value of the second coordinate as defined by the search region
REAL8 x0Min
minimum value of the first coordinate as defined by the search region
REAL8 dx0
increment in the x0-direction
InspiralMetric * metric
pointer to the metric at the current location
REAL8 dx1
increment in the x1-direction
REAL8 x0Max
maximum value of the first coordinate as defined by the search region
REAL8 minimalMatch
UNDOCUMENTED.
Input for choosing a template bank.
REAL8 tSampling
Sampling rate.
GridSpacing gridSpacing
Type of gridspacing required.
REAL8FrequencySeries shf
Frequency series containing the PSD.
REAL8 psi3Min
minimum value of the parameter
InsidePolygonEnum insidePolygon
UNDOCUMENTED.
REAL8 fUpper
Upper frequency cutoff.
REAL8 fLower
Lower frequency cutoff.
REAL4 HighGM
UNDOCUMENTED.
UINT4 numFcutTemplates
Number of templates required in the fCut (upper cutoff) dimension and the value of upper and lower cu...
REAL8 psi3Max
maximum value of the parameter
REAL8 mmCoarse
Coarse grid minimal match.
REAL8 alpha
the BCV amplitude correction parameter
REAL8 psi0Min
minimum value of the parameter
REAL8 psi0Max
maximum value of the parameter
Structure to store metric at various points the signal manifold.
REAL8 g11
11-component of the diagonalised metric
REAL8 G01
01-component of the metric in coordinates
REAL8 g00
00-component of the diagonalised metric
REAL8 theta
Angle from tau0 to semi-major axis of the ellipse.
REAL8 G00
00-component of the metric in coordinates
REAL8 G11
11-component of the metric in coordinates
The inspiral waveform parameter structure containing information about the waveform to be generated.
A grid of inspiral templates (ie a template list).