LALSimulation  5.4.0.1-fe68b98
LALSimulation.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008 J. Creighton, T. Creighton
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with with program; see the file COPYING. If not, write to the
16  * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  * MA 02110-1301 USA
18  */
19 /**
20  * @author Kipp Cannon, Jolien Creighton, Teviet Creighton
21  * @addtogroup LALSimulation_h Header LALSimulation.h
22  * @ingroup lalsimulation_general
23  * @brief Routines to calculate detector strain for general waveforms.
24  * @details
25  * These routines compute the external strain on a detector caused by
26  * a general waveform and inject these waveforms into time series.
27  *
28  * The following example illustrates the basic usage of these routines.
29  *
30  * @code
31  * #include <lal/Date.h>
32  * #include <lal/LALSimulation.h>
33  * ...
34  * const LALDetector *detector;
35  * REAL8TimeSeries *data;
36  * REAL8TimeSeries *strain;
37  * REAL8TimeSeries *hplus;
38  * REAL8TimeSeries *hcross;
39  * LIGOTimeGPS geocentric_arrival_time;
40  * double right_ascension, declination, psi;
41  * ...
42  * // get detector data
43  * // generate waveform hplus and hcross
44  * // set geocentric_arrival_time for the injection
45  * // set right_ascension, declination, and psi for the injection
46  * ...
47  * XLALGPSAddGPS(&hplus->epoch, &geocentric_arrival_time);
48  * XLALGPSAddGPS(&hcross->epoch, &geocentric_arrival_time);
49  * detector = XLALDetectorPrefixToLALDetector(data->name);
50  * strain = XLALSimDetectorStrainREAL8TimeSeries(hplus, hcross, right_ascension, declination, psi, detector);
51  * XLALSimAddInjectionREAL8TimeSeries(data, strain, NULL);
52  * @endcode
53  *
54  * ### Coordinate Systems
55  *
56  * The diagram below illustrates the relationship between the wave frame
57  * (X,Y,Z) and the Earth's equatorial frame. The Earth is at the origin
58  * of the diagram with its North pole in the direction indicated by N.
59  *
60  * @anchor lalsimulation_inject
61  * @image html lalsimulation_inject.svg "Injection Coordinates"
62  *
63  * The gravitational wave travels in the Z-direction in this diagram,
64  * and the reference direction on the wave-plane (the X-Y-plane) is
65  * given by the X-axis. Note that the direction to the source is in
66  * the negative Z direction.
67  *
68  * The plus- and cross-polarizations of the gravitational waveform are defined
69  * in this wave frame. Specifically, if \f$ h^{ij} \f$ is the metric
70  * perturbation, then
71  * \f[ h_+ = \frac12 ( \hat{p}_i \hat{p}_j - \hat{q}_i \hat{q}_j ) h^{ij} \f]
72  * and
73  * \f[ h_\times = \frac12 ( \hat{p}_i \hat{q}_j + \hat{q}_i \hat{p}_j ) h^{ij} \f]
74  * where \f$ \hat{p}_i \f$ are the components of the unit vector pointing
75  * along the X-axis and \f$ \hat{q}_i \f$ are the components of the unit
76  * vector pointing along the Y-axis.
77  *
78  * The angles relating the wave frame to the equatorial frame are:
79  *
80  * * Declination (&delta;). The angle along the hour circle passing through
81  * the source between the equatorial plane and the source. It is positive
82  * for a source that is north of the equatorial plane and negative for
83  * a source that is south of the equatorial plane. The hour circle passing
84  * through the source is the great arc on the celestial sphere that passes
85  * through the north celestial pole (marked as N in the diagram), the
86  * source, and the south celestial pole.
87  *
88  * Note that the diagram depicts a source having a negative declination.
89  *
90  * * Right ascension (&alpha;). The angle from the vernal equinox
91  * @htmlonly &#x2648; @endhtmlonly to the hour circle passing through
92  * the source. The angle is measured counter-clockwise about the axis
93  * pointing toward the north celestial pole.
94  *
95  * * Greenwich sidereal time (GST). The right ascension of the prime
96  * meridian at the time of arrival of the signal.
97  *
98  * * Greenwich hour angle (GHA). The angle along the equatorial plane between
99  * the prime meridian and the hour circle containing the source. This
100  * angle is measured @e clockwise about the axis pointing toward the
101  * north celestial pole.
102  *
103  * The right ascension, Greenwich hour angle, and Greenwich sidereal time
104  * are related by GHA = GST - &alpha;.
105  *
106  * * Polarization angle (&psi;). The angle from the ascending line of
107  * nodes to the X-axis of the wave plane. The angle is measured counter
108  * clockwise about the Z-axis of the wave plane.
109  *
110  * @sa
111  * A complete description of the coordinate conventions adopted here can be
112  * found in
113  * > Warren Anderson, Patrick Brady, David Chin, Jolien Creighton, Keith Riles,
114  * > and John Whelan,
115  * > "Beam Pattern Response Functions and Times of Arrival for Earthbound
116  * > Interferometer",
117  * > LIGO Technical Document LIGO-T010110-v1 (2009)
118  * > https://dcc.ligo.org/LIGO-T010110/public
119  *
120  * @sa
121  * The conventions are also described in Appendix B of
122  * > Warren G. Anderson, Patrick R. Brady, Jolien D. E. Creighton, and Eanna E.
123  * > Flanagan,
124  * > "Excess power statistic for detection of burst sources of gravitational
125  * > radiation",
126  * > Phys. Rev. D @b 63, 042003 (2001)
127  * > http://dx.doi.org/10.1103/PhysRevD.63.042003
128  * > http://arxiv.org/abs/gr-qc/0008066
129  */
130 
131 #ifndef _LALSIMULATION_H
132 #define _LALSIMULATION_H
133 
134 #include <lal/LALDatatypes.h>
135 #include <lal/LALDetectors.h>
136 
137 #if defined(__cplusplus)
138 extern "C" {
139 #elif 0
140 } /* so that editors will match preceding brace */
141 #endif
142 
143 /** @{ */
144 
145 
146 const LALDetector *XLALDetectorPrefixToLALDetector(const char *string);
147 
149  const REAL8TimeSeries *hplus,
150  const REAL8TimeSeries *hcross,
151  REAL8 right_ascension,
152  REAL8 declination,
153  REAL8 psi,
154  const LALDetector *detector
155 );
156 
158  REAL8TimeSeries *target,
159  REAL8TimeSeries *h,
160  const COMPLEX16FrequencySeries *response
161 );
162 
164  REAL4TimeSeries *target,
165  REAL4TimeSeries *h,
166  const COMPLEX8FrequencySeries *response
167 );
168 
170  REAL8TimeSeries *target,
171  const REAL8TimeSeries *hplus,
172  const REAL8TimeSeries *hcross,
173  double ra,
174  double dec,
175  double psi,
177  const COMPLEX16FrequencySeries *response
178 );
179 
181  REAL4TimeSeries *target,
182  const REAL4TimeSeries *hplus,
183  const REAL4TimeSeries *hcross,
184  double ra,
185  double dec,
186  double psi,
188  const COMPLEX8FrequencySeries *response
189 );
190 
192  REAL8TimeSeries *target,
193  const REAL8TimeSeries *hplus,
194  const REAL8TimeSeries *hcross,
195  double ra,
196  double dec,
197  double psi,
199  const COMPLEX16FrequencySeries *response
200 );
201 
203  REAL4TimeSeries *target,
204  const REAL4TimeSeries *hplus,
205  const REAL4TimeSeries *hcross,
206  double ra,
207  double dec,
208  double psi,
210  const COMPLEX8FrequencySeries *response
211 );
212 
213 /** @} */
214 
215 #if 0
216 { /* so that editors will match succeeding brace */
217 #elif defined(__cplusplus)
218 }
219 #endif
220 
221 #endif /* _LALSIMULATION_H */
const char * detector
double REAL8
REAL8TimeSeries * XLALSimDetectorStrainREAL8TimeSeries(const REAL8TimeSeries *hplus, const REAL8TimeSeries *hcross, REAL8 right_ascension, REAL8 declination, REAL8 psi, const LALDetector *detector)
Transforms the waveform polarizations into a detector strain.
int XLALSimInjectLWLDetectorStrainREAL4TimeSeries(REAL4TimeSeries *target, const REAL4TimeSeries *hplus, const REAL4TimeSeries *hcross, double ra, double dec, double psi, LALDetector *detector, const COMPLEX8FrequencySeries *response)
Computes strain for a detector and injects into target time series.
int XLALSimInjectDetectorStrainREAL8TimeSeries(REAL8TimeSeries *target, const REAL8TimeSeries *hplus, const REAL8TimeSeries *hcross, double ra, double dec, double psi, LALDetector *detector, const COMPLEX16FrequencySeries *response)
Computes strain for a detector and injects into target time series.
int XLALSimInjectLWLDetectorStrainREAL8TimeSeries(REAL8TimeSeries *target, const REAL8TimeSeries *hplus, const REAL8TimeSeries *hcross, double ra, double dec, double psi, LALDetector *detector, const COMPLEX16FrequencySeries *response)
Computes strain for a detector and injects into target time series.
int XLALSimInjectDetectorStrainREAL4TimeSeries(REAL4TimeSeries *target, const REAL4TimeSeries *hplus, const REAL4TimeSeries *hcross, double ra, double dec, double psi, LALDetector *detector, const COMPLEX8FrequencySeries *response)
Computes strain for a detector and injects into target time series.
int XLALSimAddInjectionREAL4TimeSeries(REAL4TimeSeries *target, REAL4TimeSeries *h, const COMPLEX8FrequencySeries *response)
Adds a detector strain time series to detector data.
const LALDetector * XLALDetectorPrefixToLALDetector(const char *string)
Turn a detector prefix string into a LALDetector structure.
Definition: LALSimulation.c:85
int XLALSimAddInjectionREAL8TimeSeries(REAL8TimeSeries *target, REAL8TimeSeries *h, const COMPLEX16FrequencySeries *response)
Adds a detector strain time series to detector data.