3 #include <lal/LALStdlib.h>
4 #include <lal/LALConstants.h>
5 #include <lal/LALDict.h>
6 #include <lal/TimeSeries.h>
7 #include <lal/FrequencySeries.h>
8 #include <lal/TimeFreqFFT.h>
9 #include <lal/BandPassTimeSeries.h>
11 #include <lal/Units.h>
12 #include <lal/LALSimInspiral.h>
13 #include <lal/LALSimInspiralWaveformParams.h>
24 static int finalize(LALSimInspiralGenerator * myself)
41 if (internal_generator->generate_td_waveform(hplus, hcross,
params, internal_generator) < 0)
62 const double extra_time_fraction = 0.1;
63 const double extra_cycles = 3.0;
64 double original_f_min;
67 double tchirp, tmerge, textra;
69 double m1, m2, s1z, s2z,
s;
121 textra = extra_cycles /
f_min;
133 retval = internal_generator->generate_td_waveform(hplus, hcross, new_params, internal_generator);
164 size_t chirplen,
end, k;
166 const double extra_time_fraction = 0.1;
167 const double extra_cycles = 3.0;
168 double original_f_min;
171 double tchirp, tmerge, textra;
172 double fisco, fstart;
173 double m1, m2, s1z, s2z,
s;
227 textra = extra_cycles /
f_min;
235 retval = myself->generate_fd_waveform(&hptilde, &hctilde, new_params, myself);
249 double complex phasefac = cexp(2.0 *
LAL_PI * I * k * hptilde->
deltaF * tshift);
261 if (!(*hplus) || !(*hcross) || !plan) {
282 chirplen = round((tchirp + tmerge) /
deltaT);
285 end = (*hplus)->data->length - round(tshift /
deltaT);
316 const double extra_time_fraction = 0.1;
317 const double extra_cycles = 3.0;
318 double chirplen,
deltaT, deltaF, f_nyquist;
320 double tchirp, tmerge, textra, tshift;
321 double fstart, fisco;
322 double m1, m2, s1z, s2z,
s;
369 n = round(
f_max / deltaF);
371 frexp(n, &chirplen_exp);
372 f_nyquist = ldexp(1.0, chirplen_exp) * deltaF;
420 textra = extra_cycles /
f_min;
428 chirplen = round((tchirp + tmerge + 2.0 * textra) /
deltaT);
430 frexp(chirplen, &chirplen_exp);
431 chirplen = ldexp(1.0, chirplen_exp);
434 deltaF = 1.0 / (chirplen *
deltaT);
435 else if (deltaF > 1.0 / (chirplen *
deltaT))
436 XLAL_PRINT_WARNING(
"Specified frequency interval of %g Hz is too large for a chirp of duration %g s", deltaF, chirplen *
deltaT);
443 retval = internal_generator->generate_fd_waveform(hplus, hcross, new_params, internal_generator);
449 k0 = round(fstart / (*hplus)->deltaF);
450 k1 = round(
f_min / (*hplus)->deltaF);
452 for (k = 0; k <
k0; ++k) {
453 (*hplus)->data->data[k] = 0.0;
454 (*hcross)->data->data[k] = 0.0;
457 for ( ; k <
k1; ++k) {
458 double w = 0.5 - 0.5 * cos(
LAL_PI * (k -
k0) / (
double)(
k1 -
k0));
459 (*hplus)->data->data[k] *=
w;
460 (*hcross)->data->data[k] *=
w;
463 (*hplus)->data->data[(*hplus)->data->length - 1] = 0.0;
464 (*hcross)->data->data[(*hcross)->data->length - 1] = 0.0;
472 for (k = 0; k < (*hplus)->data->length; ++k) {
473 double complex phasefac = cexp(2.0 *
LAL_PI * I * k * deltaF * tshift);
474 (*hplus)->data->data[k] *= phasefac;
475 (*hcross)->data->data[k] *= phasefac;
494 double chirplen,
deltaT, deltaF, f_nyquist;
538 n = round(
f_max / deltaF);
540 frexp(n, &chirplen_exp);
541 f_nyquist = ldexp(1.0, chirplen_exp) * deltaF;
551 retval = myself->generate_td_waveform(&hp, &hc, new_params, myself);
560 frexp(chirplen, &chirplen_exp);
561 chirplen = ldexp(1.0, chirplen_exp);
562 deltaF = 1.0 / (chirplen * hp->
deltaT);
565 chirplen = 2 * f_nyquist / deltaF;
566 if (chirplen < hp->
data->length)
567 XLAL_PRINT_WARNING(
"Specified frequency interval of %g Hz is too large for a chirp of duration %g s with Nyquist frequency %g Hz. The inspiral will be truncated.", deltaF, hp->
data->
length *
deltaT, f_nyquist);
int XLALHighPassREAL8TimeSeries(REAL8TimeSeries *series, REAL8 frequency, REAL8 amplitude, INT4 filtorder)
void XLALDestroyDict(LALDict *dict)
LALDict * XLALDictDuplicate(LALDict *old)
INT4 XLALDictLookupINT4Value(LALDict *dict, const char *key)
REAL8 XLALSimInspiralChirpStartFrequencyBound(REAL8 tchirp, REAL8 m1, REAL8 m2)
Routine to compute an underestimate of the starting frequency for a given chirp time.
REAL8 XLALSimInspiralChirpTimeBound(REAL8 fstart, REAL8 m1, REAL8 m2, REAL8 s1, REAL8 s2)
Routine to compute an overestimate of the inspiral time from a given frequency.
int XLALSimInspiralTDConditionStage1(REAL8TimeSeries *hplus, REAL8TimeSeries *hcross, REAL8 textra, REAL8 f_min)
First stage of conditioning of time-domain waveforms.
int XLALSimInspiralGetSpinFreqFromApproximant(Approximant approx)
REAL8 XLALSimInspiralMergeTimeBound(REAL8 m1, REAL8 m2)
Routine to compute an overestimate of the merger time.
int XLALSimInspiralGetAllowZeroMinFreqFromApproximant(Approximant approx)
REAL8 XLALSimInspiralRingdownTimeBound(REAL8 M, REAL8 s)
Routine to compute an overestimate of the ringdown time.
REAL8 XLALSimInspiralFinalBlackHoleSpinBound(REAL8 S1z, REAL8 S2z)
Routine to compute an overestimate of a final black hole dimensionless spin.
int XLALSimInspiralTDConditionStage2(REAL8TimeSeries *hplus, REAL8TimeSeries *hcross, REAL8 f_min, REAL8 f_max)
Second stage of conditioning of time-domain waveforms.
static int finalize(LALSimInspiralGenerator *myself)
static int generate_conditioned_fd_waveform_from_td(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
int XLALSimInspiralGeneratorAddConditioningForApproximant(LALSimInspiralGenerator *generator, int approximant)
static int generate_conditioned_td_waveform_from_td_fallback(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
static int generate_conditioned_td_waveform_from_td(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
static int generate_conditioned_td_waveform_from_fd(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
int XLALSimInspiralGeneratorAddStandardConditioning(LALSimInspiralGenerator *generator)
static int generate_conditioned_fd_waveform_from_fd(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, LALDict *params, LALSimInspiralGenerator *myself)
#define FIX_REFERENCE_FREQUENCY(f_ref, f_min, approximant)
COMPLEX16FrequencySeries * XLALCreateCOMPLEX16FrequencySeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaF, const LALUnit *sampleUnits, size_t length)
void XLALDestroyCOMPLEX16FrequencySeries(COMPLEX16FrequencySeries *series)
LALSimInspiralApplyTaper
Enumeration to specify the tapering method to apply to the waveform.
@ LAL_SIM_INSPIRAL_TAPER_START
Taper the start of the waveform.
@ LAL_SIM_INSPIRAL_SPINS_CASEBYCASE
These approximants have nonprecessing spins.
@ LAL_SIM_INSPIRAL_SPINS_FLOW
These approximants are parameterized by the spins at f_ref.
@ TaylorF2RedSpinTidal
TaylorF2 waveforms for non-precessing spins, defined in terms of a single (reduced-spin) parameter [A...
@ TaylorF2RedSpin
TaylorF2 waveforms for non-precessing spins, defined in terms of a single (reduced-spin) parameter [A...
@ TaylorF2NLTides
The standard stationary phase approximation including a phenomenological model of nonlinear tidal eff...
@ TaylorF2Ecc
The standard stationary phase approximation with eccentricity; Outputs a frequency-domain wave.
@ SpinTaylorT4Fourier
Frequency domain (generic spins) inspiral only waveforms based on TaylorT4, arXiv: 1408....
@ SpinTaylorF2
Spinning case F2 models (single spin only).
@ TaylorF2
The standard stationary phase approximation; Outputs a frequency-domain wave.
@ LAL_SIM_INSPIRAL_ALLOW_ZERO_FMIN
void XLALDestroyREAL8FFTPlan(REAL8FFTPlan *plan)
REAL8FFTPlan * XLALCreateReverseREAL8FFTPlan(UINT4 size, int measurelvl)
REAL8FFTPlan * XLALCreateForwardREAL8FFTPlan(UINT4 size, int measurelvl)
int XLALREAL8TimeFreqFFT(COMPLEX16FrequencySeries *freq, const REAL8TimeSeries *tser, const REAL8FFTPlan *plan)
int XLALREAL8FreqTimeFFT(REAL8TimeSeries *tser, const COMPLEX16FrequencySeries *freq, const REAL8FFTPlan *plan)
REAL8TimeSeries * XLALResizeREAL8TimeSeries(REAL8TimeSeries *series, int first, size_t length)
REAL8TimeSeries * XLALCreateREAL8TimeSeries(const CHAR *name, const LIGOTimeGPS *epoch, REAL8 f0, REAL8 deltaT, const LALUnit *sampleUnits, size_t length)
void XLALDestroyREAL8TimeSeries(REAL8TimeSeries *series)
const LALUnit lalStrainUnit
const LALUnit lalDimensionlessUnit
#define XLAL_PRINT_WARNING(...)
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
LALSimInspiralGenerator * generator