Loading [MathJax]/extensions/TeX/AMSsymbols.js
LAL 7.7.0.1-5e288d3
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
SimulateCoherentGW.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2007 Jolien Creighton, Reinhard Prix, Stephen Fairhurst, Teviet 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/** \cond DONT_DOXYGEN */
21
22/* Use more efficient trig routines for solaris, if available and
23 requested. */
24#include <config.h>
25#ifdef HAVE_SUNMATH_H
26#include <sunmath.h>
27#if defined HAVE_LIBSUNMATH && defined ONLINE
28#define USE_SINCOSP 1
29#endif
30#endif
31
32#include <math.h>
33#include <lal/LALStdio.h>
34#include <lal/LALStdlib.h>
35#include <lal/LALError.h>
36#include <lal/DetectorSite.h>
37#include <lal/DetResponse.h>
38#include <lal/AVFactories.h>
39#include <lal/Date.h>
40#include <lal/Units.h>
41#include <lal/TimeDelay.h>
42#include <lal/VectorOps.h>
43#include <lal/SimulateCoherentGW.h>
44#include <lal/SkyCoordinates.h>
45
46/* \name Error Codes */
47#define SIMULATECOHERENTGWH_ENUL 1 /*< Unexpected null pointer in arguments */
48#define SIMULATECOHERENTGWH_EBAD 2 /*< A sampling interval is (effectively) zero */
49#define SIMULATECOHERENTGWH_ESIG 3 /*< Input signal must specify amplitude and phase functions */
50#define SIMULATECOHERENTGWH_EDIM 4 /*< Amplitude must be a 2-dimensional vector */
51#define SIMULATECOHERENTGWH_EMEM 5 /*< Memory allocation error */
52#define SIMULATECOHERENTGWH_EUNIT 6 /*< Bad input units */
53
54#define SIMULATECOHERENTGWH_MSGENUL "Unexpected null pointer in arguments"
55#define SIMULATECOHERENTGWH_MSGEBAD "A sampling interval is (effectively) zero"
56#define SIMULATECOHERENTGWH_MSGESIG "Input signal must specify amplitude and phase functions"
57#define SIMULATECOHERENTGWH_MSGEDIM "Amplitude must be a 2-dimensional vector"
58#define SIMULATECOHERENTGWH_MSGEMEM "Memory allocation error"
59#define SIMULATECOHERENTGWH_MSGEUNIT "Bad input units"
60
61
62
63
64/* A macro that takes a detector time (in units of output->deltaT from
65 output->epoch) and adds the propagation time interpolated from the
66 delays tabulated in delayData. The following parameters are
67 required to be defined outside the macro, and are set by it:
68
69 REAL4 realIndex; the interpolation point in delayData
70 INT4 intIndex; the index immediately preceding realIndex
71 REAL4 indexFrac; the value realIndex - intIndex */
72#define TCENTRE( time ) \
73 ( \
74 realIndex = delayOff + (time)*delayDt, \
75 intIndex = (INT4)floor( realIndex ), \
76 indexFrac = realIndex - intIndex, \
77 time + indexFrac*delayData[intIndex+1] \
78 + (1.0-indexFrac)*delayData[intIndex] \
79 )
80
81
82/**
83 * \author Creighton, T. D.
84 *
85 * \brief Computes the response of a detector to a coherent gravitational wave.
86 *
87 * This function takes a quasiperiodic gravitational waveform given in
88 * <tt>*signal</tt>, and estimates the corresponding response of the
89 * detector whose position, orientation, and transfer function are
90 * specified in <tt>*detector</tt>. The result is stored in
91 * <tt>*output</tt>.
92 *
93 * The fields <tt>output->epoch</tt>, <tt>output->deltaT</tt>, and
94 * <tt>output->data</tt> must already be set, in order to specify the time
95 * period and sampling rate for which the response is required. If
96 * <tt>output->f0</tt> is nonzero, idealized heterodyning is performed (an
97 * amount \f$2\pi f_0(t-t_0)\f$ is subtracted from the phase before computing
98 * the sinusoid, where \f$t_0\f$ is the heterodyning epoch defined in
99 * \c detector). For the input signal, <tt>signal->h</tt> is ignored,
100 * and the signal is treated as zero at any time for which either
101 * <tt>signal->a</tt> or <tt>signal->phi</tt> is not defined.
102 *
103 * This routine will convert <tt>signal->position</tt> to equatorial
104 * coordinates, if necessary.
105 *
106 * ### Algorithm ###
107 *
108 * The routine first accounts for the time delay between the detector and
109 * the solar system barycentre, based on the detector position
110 * information stored in <tt>*detector</tt> and the propagation direction
111 * specified in <tt>*signal</tt>. Values of the propagation delay are
112 * precomuted at fixed intervals and stored in a table, with the
113 * intervals \f$\Delta T_\mathrm{delay}\f$ chosen such that the value
114 * interpolated from adjacent table entries will never differ from the
115 * true value by more than some timing error \f$\sigma_T\f$. This implies
116 * that:
117 * \f[
118 * \Delta T_\mathrm{delay} \leq \sqrt{
119 * \frac{8\sigma_T}{\max\{a/c\}} } \; ,
120 * \f]
121 * where \f$\max\{a/c\}=1.32\times10^{-10}\mathrm{s}^{-1}\f$ is the maximum
122 * acceleration of an Earth-based detector in the barycentric frame. The
123 * total propagation delay also includes Einstein and Shapiro delay, but
124 * these are more slowly varying and thus do not constrain the table
125 * spacing. At present, a 400s table spacing is hardwired into the code,
126 * implying \f$\sigma_T\approx3\mu\f$s, comparable to the stated accuracy of
127 * <tt>LALBarycenter()</tt>.
128 *
129 * Next, the polarization response functions of the detector
130 * \f$F_{+,\times}(\alpha,\delta)\f$ are computed for every 10 minutes of the
131 * signal's duration, using the position of the source in <tt>*signal</tt>,
132 * the detector information in <tt>*detector</tt>, and the function
133 * <tt>LALComputeDetAMResponseSeries()</tt>. Subsequently, the
134 * polarization functions are estimated for each output sample by
135 * interpolating these precomputed values. This guarantees that the
136 * interpolated value is accurate to \f$\sim0.1\%\f$.
137 *
138 * Next, the frequency response of the detector is estimated in the
139 * quasiperiodic limit as follows:
140 * <ul>
141 * <li> At each sample point in <tt>*output</tt>, the propagation delay is
142 * computed and added to the sample time, and the instantaneous
143 * amplitudes \f$A_1\f$, \f$A_2\f$, frequency \f$f\f$, phase \f$\phi\f$, and polarization
144 * shift \f$\Phi\f$ are found by interpolating the nearest values in
145 * <tt>signal->a</tt>, <tt>signal->f</tt>, <tt>signal->phi</tt>, and
146 * <tt>signal->shift</tt>, respectively. If <tt>signal->f</tt> is not
147 * defined at that point in time, then \f$f\f$ is estimated by differencing
148 * the two nearest values of \f$\phi\f$, as \f$f\approx\Delta\phi/2\pi\Delta
149 * t\f$. If <tt>signal->shift</tt> is not defined, then \f$\Phi\f$ is treated as
150 * zero.</li>
151 * <li> The complex transfer function of the detector the frequency \f$f\f$
152 * is found by interpolating <tt>detector->transfer</tt>. The amplitude of
153 * the transfer function is multiplied with \f$A_1\f$ and \f$A_2\f$, and the
154 * phase of the transfer function is added to \f$\phi\f$,</li>
155 * <li> The plus and cross contributions \f$o_+\f$, \f$o_\times\f$ to the
156 * detector output are computed as in \eqref{eq_quasiperiodic_hpluscross}
157 * of \ref SimulateCoherentGW_h, but
158 * using the response-adjusted amplitudes and phase.</li>
159 * <li> The final detector response \f$o\f$ is computed as
160 * \f$o=(o_+F_+)+(o_\times F_\times)\f$.</li>
161 * </ul>
162 *
163 * ### A note on interpolation: ###
164 *
165 * Much of the computational work in this routine involves interpolating
166 * various time series to find their values at specific output times.
167 * The algorithm is summarized below.
168 *
169 * Let \f$A_j = A( t_A + j\Delta t_A )\f$ be a sampled time series, which we
170 * want to resample at new (output) time intervals \f$t_k = t_0 + k\Delta
171 * t\f$. We first precompute the following quantities:
172 * \f{eqnarray}{
173 * t_\mathrm{off} & = & \frac{t_0-t_A}{\Delta t_A} \; , \\
174 * dt & = & \frac{\Delta t}{\Delta t_A} \; .
175 * \f}
176 * Then, for each output sample time \f$t_k\f$, we compute:
177 * \f{eqnarray}{
178 * t & = & t_\mathrm{off} + k \times dt \; , \\
179 * j & = & \lfloor t \rfloor \; , \\
180 * f & = & t - j \; ,
181 * \f}
182 * where \f$\lfloor x\rfloor\f$ is the "floor" function; i.e.\ the largest
183 * integer \f$\leq x\f$. The time series sampled at the new time is then:
184 * \f[
185 * A(t_k) = f \times A_{j+1} + (1-f) \times A_j \; .
186 * \f]
187 *
188 * ### Notes ###
189 *
190 * The major computational hit in this routine comes from computing the
191 * sine and cosine of the phase angle in
192 * \eqref{eq_quasiperiodic_hpluscross} of
193 * \ref SimulateCoherentGW_h. For better online performance, these can
194 * be replaced by other (approximate) trig functions. Presently the code
195 * uses the native \c libm functions by default, or the function
196 * <tt>sincosp()</tt> in \c libsunmath \e if this function is
197 * available \e and the constant \c ONLINE is defined.
198 * Differences at the level of 0.01 begin to appear only for phase
199 * arguments greater than \f$10^{14}\f$ or so (corresponding to over 500
200 * years between phase epoch and observation time for frequencies of
201 * around 1kHz).
202 *
203 * To activate this feature, be sure that \ref sunmath.h and
204 * \c libsunmath are on your system, and add <tt>-DONLINE</tt> to the
205 * <tt>--with-extra-cppflags</tt> configuration argument. In future this
206 * flag may be used to turn on other efficient trig algorithms on other
207 * (non-Solaris) platforms.
208 *
209 */
210void
213 CoherentGW *CWsignal,
214 DetectorResponse *detector )
215{
216 INT4 i, n; /* index over output->data, and its final value */
217 INT4 nMax; /* used to store limits on index ranges */
218 INT4 fInit, fFinal; /* index range for which CWsignal->f is defined */
219 INT4 shiftInit, shiftFinal; /* ditto for CWsignal->shift */
220 UINT4 dtDelayBy2; /* delay table half-interval (s) */
221 UINT4 dtPolBy2; /* polarization table half-interval (s) */
222 REAL4 *outData; /* pointer to output data */
223 REAL8 delayMin, delayMax; /* min and max values of time delay */
224 SkyPosition source; /* source sky position */
225 BOOLEAN transfer; /* 1 if transfer function is specified */
226 BOOLEAN fFlag = 0; /* 1 if frequency left detector->transfer range */
227 BOOLEAN pFlag = 0; /* 1 if frequency was estimated from phase */
228
229 /* get delay table and polaristion tables half intervals if defined (>0) in
230 the CoherentGW structure otherwise default to 400s for dtDelatBy2 and 300s
231 for dtPolBy2 */
232 dtDelayBy2 = CWsignal->dtDelayBy2 > 0 ? CWsignal->dtDelayBy2 : 400;
233 dtPolBy2 = CWsignal->dtPolBy2 > 0 ? CWsignal->dtPolBy2 : 300;
234
235 /* The amplitude, frequency, phase, polarization shift, polarization
236 response, and propagation delay are stored in arrays that must be
237 interpolated. For a quantity x, we define a pointer xData to the
238 data array. At some time t measured in units of output->deltaT,
239 the interpolation point in xData is given by ( xOff + t*xDt ),
240 where xOff is an offset and xDt is a relative sampling rate. */
241 LALDetAMResponseSeries polResponse;
242 REAL8Vector *delay = NULL;
243 REAL4 *aData, *fData, *shiftData, *plusData, *crossData;
244 REAL8 *phiData, *delayData;
245 REAL8 aOff, fOff, phiOff, shiftOff, polOff, delayOff;
246 REAL8 aDt, fDt, phiDt, shiftDt, polDt, delayDt;
247
248 /* Frequencies in the detector transfer function are interpolated
249 similarly, except everything is normalized with respect to
250 detector->transfer->deltaF. */
251 REAL4Vector *aTransfer = NULL;
252 REAL4Vector *phiTransfer = NULL;
253 REAL4Vector *phiTemp = NULL;
254 REAL4 *aTransData = NULL, *phiTransData = NULL;
255 REAL8 f0 = 1.0;
256 REAL8 phiFac = 1.0, fFac = 1.0;
257
258 /* Heterodyning phase factor LAL_TWOPI*output->f0*output->deltaT,
259 and phase offset at the start of the series
260 LAL_TWOPI*output->f0*(time offset). */
261 REAL8 heteroFac, phi0;
262
263 /* Variables required by the TCENTRE() macro, above. */
264 REAL8 realIndex;
265 INT4 intIndex;
266 REAL8 indexFrac;
267
268 INITSTATUS(stat);
269 ATTATCHSTATUSPTR( stat );
270
271 /* Make sure parameter structures and their fields exist. */
272 ASSERT( CWsignal, stat, SIMULATECOHERENTGWH_ENUL,
273 SIMULATECOHERENTGWH_MSGENUL );
274 if ( !( CWsignal->a ) ) {
275 ABORT( stat, SIMULATECOHERENTGWH_ESIG,
276 SIMULATECOHERENTGWH_MSGESIG );
277 }
278 ASSERT( CWsignal->a->data, stat,
279 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
280 ASSERT( CWsignal->a->data->data, stat,
281 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
282 if ( !( CWsignal->phi ) ) {
283 ABORT( stat, SIMULATECOHERENTGWH_ESIG,
284 SIMULATECOHERENTGWH_MSGESIG );
285 }
286 ASSERT( CWsignal->phi->data, stat,
287 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
288 ASSERT( CWsignal->phi->data->data, stat,
289 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
290 if ( CWsignal->f ) {
291 ASSERT( CWsignal->f->data, stat,
292 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
293 ASSERT( CWsignal->f->data->data, stat,
294 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
295 }
296 if ( CWsignal->shift ) {
297 ASSERT( CWsignal->shift->data, stat,
298 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
299 ASSERT( CWsignal->shift->data->data, stat,
300 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
301 }
302 ASSERT( detector, stat,
303 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
304 if ( ( transfer = ( detector->transfer != NULL ) ) ) {
305 ASSERT( detector->transfer->data, stat,
306 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
307 ASSERT( detector->transfer->data->data, stat,
308 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
309 }
310 ASSERT( output, stat,
311 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
312 ASSERT( output->data, stat,
313 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
314 ASSERT( output->data->data, stat,
315 SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
316
317 /* Check dimensions of amplitude array. */
318 ASSERT( CWsignal->a->data->vectorLength == 2, stat,
319 SIMULATECOHERENTGWH_EDIM, SIMULATECOHERENTGWH_MSGEDIM );
320
321 /* Make sure we never divide by zero. */
322 ASSERT( CWsignal->a->deltaT != 0.0, stat,
323 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
324 ASSERT( CWsignal->phi->deltaT != 0.0, stat,
325 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
326 aDt = output->deltaT / CWsignal->a->deltaT;
327 phiDt = output->deltaT / CWsignal->phi->deltaT;
328 ASSERT( aDt != 0.0, stat,
329 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
330 ASSERT( phiDt != 0.0, stat,
331 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
332 if ( CWsignal->f ) {
333 ASSERT( CWsignal->f->deltaT != 0.0, stat,
334 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
335 fDt = output->deltaT / CWsignal->f->deltaT;
336 ASSERT( fDt != 0.0, stat,
337 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
338 } else
339 fDt = 0.0;
340 if ( CWsignal->shift ) {
341 ASSERT( CWsignal->shift->deltaT != 0.0, stat,
342 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
343 shiftDt = output->deltaT / CWsignal->shift->deltaT;
344 ASSERT( shiftDt != 0.0, stat,
345 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
346 } else
347 shiftDt = 0.0;
348 if ( transfer ) {
349 ASSERT( detector->transfer->deltaF != 0.0, stat,
350 SIMULATECOHERENTGWH_EBAD, SIMULATECOHERENTGWH_MSGEBAD );
351 fFac = 1.0 / detector->transfer->deltaF;
352 phiFac = fFac / ( LAL_TWOPI*CWsignal->phi->deltaT );
353 f0 = detector->transfer->f0/detector->transfer->deltaF;
354 }
355 heteroFac = LAL_TWOPI*output->f0*output->deltaT;
356 phi0 = (REAL8)( output->epoch.gpsSeconds -
357 detector->heterodyneEpoch.gpsSeconds );
358 phi0 += 0.000000001*(REAL8)( output->epoch.gpsNanoSeconds -
360 phi0 *= LAL_TWOPI*output->f0;
361 if ( phi0 > 1.0/LAL_REAL8_EPS ) {
362 LALWarning( stat, "REAL8 arithmetic is not sufficient to maintain"
363 " heterodyne phase to within a radian." );
364 }
365
366 /* Check units on input, and set units on output. */
367 {
368 ASSERT( XLALUnitCompare( &(CWsignal->f->sampleUnits), &lalHertzUnit ) == 0, stat, SIMULATECOHERENTGWH_EUNIT, SIMULATECOHERENTGWH_MSGEUNIT );
369 ASSERT( XLALUnitCompare( &(CWsignal->phi->sampleUnits), &lalDimensionlessUnit ) == 0, stat, SIMULATECOHERENTGWH_EUNIT, SIMULATECOHERENTGWH_MSGEUNIT );
370 if( CWsignal->shift ) {
371 ASSERT( XLALUnitCompare( &(CWsignal->shift->sampleUnits), &lalDimensionlessUnit ) == 0, stat, SIMULATECOHERENTGWH_EUNIT, SIMULATECOHERENTGWH_MSGEUNIT );
372 }
373 if ( transfer ) {
374 if ( XLALUnitMultiply( &(output->sampleUnits), &(CWsignal->a->sampleUnits), &(detector->transfer->sampleUnits) ) == NULL ) {
375 ABORT( stat, SIMULATECOHERENTGWH_EUNIT, SIMULATECOHERENTGWH_MSGEUNIT );
376 }
377 } else {
378 output->sampleUnits = CWsignal->a->sampleUnits;
379 }
380 if( snprintf( output->name, LALNameLength, "response to %s", CWsignal->a->name ) >= LALNameLength )
381 ABORT( stat, SIMULATECOHERENTGWH_ENUL, SIMULATECOHERENTGWH_MSGENUL );
382 }
383
384 /* Define temporary variables to access the data of CWsignal->a,
385 CWsignal->f, and CWsignal->phi. */
386 aData = CWsignal->a->data->data;
387 phiData = CWsignal->phi->data->data;
388 outData = output->data->data;
389 if ( CWsignal->f )
390 fData = CWsignal->f->data->data;
391 else
392 fData = NULL;
393 if ( CWsignal->shift )
394 shiftData = CWsignal->shift->data->data;
395 else
396 shiftData = NULL;
397
398 /* Convert source position to equatorial coordinates, if
399 required. */
400 if ( detector->site ) {
401 source = CWsignal->position;
402 if ( source.system != COORDINATESYSTEM_EQUATORIAL ) {
403 ConvertSkyParams params; /* parameters for conversion */
404 EarthPosition location; /* location of detector */
405 params.gpsTime = &( output->epoch );
407 if ( source.system == COORDINATESYSTEM_HORIZON ) {
408 params.zenith = &( location.geodetic );
409 location.x = detector->site->location[0];
410 location.y = detector->site->location[1];
411 location.z = detector->site->location[2];
412 TRY( LALGeocentricToGeodetic( stat->statusPtr, &location ),
413 stat );
414 }
415 TRY( LALConvertSkyCoordinates( stat->statusPtr, &source,
416 &source, &params ), stat );
417 }
418 }
419
420 /* Generate the table of propagation delays.
421 dtDelayBy2 = (UINT4)( 38924.9/sqrt( output->f0 +
422 1.0/output->deltaT ) ); */
423 delayDt = output->deltaT/( 2.0*dtDelayBy2 );
424 nMax = (UINT4)( output->data->length*delayDt ) + 3;
425 TRY( LALDCreateVector( stat->statusPtr, &delay, nMax ), stat );
426 delayData = delay->data;
427
428 /* Compute delay from Earth centre. */
429 if ( detector->site ) {
430 LIGOTimeGPS gpsTime; /* detector time when we compute delay */
431
432 /* Arrange nested pointers, and set initial values. */
433 gpsTime = output->epoch;
434 gpsTime.gpsSeconds -= dtDelayBy2;
435 delayMin = delayMax = LAL_REARTH_SI / ( LAL_C_SI*output->deltaT );
436 delayMin *= -1;
437
438 /* Compute table. */
439 for ( i = 0; i < nMax; i++ ) {
440 REAL8 tDelay; /* propagation time */
441 tDelay = XLALTimeDelayFromEarthCenter( detector->site->location, source.longitude, source.latitude, &gpsTime );
442 BEGINFAIL( stat )
443 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
444 ENDFAIL( stat );
445 /* TimeDelayFromEarthCenter() measures propagation delay from
446 geocentre to detector, which is the opposite of what we want.
447 We also want it normalized. */
448 tDelay /= -output->deltaT;
449 delayData[i] = tDelay;
450 if ( tDelay < delayMin )
451 delayMin = tDelay;
452 if ( tDelay > delayMax )
453 delayMax = tDelay;
454 gpsTime.gpsSeconds += 2*dtDelayBy2;
455 }
456 }
457
458 /* No information from which to compute delays. */
459 else {
460 LALInfo( stat, "Detector site absent; simulating hplus with no"
461 " propagation delays" );
462 memset( delayData, 0, nMax*sizeof(REAL8) );
463 delayMin = delayMax = 0.0;
464 }
465
466 /* Generate the table of polarization response functions. */
467 polDt = output->deltaT/( 2.0*dtPolBy2 );
468 nMax = (UINT4)( output->data->length*polDt ) + 3;
469 memset( &polResponse, 0, sizeof( LALDetAMResponseSeries ) );
470 polResponse.pPlus = (REAL4TimeSeries *)
471 LALMalloc( sizeof(REAL4TimeSeries) );
472 polResponse.pCross = (REAL4TimeSeries *)
473 LALMalloc( sizeof(REAL4TimeSeries) );
474 polResponse.pScalar = (REAL4TimeSeries *)
475 LALMalloc( sizeof(REAL4TimeSeries) );
476 if ( !polResponse.pPlus || !polResponse.pCross ||
477 !polResponse.pScalar ) {
478 if ( polResponse.pPlus )
479 LALFree( polResponse.pPlus );
480 if ( polResponse.pCross )
481 LALFree( polResponse.pCross );
482 if ( polResponse.pScalar )
483 LALFree( polResponse.pScalar );
484 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
485 ABORT( stat, SIMULATECOHERENTGWH_EMEM,
486 SIMULATECOHERENTGWH_MSGEMEM );
487 }
488 memset( polResponse.pPlus, 0, sizeof(REAL4TimeSeries) );
489 memset( polResponse.pCross, 0, sizeof(REAL4TimeSeries) );
490 memset( polResponse.pScalar, 0, sizeof(REAL4TimeSeries) );
491 LALSCreateVector( stat->statusPtr, &( polResponse.pPlus->data ),
492 nMax );
493 BEGINFAIL( stat ) {
494 LALFree( polResponse.pPlus );
495 LALFree( polResponse.pCross );
496 LALFree( polResponse.pScalar );
497 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
498 } ENDFAIL( stat );
499 LALSCreateVector( stat->statusPtr, &( polResponse.pCross->data ),
500 nMax );
501 BEGINFAIL( stat ) {
503 &( polResponse.pPlus->data ) ), stat );
504 LALFree( polResponse.pPlus );
505 LALFree( polResponse.pCross );
506 LALFree( polResponse.pScalar );
507 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
508 } ENDFAIL( stat );
509 LALSCreateVector( stat->statusPtr, &( polResponse.pScalar->data ),
510 nMax );
511 BEGINFAIL( stat ) {
513 &( polResponse.pPlus->data ) ), stat );
515 &( polResponse.pCross->data ) ), stat );
516 LALFree( polResponse.pPlus );
517 LALFree( polResponse.pCross );
518 LALFree( polResponse.pScalar );
519 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
520 } ENDFAIL( stat );
521 plusData = polResponse.pPlus->data->data;
522 crossData = polResponse.pCross->data->data;
523 if ( detector->site ) {
524 LALSource polSource; /* position and polarization angle */
525 LALDetAndSource input; /* response input structure */
526 LALTimeIntervalAndNSample params; /* response parameter structure */
527
528 /* Arrange nested pointers, and set initial values. */
529 polSource.equatorialCoords = source;
530 polSource.orientation = (REAL8)( CWsignal->psi );
531 input.pSource = &polSource;
532 input.pDetector = detector->site;
533 params.epoch = output->epoch;
534 params.epoch.gpsSeconds -= dtPolBy2;
535 params.deltaT = 2.0*dtPolBy2;
536 params.nSample = nMax;
537
538 /* Compute table of responses. */
539 LALComputeDetAMResponseSeries( stat->statusPtr, &polResponse,
540 &input, &params );
541 BEGINFAIL( stat ) {
543 &( polResponse.pPlus->data ) ), stat );
545 &( polResponse.pCross->data ) ), stat );
547 &( polResponse.pScalar->data ) ), stat );
548 LALFree( polResponse.pPlus );
549 LALFree( polResponse.pCross );
550 LALFree( polResponse.pScalar );
551 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
552 } ENDFAIL( stat );
553 } else {
554 /* No detector site, so just simulate response to hplus. */
555 for ( i = 0; i < nMax; i++ ) {
556 plusData[i] = 1.0;
557 crossData[i] = 0.0;
558 }
559 }
560 /* Free memory for the unused scalar mode. */
562 &( polResponse.pScalar->data ) ), stat );
563 LALFree( polResponse.pScalar );
564
565 /* Decompose the transfer function into an amplitude and phase
566 response. */
567 if ( transfer ) {
568 nMax = detector->transfer->data->length;
569 LALSCreateVector( stat->statusPtr, &phiTemp, nMax );
570 BEGINFAIL( stat ) {
571 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
573 &( polResponse.pPlus->data ) ), stat );
575 &( polResponse.pCross->data ) ), stat );
576 LALFree( polResponse.pPlus );
577 LALFree( polResponse.pCross );
578 } ENDFAIL( stat );
579 LALCVectorAngle( stat->statusPtr, phiTemp,
580 detector->transfer->data );
581 BEGINFAIL( stat ) {
582 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
583 TRY( LALSDestroyVector( stat->statusPtr, &phiTemp ), stat );
585 &( polResponse.pPlus->data ) ), stat );
587 &( polResponse.pCross->data ) ), stat );
588 LALFree( polResponse.pPlus );
589 LALFree( polResponse.pCross );
590 } ENDFAIL( stat );
591 LALSCreateVector( stat->statusPtr, &phiTransfer, nMax );
592 BEGINFAIL( stat ) {
593 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
594 TRY( LALSDestroyVector( stat->statusPtr, &phiTemp ), stat );
596 &( polResponse.pPlus->data ) ), stat );
598 &( polResponse.pCross->data ) ), stat );
599 LALFree( polResponse.pPlus );
600 LALFree( polResponse.pCross );
601 } ENDFAIL( stat );
602 LALUnwrapREAL4Angle( stat->statusPtr, phiTransfer, phiTemp );
603 BEGINFAIL( stat ) {
604 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
605 TRY( LALSDestroyVector( stat->statusPtr, &phiTemp ), stat );
606 TRY( LALSDestroyVector( stat->statusPtr, &phiTransfer ), stat );
608 &( polResponse.pPlus->data ) ), stat );
610 &( polResponse.pCross->data ) ), stat );
611 LALFree( polResponse.pPlus );
612 LALFree( polResponse.pCross );
613 } ENDFAIL( stat );
614 TRY( LALSDestroyVector( stat->statusPtr, &phiTemp ), stat );
615 LALSCreateVector( stat->statusPtr, &aTransfer, nMax );
616 BEGINFAIL( stat ) {
617 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
618 TRY( LALSDestroyVector( stat->statusPtr, &phiTransfer ), stat );
620 &( polResponse.pPlus->data ) ), stat );
622 &( polResponse.pCross->data ) ), stat );
623 LALFree( polResponse.pPlus );
624 LALFree( polResponse.pCross );
625 } ENDFAIL( stat );
626 LALCVectorAbs( stat->statusPtr, aTransfer,
627 detector->transfer->data );
628 BEGINFAIL( stat ) {
629 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
630 TRY( LALSDestroyVector( stat->statusPtr, &phiTransfer ), stat );
631 TRY( LALSDestroyVector( stat->statusPtr, &aTransfer ), stat );
633 &( polResponse.pPlus->data ) ), stat );
635 &( polResponse.pCross->data ) ), stat );
636 LALFree( polResponse.pPlus );
637 LALFree( polResponse.pCross );
638 } ENDFAIL( stat );
639 phiTransData = phiTransfer->data;
640 aTransData = aTransfer->data;
641 }
642
643 /* Compute offsets for interpolating the signal, delay, and
644 response functions. */
645 aOff = ( output->epoch.gpsSeconds -
646 CWsignal->a->epoch.gpsSeconds ) /
647 CWsignal->a->deltaT;
648 aOff += ( output->epoch.gpsNanoSeconds -
649 CWsignal->a->epoch.gpsNanoSeconds ) * 1.0e-9 /
650 CWsignal->a->deltaT;
651 phiOff = ( output->epoch.gpsSeconds -
652 CWsignal->phi->epoch.gpsSeconds ) /
653 CWsignal->phi->deltaT;
654 phiOff += ( output->epoch.gpsNanoSeconds -
655 CWsignal->phi->epoch.gpsNanoSeconds ) * 1.0e-9 /
656 CWsignal->phi->deltaT;
657 if ( CWsignal->f ) {
658 fOff = ( output->epoch.gpsSeconds -
659 CWsignal->f->epoch.gpsSeconds ) /
660 CWsignal->f->deltaT;
661 fOff += ( output->epoch.gpsNanoSeconds -
662 CWsignal->f->epoch.gpsNanoSeconds ) * 1.0e-9 /
663 CWsignal->f->deltaT;
664 } else
665 fOff = 0.0;
666 if ( CWsignal->shift ) {
667 shiftOff = ( output->epoch.gpsSeconds -
668 CWsignal->shift->epoch.gpsSeconds ) /
669 CWsignal->shift->deltaT;
670 shiftOff += ( output->epoch.gpsNanoSeconds -
671 CWsignal->shift->epoch.gpsNanoSeconds ) * 1.0e-9 /
672 CWsignal->shift->deltaT;
673 } else
674 shiftOff = 0.0;
675 polOff = 0.5;
676 delayOff = 0.5;
677
678 /* Compute initial value of i, ensuring that we will never index
679 CWsignal->a or CWsignal->phi below their range. */
680 i = 0;
681 if ( aOff + ( i + delayMin )*aDt < 0.0 ) {
682 INT4 j = (INT4)floor( -aOff/aDt - delayMax );
683 if ( i < j )
684 i = j;
685 while ( ( i < (INT4)( output->data->length ) ) &&
686 ( aOff + TCENTRE( i )*aDt < 0.0 ) )
687 i++;
688 }
689 if ( phiOff + ( i + delayMin )*phiDt < 0.0 ) {
690 INT4 j = (INT4)( -phiOff/phiDt - delayMax );
691 if ( i < j )
692 i = j;
693 while ( ( i < (INT4)( output->data->length ) ) &&
694 ( phiOff + TCENTRE( i )*phiDt < 0.0 ) )
695 i++;
696 }
697 if ( i >= (INT4)( output->data->length ) ) {
698 LALWarning( stat, "Signal starts after the end of the output"
699 " time series." );
700 i = (INT4)( output->data->length );
701 }
702
703 /* Compute final value of i, ensuring that we will never index
704 CWsignal->a or CWsignal->phi above their range. */
705 n = output->data->length - 1;
706 nMax = CWsignal->a->data->length - 1;
707 if ( aOff + ( n + delayMax )*aDt > nMax ) {
708 INT4 j = (INT4)( ( nMax - aOff )/aDt - delayMin + 1.0 );
709 if ( n > j )
710 n = j;
711 while ( ( n >= 0 ) &&
712 ( (INT4)floor(aOff + TCENTRE( n )*aDt) > nMax ) )
713 n--;
714 }
715 nMax = CWsignal->phi->data->length - 1;
716 if ( phiOff + ( n + delayMax )*phiDt > nMax ) {
717 INT4 j = (INT4)( ( nMax - phiOff )/phiDt - delayMin + 1.0 );
718 if ( n > j )
719 n = j;
720 while ( ( n >= 0 ) &&
721 ( (INT4)floor(phiOff + TCENTRE( n )*phiDt) > nMax ) )
722 n--;
723 }
724 if ( n < 0 ) {
725 LALWarning( stat, "CWsignal ends before the start of the output"
726 " time series." );
727 n = -1;
728 }
729
730 /* Compute the values of i for which CWsignal->f is given. */
731 if ( CWsignal->f ) {
732 fInit = i;
733 if ( fOff + ( fInit + delayMin )*fDt < 0.0 ) {
734 INT4 j = (INT4)floor( -fOff/fDt - delayMax );
735 if ( fInit < j )
736 fInit = j;
737 while ( ( fInit <= n ) &&
738 ( fOff + TCENTRE( fInit )*fDt < 0.0 ) )
739 fInit++;
740 }
741 fFinal = n;
742 nMax = CWsignal->f->data->length - 1;
743 if ( fOff + ( fFinal + delayMax )*fDt > nMax ) {
744 INT4 j = (INT4)( ( nMax - fOff )/fDt - delayMin + 1.0 );
745 if ( fFinal > j )
746 fFinal = j;
747 while ( ( fFinal >= i ) &&
748 ( (INT4)floor(fOff + TCENTRE( fFinal )*fDt) > nMax ) )
749 fFinal--;
750 }
751 } else {
752 fInit = n + 1;
753 fFinal = i - 1;
754 }
755
756 /* Compute the values of i for which CWsignal->shift is given. */
757 if ( CWsignal->shift ) {
758 shiftInit = i;
759 if ( shiftOff + ( shiftInit + delayMin )*shiftDt < 0.0 ) {
760 INT4 j = (INT4)floor( -shiftOff/shiftDt - delayMax );
761 if ( shiftInit < j )
762 shiftInit = j;
763 while ( ( shiftInit <= n ) &&
764 ( shiftOff + TCENTRE( shiftInit )*shiftDt < 0.0 ) )
765 shiftInit++;
766 }
767 shiftFinal = n;
768 nMax = CWsignal->shift->data->length - 1;
769 if ( shiftOff + ( shiftFinal + delayMax )*shiftDt > nMax ) {
770 INT4 j = (INT4)( ( nMax - shiftOff )/shiftDt - delayMin + 1.0 );
771 if ( shiftFinal > j )
772 shiftFinal = j;
773 while ( ( shiftFinal >= i ) &&
774 ( (INT4)floor(shiftOff + TCENTRE( shiftFinal )*shiftDt) > nMax ) )
775 shiftFinal--;
776 }
777 } else {
778 shiftInit = n + 1;
779 shiftFinal = i - 1;
780 }
781
782 /* Set output to zero where the CWsignal is not defined. */
783 if ( i > 0 )
784 memset( output->data->data, 0, i*sizeof(REAL4) );
785 if ( ( nMax = output->data->length - n - 1 ) > 0 )
786 memset( output->data->data + n + 1, 0, nMax*sizeof(REAL4) );
787
788 /* Keep track of the frequency range of the transfer function, so
789 that we don't try to interpolate it out of its range. */
790 if ( transfer )
791 nMax = detector->transfer->data->length - 1;
792
793 /* Start computing responses. */
794 for ( ; i <= n; i++ ) {
795 REAL8 iCentre = TCENTRE( i ); /* value of i + propagation delays */
796 REAL8 x; /* interpolation point in arrays */
797 INT4 j; /* array index preceding x */
798 REAL8 frac; /* value of x - j */
799 REAL4 a1, a2; /* current signal amplitudes */
800 REAL8 phi = 0.0; /* current signal phase */
801 REAL4 f = 0.0; /* current signal frequency */
802 REAL4 shift = 0.0; /* current signal polarization shift */
803 REAL4 aTrans, phiTrans; /* current values of the transfer function */
804 REAL4 oPlus, oCross; /* current output amplitudes */
805#if USE_SINCOSP
806 REAL8 sp, cp, ss, cs; /* sine and cosine of shift and phase */
807#endif
808
809 /* Interpolate the signal amplitude. */
810 x = aOff + iCentre*aDt;
811 j = (INT4)floor( x );
812 frac = (REAL8)( x - j );
813 j *= 2;
814
815 /* Handle special case where output lands on final sample - no interpolation */
816 if(i==n){
817 a1=aData[j];
818 a2=aData[j+1];
819 }
820 else
821 {
822 a1 = frac*aData[j+2] + ( 1.0 - frac )*aData[j];
823 a2 = frac*aData[j+3] + ( 1.0 - frac )*aData[j+1];
824 }
825
826 /* Interpolate the polarization shift. */
827 if ( ( i < shiftInit ) || ( i > shiftFinal ) )
828 shift = 0.0;
829 else {
830 x = shiftOff + iCentre*shiftDt;
831 j = (INT4)floor( x );
832 frac = (REAL8)( x - j );
833 if(i==n) shift=shiftData[j];
834 else shift = frac*shiftData[j+1] + ( 1.0 - frac )*shiftData[j];
835 }
836
837 /* Interpolate the signal phase, and apply any heterodyning. */
838 x = phiOff + iCentre*phiDt;
839 j = (INT4)floor( x );
840 frac = (REAL8)( x - j );
841 phi = frac*phiData[j+1] + ( 1.0 - frac )*phiData[j];
842 phi -= heteroFac*i + phi0;
843
844 /* Compute the frequency and apply the transfer function. */
845 if ( transfer ) {
846 if ( ( i < fInit ) || ( i > fFinal ) ) {
847 f = ( phiData[j+1] - phiData[j] )*phiFac;
848 pFlag = 1;
849 } else {
850 x = fOff + iCentre*fDt;
851 j = (INT4)floor( x );
852 frac = (REAL8)( x - j );
853 if(i==n) f=fData[j];
854 else f = frac*fData[j+1] + ( 1.0 - frac )*fData[j];
855 f *= fFac;
856 }
857 x = f - f0;
858 if ( ( x < 0.0 ) || ( x > nMax ) ) {
859 aTrans = 0.0;
860 phiTrans = 0.0;
861 fFlag = 1;
862 } else {
863 j = (INT4)floor( x );
864 frac = (REAL8)( x - j );
865 if(i==n)
866 {
867 aTrans=aTransData[j];
868 phiTrans=phiTransData[j];
869 } else
870 {
871 aTrans = frac*aTransData[j+1] + ( 1.0 - frac )*aTransData[j];
872 phiTrans = frac*phiTransData[j+1] + ( 1.0 - frac )*phiTransData[j];
873 }
874 }
875 a1 *= aTrans;
876 a2 *= aTrans;
877 phi += phiTrans;
878 }
879
880 /* Compute components of output. */
881#if USE_SINCOSP
882 sincosp( shift, &ss, &cs );
883 sincosp( phi, &sp, &cp );
884 oPlus = a1*cs*cp - a2*ss*sp;
885 oCross = a1*ss*cp + a2*cs*sp;
886#else
887 oPlus = a1*cos( shift )*cos( phi ) - a2*sin( shift )*sin( phi );
888 oCross = a1*sin( shift )*cos( phi ) + a2*cos( shift )*sin( phi );
889#endif
890
891 /* Interpolate the polarization response, and compute output. */
892 x = polOff + i*polDt;
893 j = (INT4)floor( x );
894 frac = (REAL8)( x - j );
895 if(i==n)
896 {
897 oPlus*=plusData[j];
898 oCross*=crossData[j];
899 } else {
900 oPlus *= frac*plusData[j+1] + ( 1.0 - frac )*plusData[j];
901 oCross *= frac*crossData[j+1] + ( 1.0 - frac )*crossData[j];
902 }
903
904 outData[i] = oPlus + oCross;
905 }
906
907 /* Warn if we ever stepped outside of the frequency domain of the
908 transfer function, or if we had to estimate f from phi. */
909 if ( fFlag )
910 LALWarning( stat, "Signal passed outside of the frequency domain"
911 " of the transfer function (transfer function is"
912 " treated as zero outside its specified domain)" );
913 if ( pFlag )
914 LALInfo( stat, "Signal frequency was estimated by differencing"
915 " the signal phase" );
916
917 /* Cleanup and exit. */
918 TRY( LALDDestroyVector( stat->statusPtr, &delay ), stat );
919 if ( transfer ) {
920 TRY( LALSDestroyVector( stat->statusPtr, &phiTransfer ), stat );
921 TRY( LALSDestroyVector( stat->statusPtr, &aTransfer ), stat );
922 }
924 &( polResponse.pPlus->data ) ), stat );
926 &( polResponse.pCross->data ) ), stat );
927 LALFree( polResponse.pPlus );
928 LALFree( polResponse.pCross );
929 DETATCHSTATUSPTR( stat );
930 RETURN( stat );
931
932} /* LALSimulateCoherentGW() */
933
934/** \endcond */
#define LALInfo(statusptr, info)
Definition: LALError.h:110
#define LALWarning(statusptr, warning)
Definition: LALError.h:103
#define LALMalloc(n)
Definition: LALMalloc.h:93
#define LALFree(p)
Definition: LALMalloc.h:96
#define ABORT(statusptr, code, mesg)
#define ENDFAIL(statusptr)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
#define BEGINFAIL(statusptr)
void LALSimulateCoherentGW(LALStatus *status, REAL4TimeSeries *output, CoherentGW *input, DetectorResponse *detector)
static double f(double theta, double y, double xi)
Definition: XLALMarcumQ.c:258
void LALComputeDetAMResponseSeries(LALStatus *status, LALDetAMResponseSeries *pResponseSeries, const LALDetAndSource *pDetAndSource, const LALTimeIntervalAndNSample *pTimeInfo)
Computes REAL4TimeSeries containing time series of response amplitudes.
Definition: DetResponse.c:526
#define LAL_C_SI
Speed of light in vacuum, m s^-1.
Definition: LALConstants.h:198
#define LAL_REARTH_SI
Earth equatorial radius, m.
Definition: LALConstants.h:416
#define LAL_REAL8_EPS
Difference between 1 and the next resolvable REAL8 2^-52.
Definition: LALConstants.h:61
#define LAL_TWOPI
2*pi is circumference of a circle divided by its radius
Definition: LALConstants.h:180
unsigned char BOOLEAN
Boolean logical type, see Headers LAL(Atomic)Datatypes.h for more details.
double REAL8
Double precision real floating-point number (8 bytes).
uint32_t UINT4
Four-byte unsigned integer.
int32_t INT4
Four-byte signed integer.
float REAL4
Single precision real floating-point number (4 bytes).
@ LALNameLength
Definition: LALDatatypes.h:508
void LALConvertSkyCoordinates(LALStatus *stat, SkyPosition *output, SkyPosition *input, ConvertSkyParams *params)
@ COORDINATESYSTEM_HORIZON
A horizon coordinate system.
@ COORDINATESYSTEM_EQUATORIAL
The sky-fixed equatorial coordinate system.
void LALGeocentricToGeodetic(LALStatus *, EarthPosition *location)
double XLALTimeDelayFromEarthCenter(const double detector_earthfixed_xyz_metres[3], double source_right_ascension_radians, double source_declination_radians, const LIGOTimeGPS *gpstime)
Compute difference in arrival time of the same signal at detector and at center of Earth-fixed frame.
Definition: TimeDelay.c:83
int XLALUnitCompare(const LALUnit *unit1, const LALUnit *unit2)
Returns 0 if the the normal form of the two unit structures are the same or > 0 if they are different...
Definition: UnitCompare.c:90
const LALUnit lalHertzUnit
Hertz [Hz].
Definition: UnitDefs.c:171
const LALUnit lalDimensionlessUnit
dimensionless units
Definition: UnitDefs.c:156
LALUnit * XLALUnitMultiply(LALUnit *output, const LALUnit *unit1, const LALUnit *unit2)
This function multiplies together the LALUnit structures *(input->unitOne) and *(input->unitTwo),...
Definition: UnitMultiply.c:64
void LALDCreateVector(LALStatus *, REAL8Vector **, UINT4)
void LALDDestroyVector(LALStatus *, REAL8Vector **)
void LALSDestroyVector(LALStatus *, REAL4Vector **)
void LALSCreateVector(LALStatus *, REAL4Vector **, UINT4)
void LALCVectorAngle(LALStatus *, REAL4Vector *, const COMPLEX8Vector *)
UNDOCUMENTED.
Definition: VectorPolar.c:274
void LALCVectorAbs(LALStatus *, REAL4Vector *, const COMPLEX8Vector *)
UNDOCUMENTED.
Definition: VectorPolar.c:212
void LALUnwrapREAL4Angle(LALStatus *, REAL4Vector *, const REAL4Vector *)
UNDOCUMENTED.
Definition: VectorPolar.c:335
COMPLEX8Sequence * data
Definition: LALDatatypes.h:905
UINT4 length
Number of elements in array.
Definition: LALDatatypes.h:167
COMPLEX8 * data
Pointer to the data array.
Definition: LALDatatypes.h:168
REAL4TimeSeries * shift
SkyPosition position
REAL4TimeVectorSeries * a
REAL8TimeSeries * phi
REAL4TimeSeries * f
This structure stores parameters for the function LALConvertSkyPosition().
CoordinateSystem system
The coordinate system to which one is transforming.
SkyPosition * zenith
The position of the zenith of the horizon coordinate system; may be NULL if one is neither converting...
LIGOTimeGPS * gpsTime
The GPS time for conversions between Earth-fixed and sky-fixed coordinates; may be NULL if no such co...
LIGOTimeGPS heterodyneEpoch
COMPLEX8FrequencySeries * transfer
This structure stores the location of a point on (or near) the surface of the Earth in both geodetic ...
REAL8 z
The Earth-fixed geocentric Cartesian coordinates of the point, in metres.
SkyPosition geodetic
The geographic coordinates of the upward vertical direction from the point; that is,...
This structure aggregates together three REAL4TimeSeries objects containing time series of detector A...
Definition: DetResponse.h:153
REAL4TimeSeries * pCross
timeseries of detector response to -polarized gravitational radiation
Definition: DetResponse.h:155
REAL4TimeSeries * pPlus
timeseries of detector response to -polarized gravitational radiation
Definition: DetResponse.h:154
REAL4TimeSeries * pScalar
timeseries of detector response to scalar gravitational radiation (NB: not yet implemented....
Definition: DetResponse.h:156
This structure aggregates a pointer to a LALDetector and a LALSource.
Definition: DetResponse.h:128
LALSource * pSource
Pointer to LALSource object containing information about the source.
Definition: DetResponse.h:130
const LALDetector * pDetector
Pointer to LALDetector object containing information about the detector.
Definition: DetResponse.h:129
REAL8 location[3]
The three components, in an Earth-fixed Cartesian coordinate system, of the position vector from the ...
Definition: LALDetectors.h:279
This structure contains gravitational wave source position (in Equatorial coördinates),...
Definition: DetResponse.h:105
SkyPosition equatorialCoords
equatorial coordinates of source, in decimal RADIANS
Definition: DetResponse.h:107
REAL8 orientation
Orientation angle ( ) of source: counter-clockwise angle -axis makes with a line perpendicular to mer...
Definition: DetResponse.h:108
LAL status structure, see The LALStatus structure for more details.
Definition: LALDatatypes.h:947
struct tagLALStatus * statusPtr
Pointer to the next node in the list; NULL if this function is not reporting a subroutine error.
Definition: LALDatatypes.h:954
This structure encapsulates time and sampling information for computing a LALDetAMResponseSeries.
Definition: DetResponse.h:168
LIGOTimeGPS epoch
The start time of the time series.
Definition: DetResponse.h:169
UINT4 nSample
The total number of samples to be computed.
Definition: DetResponse.h:171
REAL8 deltaT
The sampling interval , in seconds.
Definition: DetResponse.h:170
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
Definition: LALDatatypes.h:458
INT4 gpsSeconds
Seconds since 0h UTC 6 Jan 1980.
Definition: LALDatatypes.h:459
INT4 gpsNanoSeconds
Residual nanoseconds.
Definition: LALDatatypes.h:460
Time series of REAL4 data, see DATATYPE-TimeSeries types for more details.
Definition: LALDatatypes.h:570
REAL4Sequence * data
The sequence of sampled data.
Definition: LALDatatypes.h:576
LALUnit sampleUnits
The physical units of the quantity being sampled.
Definition: LALDatatypes.h:575
REAL8 deltaT
The time step between samples of the time series in seconds.
Definition: LALDatatypes.h:573
LIGOTimeGPS epoch
The start time of the time series.
Definition: LALDatatypes.h:572
CHAR name[LALNameLength]
The name of the time series of vectors.
Definition: LALDatatypes.h:674
REAL8 deltaT
The time step between samples of the time series of vectors in seconds.
Definition: LALDatatypes.h:676
LALUnit sampleUnits
The physical units of the quantity being sampled.
Definition: LALDatatypes.h:678
LIGOTimeGPS epoch
The start time of the time series of vectors.
Definition: LALDatatypes.h:675
REAL4VectorSequence * data
The sequence of sampled data vectors.
Definition: LALDatatypes.h:679
Vector of type REAL4, see DATATYPE-Vector types for more details.
Definition: LALDatatypes.h:145
REAL4 * data
Pointer to the data array.
Definition: LALDatatypes.h:150
UINT4 length
Number of elements in array.
Definition: LALDatatypes.h:149
UINT4 vectorLength
The length n of each vector.
Definition: LALDatatypes.h:336
REAL4 * data
Pointer to the data array.
Definition: LALDatatypes.h:337
UINT4 length
The number l of vectors.
Definition: LALDatatypes.h:335
REAL8Sequence * data
The sequence of sampled data.
Definition: LALDatatypes.h:586
LALUnit sampleUnits
The physical units of the quantity being sampled.
Definition: LALDatatypes.h:585
REAL8 deltaT
The time step between samples of the time series in seconds.
Definition: LALDatatypes.h:583
LIGOTimeGPS epoch
The start time of the time series.
Definition: LALDatatypes.h:582
Vector of type REAL8, see DATATYPE-Vector types for more details.
Definition: LALDatatypes.h:154
REAL8 * data
Pointer to the data array.
Definition: LALDatatypes.h:159
UINT4 length
Number of elements in array.
Definition: LALDatatypes.h:158
This structure stores the two spherical coordinates of a sky position; ie a generic latitude and long...
REAL8 longitude
The longitudinal coordinate (in radians), as defined above.
REAL8 latitude
The latitudinal coordinate (in radians), as defined above.
CoordinateSystem system
The coordinate system in which latitude/longitude are expressed.
void output(int gps_sec, int output_type)
Definition: tconvert.c:440