Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALInference 4.1.9.1-00ddc7f
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
LALInferenceBurstRoutines.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2008 J. Creighton, K. Cannon
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with with program; see the file COPYING. If not, write to the Free
16 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 * 02110-1301 USA
18 */
19
20
21/*
22 * ============================================================================
23 *
24 * Preamble
25 *
26 * ============================================================================
27 */
28
29#ifndef _LALINFERENCEBURSTROUTINES_H
30#define _LALINFERENCEBURSTROUTINES_H
31
32#include <gsl/gsl_rng.h>
33#include <lal/LALDatatypes.h>
34
35#if defined(__cplusplus)
36extern "C" {
37#elif 0
38} /* so that editors will match preceding brace */
39#endif
40
41
42
43/**
44 * XLAL function to determine burst approximant from a string. The string need not
45 * match exactly, only contain a member of the BurstApproximant enum.
46 */
47int XLALGetBurstApproximantFromString(const CHAR *inString);
48int XLALCheckBurstApproximantFromString(const CHAR *inString);
49
50
51/** Enum that specifies the PN approximant to be used in computing the waveform.
52*/
53typedef enum tagBurstApproximant {
62 NumBurstApproximants /**< Number of elements in enum, useful for checking bounds */
64
66
68BurstApproximant approximant /**< Burst approximant (see enum in LALInferenceBurst.h) */
69 );
71BurstApproximant approximant /**< Burst approximant (see enum in LALInferenceBurst.h) */
72 );
73 /** Enumeration to specify time or frequency domain */
74
76 REAL8TimeSeries **hplus,
77 REAL8TimeSeries **hcross,
78 REAL8 Q,
79 REAL8 centre_frequency,
80 REAL8 hrss,
81 REAL8 eccentricity,
82 REAL8 phase,
83 REAL8 delta_t // 1 over srate
84);
85
89 REAL8 Q,
90 REAL8 centre_frequency,
91 REAL8 hrss,
92 REAL8 eccentricity,
93 REAL8 phase,
96);
97
101 REAL8 Q,
102 REAL8 centre_frequency,
103 REAL8 hrss,
104 REAL8 eccentricity,
105 REAL8 phase,
108);
109
113 REAL8 duration,
114 REAL8 hrss,
115 REAL8 alpha,
118);
119
121 REAL8TimeSeries **hplus,
122 REAL8TimeSeries **hcross,
123 REAL8 Q,
124 REAL8 centre_frequency,
125 REAL8 hrss,
126 REAL8 eccentricity,
127 REAL8 phase,
128 REAL8 delta_t // 1 over srate
129);
130
134 REAL8 Q,
135 REAL8 centre_frequency,
136 REAL8 hrss,
137 REAL8 eccentricity,
138 REAL8 phase,
141);
142
144 REAL8TimeSeries **hplus,
145 REAL8TimeSeries **hcross,
146 REAL8 duration,
147 REAL8 hrss,
148 REAL8 eccentricity,
149 REAL8 polarization,
150 REAL8 delta_t
151);
152
153/* ======================= Extra params ============================= */
154
155
156/**
157 * Linked list node for the testing GR parameters
158 */
159typedef struct tagLALSimBurstExtraParamData
160{
161 char name[32]; /**< Name of the variable */
162 double value; /**< Value of the variable */
164
165/**
166 * Linked list of any number of parameters for testing GR
167 */
168typedef struct tagLALSimBurstExtraParam
169{
170 struct tagLALSimBurstExtraParamData *data; /**< Current variable */
171 struct tagLALSimBurstExtraParam *next; /**< The next variable in linked list */
173
174/**
175 * Function that creates the head node of the extra burst parameters linked list.
176 * It is initialized with a single parameter with given name and value
177 */
178
179#ifdef SWIG // SWIG interface directives
180SWIGLAL(INOUT_STRUCTS(LALSimBurstExtraParam**, parameter));
181#endif
182
184 const char *name, /**< Name of first parameter in new linked list */
185 double value /**< Value of first parameter in new linked list */
186 );
187
188/**
189 * Function that adds a parameter to the extra burst parameters linked list. If the
190 * parameter already exists, it throws an error.
191 */
193 LALSimBurstExtraParam **parameter, /**< Pointer to the head node of the linked list of parameters */
194 const char *name, /**< Parameter name */
195 const double value /**< Parameter value */
196 );
197
198/**
199 * Function that sets the value of the desired parameter in the burst extra
200 * parameters linked list to 'value'. Throws an error if the parameter
201 * is not found
202 */
204 LALSimBurstExtraParam *parameter, /**< Linked list to be modified */
205 const char *name, /**< Name of parameter to be modified */
206 const double value /**< New value for parameter */
207 );
208
209/**
210 * Function that returns the value of the desired parameters in the
211 * burst extra parameters linked list. Aborts if the parameter is not found
212 */
214 const LALSimBurstExtraParam *parameter, /**< Linked list to retrieve from */
215 const char *name /**< Name of parameter to be retrieved */
216 );
217
218/**
219 * Function that checks whether the requested parameter exists within the
220 * burst extra parameters linked list. Returns true (1) or false (0) accordingly
221 */
223 const LALSimBurstExtraParam *parameter, /**< Linked list to check */
224 const char *name /**< Parameter name to check for */
225 );
226
227/** Function that prints the whole burst extra parameters linked list */
229 FILE *fp, /** FILE pointer to write to */
230 LALSimBurstExtraParam *parameter /**< Linked list to print */
231 );
232
233/** Function that destroys the whole extra burst parameters linked list */
235 LALSimBurstExtraParam *parameter /**< Linked list to destroy */
236 );
237
238
239/* ======================= WF cache params ============================= */
240
241
242/**
243 * Stores previously-computed waveforms and parameters to take
244 * advantage of approximant- and parameter-specific opportunities for
245 * accelerating waveform computation.
246 */
247typedef struct
248tagLALSimBurstWaveformCache {
256 REAL8 q,tau;
265
266
268
271 REAL8TimeSeries **hplus, /**< +-polarization waveform */
272 REAL8TimeSeries **hcross, /**< x-polarization waveform */
273 REAL8 deltaT, /**< sampling interval (s) */
274 REAL8 f0, /**< central frequency [Hz] */
275 REAL8 q, /**< quality */
276 REAL8 tau, /**< duration */
277 REAL8 f_min, /**< starting GW frequency (Hz) */
278 REAL8 f_max, /**< max GW frequency (Hz) */
279 REAL8 hrss, /**< hrss */
280 REAL8 polar_angle, /**< Together with polar_ecc, controls ratio plus/cross polarization (rad) */
281 REAL8 polar_ecc, /**< (tidal deformability of mass 1) / m1^5 (dimensionless) */
282 LALSimBurstExtraParam *extraParams, /**< Linked list of extra Parameters (includes alpha and phase). Pass in NULL (or None in python) to neglect */
283 BurstApproximant approximant, /**< Burst approximant to use for waveform production */
284 LALSimBurstWaveformCache *cache /**< waveform cache structure; use NULL for no caching */
285 );
286
288 COMPLEX16FrequencySeries **hptilde, /**< +-polarization waveform */
289 COMPLEX16FrequencySeries **hctilde, /**< x-polarization waveform */
290 REAL8 deltaF, /**< sampling interval (Hz) */
291 REAL8 deltaT, /**< time step corresponding to consec */
292 REAL8 f0, /**< central frequency (Hz) */
293 REAL8 q, /**< Q (==sqrt(2) \f$\pi\f$ f0 tau ) [dless]*/
294 REAL8 tau, /**< Duration [s] */
295 REAL8 f_min, /**< starting GW frequency (Hz) */
296 REAL8 f_max, /**< ending GW frequency (Hz) (0 for Nyquist) */
297 REAL8 hrss, /**< hrss [strain] */
298 REAL8 polar_angle, /**< Polar_ellipse_angle as defined in the burst table. Together with polar_ellipse_eccentricity below will fix the ratio of + vs x aplitude. Some WFs uses a single parameter alpha for this. Alpha is passed through extraParams*/
299 REAL8 polar_ecc, /**< See above */
300 LALSimBurstExtraParam *extraParams, /**< Linked list of extra burst parameters. Pass in NULL (or None in python) to neglect these */
301 BurstApproximant approximant , /**< Burst approximant */
302 LALSimBurstWaveformCache *cache /**< waveform cache structure; use NULL for no caching */
303 );
304
305/* ======================= EVERYTHING ELSE ===========================*/
306
308 COMPLEX16FrequencySeries **hptilde, /**< FD plus polarization */
309 COMPLEX16FrequencySeries **hctilde, /**< FD cross polarization */
310 REAL8 deltaF, /**< sampling interval (Hz) */
311 REAL8 deltaT, /**< time step corresponding to consec */
312 REAL8 f0, /**< central frequency (Hz) */
313 REAL8 q, /**< Q (==sqrt(2) \f$\pi\f$ f0 tau ) [dless]*/
314 REAL8 tau, /**< Duration [s] */
315 REAL8 f_min, /**< starting GW frequency (Hz) */
316 REAL8 f_max, /**< ending GW frequency (Hz) (0 for Nyquist) */
317 REAL8 hrss, /**< hrss [strain] */
318 REAL8 polar_angle, /**< Polar_ellipse_angle as defined in the burst table. Together with polar_ellipse_eccentricity below will fix the ratio of + vs x aplitude. Some WFs uses a single parameter alpha for this. Alpha is passed through extraParams*/
319 REAL8 polar_ecc, /**< See above */
320 LALSimBurstExtraParam *extraParams, /**< Linked list of non-GR parameters. Pass in NULL (or None in python) to neglect these */
321 BurstApproximant approximant /**< Burst approximant */
322 );
323
325 REAL8TimeSeries **hplus, /**< +-polarization waveform */
326 REAL8TimeSeries **hcross, /**< x-polarization waveform */
327 REAL8 deltaT, /**< time step corresponding to consec */
328 REAL8 f0, /**< central frequency (Hz) */
329 REAL8 q, /**< Q (==sqrt(2) \f$\pi\f$ f0 tau ) [dless]*/
330 REAL8 tau, /**< Duration [s] */
331 REAL8 f_min, /**< starting GW frequency (Hz) */
332 REAL8 f_max, /**< ending GW frequency (Hz) (0 for Nyquist) */
333 REAL8 hrss, /**< hrss [strain] */
334 REAL8 polar_angle, /**< Polar_ellipse_angle as defined in the burst table. Together with polar_ellipse_eccentricity below will fix the ratio of + vs x aplitude. Some WFs uses a single parameter alpha for this. Alpha is passed through extraParams*/
335 REAL8 polar_ecc, /**< See above */
336 LALSimBurstExtraParam *extraParams, /**< Linked list of non-GR parameters. Pass in NULL (or None in python) to neglect these */
337 BurstApproximant approximant /**< Burst approximant */
338 );
339
340#if 0
341{ /* so that editors will match succeeding brace */
342#elif defined(__cplusplus)
343}
344#endif
345#endif
int XLALSimBurstAddExtraParam(LALSimBurstExtraParam **parameter, const char *name, const double value)
Function that adds a parameter to the extra burst parameters linked list.
BurstApproximant
Enum that specifies the PN approximant to be used in computing the waveform.
@ NumBurstApproximants
Number of elements in enum, useful for checking bounds.
int XLALSimBurstImplementedTDApproximants(BurstApproximant approximant)
int XLALInferenceBurstGaussianF(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 duration, REAL8 hrss, REAL8 alpha, REAL8 deltaF, REAL8 deltaT)
int XLALInferenceBurstSineGaussianF(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 Q, REAL8 centre_frequency, REAL8 hrss, REAL8 eccentricity, REAL8 phase, REAL8 deltaF, REAL8 deltaT)
double XLALSimBurstGetExtraParam(const LALSimBurstExtraParam *parameter, const char *name)
Function that returns the value of the desired parameters in the burst extra parameters linked list.
int XLALSimBurstChooseFDWaveform(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 deltaF, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant)
int XLALGetBurstApproximantFromString(const CHAR *inString)
XLAL function to determine burst approximant from a string.
LALSimBurstWaveformCache * XLALCreateSimBurstWaveformCache(void)
Construct and initialize a waveform cache.
int XLALSimBurstChooseTDWaveform(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant)
int XLALSimBurstChooseFDWaveformFromCache(COMPLEX16FrequencySeries **hptilde, COMPLEX16FrequencySeries **hctilde, REAL8 deltaF, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant, LALSimBurstWaveformCache *cache)
Chooses between different approximants when requesting a waveform to be generated Returns the wavefor...
void XLALSimBurstDestroyExtraParam(LALSimBurstExtraParam *parameter)
Function that destroys the whole extra burst parameters linked list.
void XLALDestroySimBurstWaveformCache(LALSimBurstWaveformCache *cache)
Destroy a waveform cache.
int XLALInferenceBurstGaussian(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 duration, REAL8 hrss, REAL8 eccentricity, REAL8 polarization, REAL8 delta_t)
int XLALInferenceBurstDampedSinusoid(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 Q, REAL8 centre_frequency, REAL8 hrss, REAL8 eccentricity, REAL8 phase, REAL8 delta_t)
int XLALInferenceBurstSineGaussianFFast(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 Q, REAL8 centre_frequency, REAL8 hrss, REAL8 eccentricity, REAL8 phase, REAL8 deltaF, REAL8 deltaT)
int XLALSimBurstPrintExtraParam(FILE *fp, LALSimBurstExtraParam *parameter)
Function that prints the whole burst extra parameters linked list.
int XLALSimBurstSetExtraParam(LALSimBurstExtraParam *parameter, const char *name, const double value)
Function that sets the value of the desired parameter in the burst extra parameters linked list to 'v...
int XLALSimBurstChooseTDWaveformFromCache(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 deltaT, REAL8 f0, REAL8 q, REAL8 tau, REAL8 f_min, REAL8 f_max, REAL8 hrss, REAL8 polar_angle, REAL8 polar_ecc, LALSimBurstExtraParam *extraParams, BurstApproximant approximant, LALSimBurstWaveformCache *cache)
Chooses between different approximants when requesting a waveform to be generated Returns the wavefor...
int XLALInferenceBurstDampedSinusoidF(COMPLEX16FrequencySeries **hplus, COMPLEX16FrequencySeries **hcross, REAL8 Q, REAL8 centre_frequency, REAL8 hrss, REAL8 eccentricity, REAL8 phase, REAL8 deltaF, REAL8 deltaT)
char * XLALGetStringFromBurstApproximant(BurstApproximant approximant)
XLAL function to determine string from approximant enum.
int XLALSimBurstImplementedFDApproximants(BurstApproximant approximant)
Checks whether the given approximant is implemented in lalsimulation's XLALSimInspiralChooseFDWavefor...
LALSimBurstExtraParam * XLALSimBurstCreateExtraParam(const char *name, double value)
Function that creates the head node of the extra burst parameters linked list.
int XLALSimBurstExtraParamExists(const LALSimBurstExtraParam *parameter, const char *name)
Function that checks whether the requested parameter exists within the burst extra parameters linked ...
int XLALCheckBurstApproximantFromString(const CHAR *inString)
int XLALInferenceBurstSineGaussian(REAL8TimeSeries **hplus, REAL8TimeSeries **hcross, REAL8 Q, REAL8 centre_frequency, REAL8 hrss, REAL8 eccentricity, REAL8 phase, REAL8 delta_t)
Enumeration to specify time or frequency domain.
const char *const name
double REAL8
char CHAR
static const INT4 q
Linked list node for the testing GR parameters.
double value
Value of the variable.
Linked list of any number of parameters for testing GR.
struct tagLALSimBurstExtraParam * next
The next variable in linked list.
struct tagLALSimBurstExtraParamData * data
Current variable.
Stores previously-computed waveforms and parameters to take advantage of approximant- and parameter-s...
COMPLEX16FrequencySeries * hptilde
COMPLEX16FrequencySeries * hctilde
LALSimBurstExtraParam * extraParams