Commit ed9e9eb9 authored by Ian Harry's avatar Ian Harry
Browse files

Adding support for TD templates to coh_PTF code

Original: 01ed2ae9bc3e7fbefb25ac381f170903307c5011
parent b5f494cb
......@@ -45,6 +45,7 @@
#include <lal/FindChirpDatatypes.h>
#include <lal/FindChirp.h>
#include <lal/FindChirpSP.h>
#include <lal/FindChirpTD.h>
#include <lal/FindChirpPTF.h>
#include <lal/LIGOLwXML.h>
#include <lal/LIGOLwXMLInspiralRead.h>
......@@ -429,12 +430,6 @@ void coh_PTF_template_PTF (
FindChirpTmpltParams *params
);
void coh_PTF_template_TaylorF2 (
FindChirpTemplate *fcTmplt,
InspiralTemplate *InspTmplt,
FindChirpTmpltParams *params
);
void coh_PTF_normalize(
struct coh_PTF_params *params,
FindChirpTemplate *fcTmplt,
......
......@@ -374,7 +374,7 @@ int main( int argc, char **argv )
fcTmpltParams->PTFe1 = XLALCreateVectorSequence( 3, numPoints );
fcTmpltParams->PTFe2 = XLALCreateVectorSequence( 3, numPoints );
}
else
else if (params->approximant == FindChirpSP)
{
fcTmplt->PTFQtilde =
XLALCreateCOMPLEX8VectorSequence( 1, numPoints / 2 + 1 );
......@@ -388,6 +388,14 @@ int main( int argc, char **argv )
for (ui = 1; ui < fcTmpltParams->xfacVec->length; ++ui)
xfac[ui] = pow( (REAL4) ui, xfacExponent );
}
else
{
fcTmplt->PTFQtilde =
XLALCreateCOMPLEX8VectorSequence( 1, numPoints / 2 + 1 );
fcTmplt->data = XLALCreateCOMPLEX8Vector( numPoints / 2 + 1 );
fcTmpltParams->xfacVec = XLALCreateVector(numPoints );
}
fcTmpltParams->fwdPlan = XLALCreateForwardREAL4FFTPlan( numPoints, 0 );
fcTmpltParams->deltaT = 1.0/params->sampleRate;
......
......@@ -198,11 +198,47 @@ int coh_PTF_parse_options(struct coh_PTF_params *params,int argc,char **argv )
{
localparams.approximant = FindChirpPTF;
}
else if ( ! strcmp( "TaylorT1", optarg) )
{
localparams.approximant = TaylorT1;
}
else if ( ! strcmp( "TaylorT2", optarg) )
{
localparams.approximant = TaylorT2;
}
else if ( ! strcmp( "TaylorT3", optarg) )
{
localparams.approximant = TaylorT3;
}
else if ( ! strcmp( "TaylorT4", optarg) )
{
localparams.approximant = TaylorT4;
}
else if ( ! strcmp( "GeneratePPN", optarg) )
{
localparams.approximant = GeneratePPN;
}
else if ( ! strcmp( "PadeT1", optarg) )
{
localparams.approximant = PadeT1;
}
else if ( ! strcmp( "EOB", optarg) )
{
localparams.approximant = EOB;
}
else if ( ! strcmp( "EOBNR", optarg) )
{
localparams.approximant = EOBNR;
}
else if ( ! strcmp( "IMRPhenomB", optarg) )
{
localparams.approximant = IMRPhenomB;
}
else
{
fprintf( stderr, "invalid argument to --%s:\n"
"unknown order specified: "
"%s (must be either FindChirpSP or FindChirpPTF)\n",
"%s (must be either FindChirpSP, FindChirpPTF or TaylorT4)\n",
long_options[option_index].name, optarg );
exit( 1 );
}
......
......@@ -79,18 +79,29 @@ void coh_PTF_template (
FindChirpTmpltParams *params
)
{
if (params->approximant == FindChirpSP)
{
coh_PTF_template_TaylorF2 (fcTmplt,InspTmplt,params);
}
else if (params->approximant == FindChirpPTF)
{
coh_PTF_template_PTF (fcTmplt,InspTmplt,params);
}
else
LALStatus status = blank_status;
switch ( params->approximant )
{
fprintf(stderr,"Waveform approximant not recognized at template generation\n");
exit(0);
case TaylorT1:
case TaylorT2:
case TaylorT3:
case TaylorT4:
case GeneratePPN:
case PadeT1:
case EOB:
case EOBNR:
case IMRPhenomB:
LALFindChirpTDTemplate( &status,fcTmplt,InspTmplt,params );
break;
case FindChirpSP:
LALFindChirpSPTemplate( &status,fcTmplt,InspTmplt,params );
break;
case FindChirpPTF:
coh_PTF_template_PTF(fcTmplt,InspTmplt,params);
break;
default:
fprintf(stderr,"Waveform approximant not recognized at template generation\n");
exit(1);
}
}
......@@ -654,14 +665,3 @@ void coh_PTF_auto_veto_overlaps(
XLALDestroyCOMPLEX8Vector( qtildeVec);
XLALDestroyCOMPLEX8Vector( qVec );
}
void
coh_PTF_template_TaylorF2 (
FindChirpTemplate *fcTmplt,
InspiralTemplate *InspTmplt,
FindChirpTmpltParams *params
)
{
LALStatus status = blank_status;
LALFindChirpSPTemplate( &status,fcTmplt,InspTmplt,params);
}
......@@ -374,7 +374,7 @@ int main( int argc, char **argv )
fcTmpltParams->PTFe1 = XLALCreateVectorSequence( 3, numPoints );
fcTmpltParams->PTFe2 = XLALCreateVectorSequence( 3, numPoints );
}
else
else if (params->approximant == FindChirpSP)
{
fcTmplt->PTFQtilde =
XLALCreateCOMPLEX8VectorSequence( 1, numPoints / 2 + 1 );
......@@ -388,6 +388,14 @@ int main( int argc, char **argv )
for (ui = 1; ui < fcTmpltParams->xfacVec->length; ++ui)
xfac[ui] = pow( (REAL4) ui, xfacExponent );
}
else
{
fcTmplt->PTFQtilde =
XLALCreateCOMPLEX8VectorSequence( 1, numPoints / 2 + 1 );
fcTmplt->data = XLALCreateCOMPLEX8Vector( numPoints / 2 + 1 );
fcTmpltParams->xfacVec = XLALCreateVector(numPoints );
}
fcTmpltParams->fwdPlan = XLALCreateForwardREAL4FFTPlan( numPoints, 0 );
fcTmpltParams->deltaT = 1.0/params->sampleRate;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment