67#include <lal/AVFactories.h>
68#include <lal/VectorOps.h>
69#include <lal/SeqFactories.h>
70#include <lal/DetectorSite.h>
71#include <lal/GenerateInspiral.h>
72#include <lal/GeneratePPNInspiral.h>
73#include <lal/SimulateCoherentGW.h>
74#include <lal/LIGOMetadataTables.h>
75#include <lal/LIGOMetadataUtils.h>
76#include <lal/LIGOMetadataInspiralUtils.h>
77#include <lal/LIGOMetadataRingdownUtils.h>
78#include <lal/LALInspiralBank.h>
79#include <lal/FindChirp.h>
80#include <lal/LALStdlib.h>
81#include <lal/LALInspiralBank.h>
82#include <lal/GenerateInspiral.h>
83#include <lal/NRWaveInject.h>
84#include <lal/GenerateInspRing.h>
86#include <lal/LALInspiral.h>
87#include <lal/LALError.h>
88#include <lal/TimeSeries.h>
89#include <lal/LALSimulation.h>
92#define UNUSED __attribute__ ((unused))
118 INT8 waveformStartTime;
157 ppnParams.
ppn = NULL;
182 switch ( chan->
name[0] )
213 "waveform with no time delay" );
232 unity->
data[k] = 1.0;
250 for ( thisEvent = events; thisEvent; thisEvent = thisEvent->
next )
267 if ( strstr( thisEvent->
waveform,
"KludgeIMR") ||
268 strstr( thisEvent->
waveform,
"KludgeRingOnly") )
284 "injecting inspiral only");
295 waveformStartTime -= (
INT8) ( 1000000000.0 * ppnParams.
tc );
299 LALInfo(
status,
"Waveform start time is zero: injecting waveform "
300 "into center of data segment" );
305 waveformStartTime += (
INT8) ( 1000000000.0 *
311 "Injected waveform timing:\n"
312 "thisEvent->geocent_end_time.gpsSeconds = %d\n"
313 "thisEvent->geocent_end_time.gpsNanoSeconds = %d\n"
314 "ppnParams.tc = %e\n"
324 if( waveform.
h == NULL)
350 if ( ( signalvec.
f0 = chan->
f0 ) != 0 )
362 if ( waveform.
shift )
379 if ( ! strcmp(
"TAPER_START", thisEvent->
taper ) )
383 else if ( ! strcmp(
"TAPER_END", thisEvent->
taper ) )
387 else if ( ! strcmp(
"TAPER_STARTEND", thisEvent->
taper ) )
391 else if ( strcmp(
"TAPER_NONE", thisEvent->
taper ) )
393 XLALPrintError(
"Invalid injection tapering option specified: %s\n",
402 UINT4 safeToBandPass = 0;
409 if ( safeToBandPass )
464 LALWarning (
status,
"Attempting to calculate dynRange: Will break if un-calibrated strain-data is used.");
465 dynRange = 1.0/(crealf(resp->
data->
data[0]));
479 LALAbort(
"expected alternating h+ and hx");
480 tmpdata =
XLALCalloc(2 * wfmLength,
sizeof(*tmpdata));
481 for (
i=0;
i<wfmLength;
i++) {
482 tmpdata[
i] = dataPtr[2*
i] * thisEvent->
distance;
483 tmpdata[wfmLength+
i] = dataPtr[2*
i+1] * thisEvent->
distance;
485 memcpy(dataPtr, tmpdata, 2 * wfmLength *
sizeof(*tmpdata));
503 if ( waveform.
shift )
525 if ( waveform.
h == NULL )
563 UINT4 flag, safe = 1;
569 if ( !signalvec->
data )
572 length = signalvec->
length;
577 while(flag == 0 &&
i < length )
579 if( signalvec->
data[
i] != 0.)
595 if( signalvec->
data[
i] != 0.)
int XLALBandPassInspiralTemplate(REAL4Sequence *sequence, REAL4 fLow, REAL4 fHigh, REAL4 fSampling)
LALDetectorIndexGEO600DIFF
LALDetectorIndexTAMA300DIFF
LALDetectorIndexVIRGODIFF
static int FindTimeSeriesStartAndEnd(REAL4Vector *signalvec, UINT4 *start, UINT4 *end)
void LALFindChirpInjectSignals(LALStatus *status, REAL4TimeSeries *chan, SimInspiralTable *events, COMPLEX8FrequencySeries *resp)
#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 LALSimulateCoherentGW(LALStatus *status, REAL4TimeSeries *output, CoherentGW *input, DetectorResponse *detector)
void LALSDestroyVectorSequence(LALStatus *status, REAL4VectorSequence **vectorSequence)
const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]
#define FINDCHIRPH_EIMRW
Error computing IMR waveform.
#define FINDCHIRPH_EALOC
Memory allocation error.
#define FINDCHIRPH_ENULL
Null pointer.
#define FINDCHIRPH_EHETR
Attempting to simulate heterodyned GW.
CoherentGW * XLALGenerateInspRing(CoherentGW *waveform, SimInspiralTable *inspiralInj, SimRingdownTable *ringInj, int injectSignalType)
Takes an inspiral waveform, and a simInspiralTable and generates a ringdown at an appropriate frequen...
void LALGenerateInspiral(LALStatus *status, CoherentGW *waveform, SimInspiralTable *thisEvent, PPNParamStruc *ppnParams)
void LALAbort(const char *fmt,...)
int LALWarning(LALStatus *status, const char *warning)
int LALError(LALStatus *status, const char *statement)
int LALInfo(LALStatus *status, const char *info)
#define LALINSPIRALH_EBPERR
Error in band passing signal.
void * XLALCalloc(size_t m, size_t n)
LAL_SIM_INSPIRAL_TAPER_START
LAL_SIM_INSPIRAL_TAPER_STARTEND
LAL_SIM_INSPIRAL_TAPER_END
int XLALSimAddInjectionREAL4TimeSeries(REAL4TimeSeries *target, REAL4TimeSeries *h, const COMPLEX8FrequencySeries *response)
void LALInjectStrainGW(LALStatus *status, REAL4TimeSeries *injData, REAL4TimeVectorSeries *strain, SimInspiralTable *thisInj, CHAR *ifo, REAL8 dynRange)
REAL8 XLALTimeDelayFromEarthCenter(const double detector_earthfixed_xyz_metres[3], double source_right_ascension_radians, double source_declination_radians, const LIGOTimeGPS *gpstime)
const LALUnit lalStrainUnit
const LALUnit lalADCCountUnit
LALUnit * XLALUnitDivide(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
void LALCCreateVector(LALStatus *, COMPLEX8Vector **, UINT4)
void LALCDestroyVector(LALStatus *, COMPLEX8Vector **)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALSCreateVector(LALStatus *, REAL4Vector **, UINT4)
void LALCCVectorDivide(LALStatus *status, COMPLEX8Vector *out, const COMPLEX8Vector *in1, const COMPLEX8Vector *in2)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_IS_REAL8_FAIL_NAN(val)
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
LIGOTimeGPS * XLALINT8NSToGPS(LIGOTimeGPS *epoch, INT8 ns)
INT8 XLALGPSToINT8NS(const LIGOTimeGPS *epoch)
REAL4TimeVectorSeries * a
REAL4TimeVectorSeries * h
This structure stores the parameters for constructing a restricted post-Newtonian waveform.
REAL4Vector * ppn
The parameters selecting the type of post-Newtonian expansion; If ppn=NULL, a "normal" (physical) ex...
const CHAR * termDescription
The termination code description (above)
UINT4 length
The length of the generated waveform.
REAL8 tc
The time from the start of the waveform to coalescence (in the point-mass approximation),...
REAL8 deltaT
The requested sampling interval of the waveform, in s.
UINT4 lengthIn
The maximum number of samples in the generated waveform; If zero, the waveforms can be arbitrarily lo...
REAL4VectorSequence * data
LIGOTimeGPS geocent_end_time
struct tagSimInspiralTable * next
CHAR taper[LIGOMETA_INSPIRALTAPER_MAX]
CHAR waveform[LIGOMETA_WAVEFORM_MAX]