Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-b246709
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
BinarySSBTimesTest.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Reinhard Prix
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#include <config.h>
21#include <math.h>
22#include <sys/times.h>
23
24#include <lal/LALPulsarVCSInfo.h>
25#include <lal/ComputeFstat.h>
26#include <lal/LALgetopt.h>
27#include <lal/LALInitBarycenter.h>
28#include <lal/FindRoot.h>
29#include <lal/UserInput.h>
30
31/**
32 * \author Reinhard Prix
33 * \file
34 * \ingroup lalpulsar_coh
35 * \brief Tests for XLALAdd[Multi]BinaryTimes()
36 *
37 * We simply compare the results to the old+obsolete LAL functions LALGet[Multi]Binarytimes(),
38 * which have been moved here, and only serve for this comparison.
39 *
40 * Sky-location is picked at random each time, which allows a minimal
41 * Monte-Carlo validation by simply running this script repeatedly.
42 *
43 */
44
45// ----- local defines
46#define EA_ACC 1E-9 /* the timing accuracy of LALGetBinaryTimes in seconds */
47
48// ----- macros
49#define GPS2REAL8(gps) (1.0 * (gps).gpsSeconds + 1.e-9 * (gps).gpsNanoSeconds )
50
51// ----- global variables
52static REAL8 A, B; /* binary time delay coefficients (need to be global so that the LAL root finding procedure can see them) */
53
54// local types
55typedef struct {
56 INT4 randSeed; /**< allow user to specify random-number seed for reproducible noise-realizations */
58
59/* Type defining the orbital parameters of a binary pulsar */
60typedef struct tagBinaryOrbitParams {
61 LIGOTimeGPS tp; /* time of observed periapsis passage (in SSB) */
62 REAL8 argp; /* argument of periapsis (radians) */
63 REAL8 asini; /* projected, normalized orbital semi-major axis (s) */
64 REAL8 ecc; /* orbital eccentricity */
65 REAL8 period; /* orbital period (sec) */
67
68/* ----- internal prototypes ---------- */
69static void LALGetBinarytimes( LALStatus *, SSBtimes *tBinary, const SSBtimes *tSSB, const DetectorStateSeries *DetectorStates, const BinaryOrbitParams *binaryparams, LIGOTimeGPS refTime );
70static void LALGetMultiBinarytimes( LALStatus *, MultiSSBtimes **multiBinary, const MultiSSBtimes *multiSSB, const MultiDetectorStateSeries *multiDetStates, const BinaryOrbitParams *binaryparams, LIGOTimeGPS refTime );
71static void EccentricAnomoly( LALStatus *status, REAL8 *tr, REAL8 lE, void *x0 );
72
73int XLALCompareSSBtimes( REAL8 *err_DeltaT, REAL8 *err_Tdot, const SSBtimes *t1, const SSBtimes *t2 );
74int XLALCompareMultiSSBtimes( REAL8 *err_DeltaT, REAL8 *err_Tdot, const MultiSSBtimes *m1, const MultiSSBtimes *m2 );
75
76
77/* ----- function definitions ---------- */
78int
79main( int argc, char *argv[] )
80{
83 UserInput_t *uvar = &uvar_s;
84
85 struct tms buf;
86 uvar->randSeed = times( &buf );
87
88 // ---------- register all our user-variable ----------
89 XLALRegisterUvarMember( randSeed, INT4, 's', OPTIONAL, "Specify random-number seed for reproducible noise." );
90
91 /* read cmdline & cfgfile */
92 BOOLEAN should_exit = 0;
94 if ( should_exit ) {
95 exit( 1 );
96 }
97
98 srand( uvar->randSeed );
99
100 REAL8 startTimeREAL8 = 714180733;
101 REAL8 duration = 180000; /* 50 hours */
102 REAL8 Tsft = 1800; /* assume 30min SFTs */
103 char earthEphem[] = TEST_PKG_DATA_DIR "earth00-40-DE405.dat.gz";
104 char sunEphem[] = TEST_PKG_DATA_DIR "sun00-40-DE405.dat.gz";
105
106 //REAL8 tolerance = 2e-10; /* same algorithm, should be basically identical results */
107
108 LIGOTimeGPS startTime, refTime;
109 XLALGPSSetREAL8( &startTime, startTimeREAL8 );
110 refTime = startTime;
111
112 // pick skyposition at random ----- */
113 SkyPosition skypos;
114 skypos.longitude = LAL_TWOPI * ( 1.0 * rand() / ( RAND_MAX + 1.0 ) ); // alpha uniform in [0, 2pi)
115 skypos.latitude = LAL_PI_2 - acos( 1 - 2.0 * rand() / RAND_MAX ); // sin(delta) uniform in [-1,1]
117
118 // pick binary orbital parameters:
119 // somewhat inspired by Sco-X1 parameters from S2-paper (PRD76, 082001 (2007), gr-qc/0605028)
120 // but with a more extreme eccentricity, and random argp
121 REAL8 argp = LAL_TWOPI * ( 1.0 * rand() / ( RAND_MAX + 1.0 ) ); // uniform in [0, 2pi)
122 BinaryOrbitParams orbit;
123 XLALGPSSetREAL8( &orbit.tp, 731163327 ); // time of observed periapsis passage (in SSB)
124 orbit.argp = argp; // argument of periapsis (radians)
125 orbit.asini = 1.44; // projected, normalized orbital semi-major axis (s) */
126 orbit.ecc = 1e-2; // relatively large value, for better testing
127 orbit.period = 68023; // period (s) : about ~18.9h
128
129 // ----- step 0: prepare test-case input for calling the BinarySSB-functions
130 // setup detectors
131 const char *sites[3] = { "H1", "L1", "V1" };
132 UINT4 numDetectors = sizeof( sites ) / sizeof( sites[0] );
133
134 MultiLALDetector multiIFO;
135 multiIFO.length = numDetectors;
136 for ( UINT4 X = 0; X < numDetectors; X ++ ) {
137 const LALDetector *det = XLALGetSiteInfo( sites[X] );
138 XLAL_CHECK( det != NULL, XLAL_EFUNC, "XLALGetSiteInfo ('%s') failed for detector X=%d\n", sites[X], X );
139 multiIFO.sites[X] = ( *det ); // struct copy
140 }
141
142 // load ephemeris
143 EphemerisData *edat = XLALInitBarycenter( earthEphem, sunEphem );
144 XLAL_CHECK( edat != NULL, XLAL_EFUNC, "XLALInitBarycenter('%s','%s') failed\n", earthEphem, sunEphem );
145
146 // setup multi-timeseries
148
149 XLAL_CHECK( ( multiTS = XLALCalloc( 1, sizeof( *multiTS ) ) ) != NULL, XLAL_ENOMEM );
150 XLAL_CHECK( ( multiTS->data = XLALCalloc( numDetectors, sizeof( *multiTS->data ) ) ) != NULL, XLAL_ENOMEM );
151 multiTS->length = numDetectors;
152
153 for ( UINT4 X = 0; X < numDetectors; X ++ ) {
155 XLAL_CHECK( multiTS->data[X] != NULL, XLAL_EFUNC, "XLALMakeTimestamps() failed.\n" );
156 } /* for X < numIFOs */
157
158 // generate detector-states
159 MultiDetectorStateSeries *multiDetStates = XLALGetMultiDetectorStates( multiTS, &multiIFO, edat, 0 );
160 XLAL_CHECK( multiDetStates != NULL, XLAL_EFUNC, "XLALGetMultiDetectorStates() failed.\n" );
161
162 // generate isolated-NS SSB times
163 MultiSSBtimes *multiSSBIn = XLALGetMultiSSBtimes( multiDetStates, skypos, refTime, SSBPREC_RELATIVISTICOPT );
164 XLAL_CHECK( multiSSBIn != NULL, XLAL_EFUNC, "XLALGetMultiSSBtimes() failed.\n" );
165
166 // ----- step 1: compute reference-result using old LALGetMultiBinarytimes()
167 MultiSSBtimes *multiBinary_ref = NULL;
168 LALGetMultiBinarytimes( &status, &( multiBinary_ref ), multiSSBIn, multiDetStates, &orbit, refTime );
169 XLAL_CHECK( status.statusCode == 0, XLAL_EFAILED, "LALGetMultiBinarytimes() failed with status = %d : '%s'\n", status.statusCode, status.statusDescription );
170
171 // ----- step 2: compute test-result using new XLALAddMultiBinaryTimes()
172 MultiSSBtimes *multiBinary_test = NULL;
173 PulsarDopplerParams doppler;
174 memset( &doppler, 0, sizeof( doppler ) );
175 doppler.fkdot[0] = 100;
176 doppler.tp = orbit.tp;
177 doppler.argp = orbit.argp;
178 doppler.asini = orbit.asini;
179 doppler.ecc = orbit.ecc;
180 doppler.period = orbit.period;
181 XLAL_CHECK( XLALAddMultiBinaryTimes( &multiBinary_test, multiSSBIn, &doppler ) == XLAL_SUCCESS, XLAL_EFUNC );
182
183 // ----- step 3: compare results
184 REAL8 err_DeltaT, err_Tdot;
185 REAL8 tolerance = 1e-9;
186 int ret = XLALCompareMultiSSBtimes( &err_DeltaT, &err_Tdot, multiBinary_ref, multiBinary_test );
187 XLAL_CHECK( ret == XLAL_SUCCESS, XLAL_EFUNC, "XLALCompareMultiSSBtimes() failed.\n" );
188
189 XLALPrintWarning( "INFO: err(DeltaT) = %g, err(Tdot) = %g\n", err_DeltaT, err_Tdot );
190
191 XLAL_CHECK( err_DeltaT < tolerance, XLAL_ETOL, "error(DeltaT) = %g exceeds tolerance of %g\n", err_DeltaT, tolerance );
192 XLAL_CHECK( err_Tdot < tolerance, XLAL_ETOL, "error(Tdot) = %g exceeds tolerance of %g\n", err_Tdot, tolerance );
193
194 // ---- step 4: clean-up memory
197 XLALDestroyMultiSSBtimes( multiBinary_test );
198 XLALDestroyMultiSSBtimes( multiBinary_ref );
199 XLALDestroyMultiSSBtimes( multiSSBIn );
201 XLALDestroyMultiDetectorStateSeries( multiDetStates );
202
203 // check for memory-leaks
205
206 return XLAL_SUCCESS;
207
208} // main()
209
210/**
211 * Compare 2 MultiSSBtimes vectors and return the maximal difference in
212 * DeltaT in s, and in Tdot (dimensionless)
213 */
214int
215XLALCompareMultiSSBtimes( REAL8 *err_DeltaT, REAL8 *err_Tdot, const MultiSSBtimes *m1, const MultiSSBtimes *m2 )
216{
217 XLAL_CHECK( err_DeltaT != NULL, XLAL_EINVAL );
218 XLAL_CHECK( err_Tdot != NULL, XLAL_EINVAL );
219 XLAL_CHECK( m1 != NULL, XLAL_EINVAL );
220 XLAL_CHECK( m2 != NULL, XLAL_EINVAL );
221
222 XLAL_CHECK( m1->length == m2->length, XLAL_EINVAL, "Number of detectors differ %d != %d\n", m1->length, m2->length );
223
224 REAL8 max_DeltaT = 0;
225 REAL8 max_Tdot = 0;
226
227 UINT4 numDet = m1->length;
228 for ( UINT4 X = 0; X < numDet; X ++ ) {
229 REAL8 DeltaT_X, Tdot_X;
230 XLAL_CHECK( XLALCompareSSBtimes( &DeltaT_X, &Tdot_X, m1->data[X], m2->data[X] ) == XLAL_SUCCESS, XLAL_EFUNC );
231 max_DeltaT = fmax( max_DeltaT, DeltaT_X );
232 max_Tdot = fmax( max_Tdot, Tdot_X );
233 } // for X < numDet
234
235 ( *err_DeltaT ) = max_DeltaT;
236 ( *err_Tdot ) = max_Tdot;
237
238 return XLAL_SUCCESS;
239
240} // XLALCompareMultiSSBtimes()
241
242/**
243 * Compare 2 SSBtimes vectors and return the maximal difference in
244 * DeltaT in s, and in Tdot (dimensionless)
245 */
246int
247XLALCompareSSBtimes( REAL8 *err_DeltaT, REAL8 *err_Tdot, const SSBtimes *t1, const SSBtimes *t2 )
248{
249 XLAL_CHECK( err_DeltaT != NULL, XLAL_EINVAL );
250 XLAL_CHECK( err_Tdot != NULL, XLAL_EINVAL );
251 XLAL_CHECK( t1 != NULL, XLAL_EINVAL );
252 XLAL_CHECK( t2 != NULL, XLAL_EINVAL );
253 XLAL_CHECK( ( t1->DeltaT != NULL ) && ( t1->Tdot != NULL ), XLAL_EINVAL );
254 XLAL_CHECK( XLALGPSDiff( &( t1->refTime ), &( t2->refTime ) ) == 0, XLAL_ETOL,
255 "Different reference-times: %f != %f\n", XLALGPSGetREAL8( &( t1->refTime ) ), XLALGPSGetREAL8( &( t2->refTime ) ) );
256
257 UINT4 numSteps = t1->DeltaT->length;
258 XLAL_CHECK( t1->Tdot->length == numSteps, XLAL_EINVAL );
259 XLAL_CHECK( t2->DeltaT->length == numSteps, XLAL_EINVAL );
260 XLAL_CHECK( t2->Tdot->length == numSteps, XLAL_EINVAL );
261
262 REAL8 max_DeltaT = 0;
263 REAL8 max_Tdot = 0;
264
265 for ( UINT4 i = 0; i < numSteps; i ++ ) {
266 REAL8 DeltaT_i = fabs( t1->DeltaT->data[i] - t2->DeltaT->data[i] );
267 REAL8 Tdot_i = fabs( t1->Tdot->data[i] - t2->Tdot->data[i] );
268
269 max_DeltaT = fmax( max_DeltaT, DeltaT_i );
270 max_Tdot = fmax( max_Tdot, Tdot_i );
271
272 } // for i < numSteps
273
274 ( *err_DeltaT ) = max_DeltaT;
275 ( *err_Tdot ) = max_Tdot;
276
277 return XLAL_SUCCESS;
278
279} // XLALCompareSSBtimes()
280
281
282
283// ---------- obsolete LAL functions LALGet[Multi]Binarytimes() kept here for comparison purposes
284
285#define COMPUTEFSTATC_ENULL 1
286#define COMPUTEFSTATC_ENONULL 2
287#define COMPUTEFSTATC_EINPUT 3
288#define COMPUTEFSTATC_EMEM 4
289#define COMPUTEFSTATC_EXLAL 5
290#define COMPUTEFSTATC_EIEEE 6
291
292#define COMPUTEFSTATC_MSGENULL "Arguments contained an unexpected null pointer"
293#define COMPUTEFSTATC_MSGENONULL "Output pointer is non-NULL"
294#define COMPUTEFSTATC_MSGEINPUT "Invalid input"
295#define COMPUTEFSTATC_MSGEMEM "Out of memory. Bad."
296#define COMPUTEFSTATC_MSGEXLAL "XLAL function call failed"
297#define COMPUTEFSTATC_MSGEIEEE "Floating point failure"
298
299/**
300 * For a given OrbitalParams, calculate the time-differences
301 * \f$ \Delta T_\alpha\equiv T(t_\alpha) - T_0 \f$ , and their
302 * derivatives \f$ Tdot_\alpha \equiv d T / d t (t_\alpha) \f$ .
303 *
304 * \note The return-vectors \a DeltaT and \a Tdot must be allocated already
305 * and have the same length as the input time-series \a DetStates.
306 *
307 */
308void
309LALGetBinarytimes( LALStatus *status, /**< pointer to LALStatus structure */
310 SSBtimes *tBinary, /**< [out] DeltaT_alpha = T(t_alpha) - T_0; and Tdot(t_alpha) */
311 const SSBtimes *tSSB, /**< [in] DeltaT_alpha = T(t_alpha) - T_0; and Tdot(t_alpha) */
312 const DetectorStateSeries *DetectorStates, /**< [in] detector-states at timestamps t_i */
313 const BinaryOrbitParams *binaryparams, /**< [in] source binary orbit parameters */
314 LIGOTimeGPS refTime /**< SSB reference-time T_0 of pulsar-parameters */
315 )
316{
317 UINT4 numSteps, i;
318 REAL8 refTimeREAL8;
319 REAL8 Porb; /* binary orbital period */
320 REAL8 asini; /* the projected orbital semimajor axis */
321 REAL8 e, ome ; /* the eccentricity, one minus eccentricity */
322 REAL8 sinw, cosw; /* the sin and cos of the argument of periapsis */
323 REAL8 tSSB_now; /* the SSB time at the midpoint of each SFT in REAL8 form */
324 REAL8 fracorb; /* the fraction of orbits completed since current SSB time */
325 REAL8 E; /* the eccentric anomoly */
326 DFindRootIn input; /* the input structure for the root finding procedure */
327 REAL8 acc; /* the accuracy in radians of the eccentric anomoly computation */
328
331
333 numSteps = DetectorStates->length; /* number of timestamps */
334
341
346
347 /* convenience variables */
348 Porb = binaryparams->period;
349 e = binaryparams->ecc;
350 asini = binaryparams->asini;
351 sinw = sin( binaryparams->argp );
352 cosw = cos( binaryparams->argp );
353 ome = 1.0 - e;
354 refTimeREAL8 = GPS2REAL8( refTime );
355
356 /* compute p, q and r coeeficients */
357 A = ( LAL_TWOPI / Porb ) * cosw * asini * sqrt( 1.0 - e * e ) - e;
358 B = ( LAL_TWOPI / Porb ) * sinw * asini;
359 REAL8 tp = GPS2REAL8( binaryparams->tp );
360 REAL8 Tp = tp + asini * sinw * ome;
361
362 /* Calculate the required accuracy for the root finding procedure in the main loop */
363 acc = LAL_TWOPI * ( REAL8 )EA_ACC / Porb; /* EA_ACC is defined above and represents the required timing precision in seconds (roughly) */
364
365 /* loop over the SFTs */
366 for ( i = 0; i < numSteps; i++ ) {
367
368 /* define SSB time for the current SFT midpoint */
369 tSSB_now = refTimeREAL8 + ( tSSB->DeltaT->data[i] );
370
371 /* define fractional orbit in SSB frame since periapsis (enforce result 0->1) */
372 /* the result of fmod uses the dividend sign hence the second procedure */
373 REAL8 temp = fmod( ( tSSB_now - Tp ), Porb ) / ( REAL8 )Porb;
374 fracorb = temp - ( REAL8 )floor( temp );
375 REAL8 x0 = fracorb * LAL_TWOPI;
376
377 /* compute eccentric anomaly using a root finding procedure */
378 input.function = EccentricAnomoly; /* This is the name of the function we must solve to find E */
379 input.xmin = 0.0; /* We know that E will be found between 0 and 2PI */
380 input.xmax = LAL_TWOPI;
381 input.xacc = acc; /* The accuracy of the root finding procedure */
382
383 /* expand domain until a root is bracketed */
384 LALDBracketRoot( status->statusPtr, &input, &x0 );
385
386 /* bisect domain to find eccentric anomoly E corresponding to the SSB time of the midpoint of this SFT */
387 LALDBisectionFindRoot( status->statusPtr, &E, &input, &x0 );
388
389 /* use our value of E to compute the additional binary time delay */
390 tBinary->DeltaT->data[i] = tSSB->DeltaT->data[i] - ( asini * sinw * ( cos( E ) - e ) + asini * cosw * sqrt( 1.0 - e * e ) * sin( E ) );
391
392 /* combine with Tdot (dtSSB_by_dtdet) -> dtbin_by_dtdet */
393 tBinary->Tdot->data[i] = tSSB->Tdot->data[i] * ( ( 1.0 - e * cos( E ) ) / ( 1.0 + A * cos( E ) - B * sin( E ) ) );
394
395 } /* for i < numSteps */
396
397
399 RETURN( status );
400
401} /* LALGetBinarytimes() */
402
403/**
404 * For a given set of binary parameters we solve the following function for
405 * the eccentric anomoly E
406 */
408 REAL8 *tr,
409 REAL8 lE,
410 void *x0
411 )
412{
414 ASSERT( x0, status, 1, "Null pointer" );
415
416 /* this is the function relating the observed time since periapse in the SSB to the true eccentric anomoly E */
417 ( *tr ) = - ( *( REAL8 * )x0 ) + ( lE + A * sin( lE ) + B * ( cos( lE ) - 1.0 ) );
418
419 RETURN( status );
420}
421
422/**
423 * Multi-IFO version of LALGetBinarytimes().
424 * Get all binary-timings for all input detector-series.
425 *
426 */
427void
428LALGetMultiBinarytimes( LALStatus *status, /**< pointer to LALStatus structure */
429 MultiSSBtimes **multiBinary, /**< [out] SSB-timings for all input detector-state series */
430 const MultiSSBtimes *multiSSB, /**< [in] SSB-timings for all input detector-state series */
431 const MultiDetectorStateSeries *multiDetStates, /**< [in] detector-states at timestamps t_i */
432 const BinaryOrbitParams *binaryparams, /**< [in] source binary orbit parameters */
433 LIGOTimeGPS refTime /**< SSB reference-time T_0 for SSB-timing */
434 )
435{
437 MultiSSBtimes *ret = NULL;
438
441
442 /* check input */
448
449 numDetectors = multiDetStates->length;
450
451 if ( ( ret = LALCalloc( 1, sizeof( *ret ) ) ) == NULL ) {
453 }
454 ret->length = numDetectors;
455 if ( ( ret->data = LALCalloc( numDetectors, sizeof( *ret->data ) ) ) == NULL ) {
456 LALFree( ret );
458 }
459
460 for ( X = 0; X < numDetectors; X ++ ) {
461 SSBtimes *BinarytimesX = NULL;
462 UINT4 numStepsX = multiDetStates->data[X]->length;
463
464 ret->data[X] = LALCalloc( 1, sizeof( *( ret->data[X] ) ) );
465 BinarytimesX = ret->data[X];
466 BinarytimesX->DeltaT = XLALCreateREAL8Vector( numStepsX );
467 if ( ( BinarytimesX->Tdot = XLALCreateREAL8Vector( numStepsX ) ) == NULL ) {
468 XLALPrintError( "\nOut of memory!\n\n" );
469 goto failed;
470 }
471 /* printf("calling LALGetBinarytimes\n"); */
472 LALGetBinarytimes( status->statusPtr, BinarytimesX, multiSSB->data[X], multiDetStates->data[X], binaryparams, refTime );
473 /* printf("finished LALGetBinarytimes\n"); */
474 if ( status->statusPtr->statusCode ) {
475 XLALPrintError( "\nCall to LALGetBinarytimes() has failed ... \n\n" );
476 goto failed;
477 }
478
479 // NOTE! It seems the old LAL-function *did not* set the reference time of the output binary-SSB vectors
480 // so we 'fix' this here retro-actively, in order to facilitate comparison with the new XLAL function:
481 BinarytimesX->refTime = multiSSB->data[X]->refTime;
482
483 } /* for X < numDet */
484
485 goto success;
486
487failed:
488 /* free all memory allocated so far */
490 ABORT( status, -1, "LALGetMultiBinarytimes failed" );
491
492success:
493 ( *multiBinary ) = ret;
494
496 RETURN( status );
497
498} /* LALGetMultiBinarytimes() */
int main(int argc, char *argv[])
int XLALCompareMultiSSBtimes(REAL8 *err_DeltaT, REAL8 *err_Tdot, const MultiSSBtimes *m1, const MultiSSBtimes *m2)
Compare 2 MultiSSBtimes vectors and return the maximal difference in DeltaT in s, and in Tdot (dimens...
#define EA_ACC
static void LALGetBinarytimes(LALStatus *, SSBtimes *tBinary, const SSBtimes *tSSB, const DetectorStateSeries *DetectorStates, const BinaryOrbitParams *binaryparams, LIGOTimeGPS refTime)
For a given OrbitalParams, calculate the time-differences , and their derivatives .
#define COMPUTEFSTATC_MSGENULL
int XLALCompareSSBtimes(REAL8 *err_DeltaT, REAL8 *err_Tdot, const SSBtimes *t1, const SSBtimes *t2)
Compare 2 SSBtimes vectors and return the maximal difference in DeltaT in s, and in Tdot (dimensionle...
#define COMPUTEFSTATC_EMEM
#define COMPUTEFSTATC_MSGEMEM
static void LALGetMultiBinarytimes(LALStatus *, MultiSSBtimes **multiBinary, const MultiSSBtimes *multiSSB, const MultiDetectorStateSeries *multiDetStates, const BinaryOrbitParams *binaryparams, LIGOTimeGPS refTime)
Multi-IFO version of LALGetBinarytimes().
static REAL8 A
#define COMPUTEFSTATC_ENONULL
#define COMPUTEFSTATC_MSGEINPUT
#define COMPUTEFSTATC_MSGENONULL
static void EccentricAnomoly(LALStatus *status, REAL8 *tr, REAL8 lE, void *x0)
For a given set of binary parameters we solve the following function for the eccentric anomoly E.
#define COMPUTEFSTATC_ENULL
#define GPS2REAL8(gps)
#define COMPUTEFSTATC_EINPUT
static REAL8 B
void LALCheckMemoryLeaks(void)
#define LALCalloc(m, n)
#define LALFree(p)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
#define ABORT(statusptr, code, mesg)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
double e
void XLALDestroyMultiDetectorStateSeries(MultiDetectorStateSeries *mdetStates)
Helper function to get rid of a multi-IFO DetectorStateSeries Note, this is "NULL-robust" in the sens...
MultiDetectorStateSeries * XLALGetMultiDetectorStates(const MultiLIGOTimeGPSVector *multiTS, const MultiLALDetector *multiIFO, const EphemerisData *edat, REAL8 tOffset)
Get the detector-time series for the given MultiLIGOTimeGPSVector.
void LALDBracketRoot(LALStatus *status, DFindRootIn *inout, void *params)
void LALDBisectionFindRoot(LALStatus *status, REAL8 *root, DFindRootIn *input, void *params)
EphemerisData * XLALInitBarycenter(const CHAR *earthEphemerisFile, const CHAR *sunEphemerisFile)
XLAL interface to reading ephemeris files 'earth' and 'sun', and return ephemeris-data in old backwar...
void XLALDestroyEphemerisData(EphemerisData *edat)
Destructor for EphemerisData struct, NULL robust.
#define LAL_PI_2
#define LAL_TWOPI
unsigned char BOOLEAN
double REAL8
#define XLAL_INIT_DECL(var,...)
uint32_t UINT4
int32_t INT4
void * XLALCalloc(size_t m, size_t n)
const LALDetector * XLALGetSiteInfo(const CHAR *name)
Find the site geometry-information 'LALDetector' for given a detector name (or prefix).
Definition: SFTnaming.c:218
LIGOTimeGPSVector * XLALMakeTimestamps(LIGOTimeGPS tStart, REAL8 Tspan, REAL8 Tsft, REAL8 Toverlap)
Given a start-time, Tspan, Tsft and Toverlap, returns a list of timestamps covering this time-stretch...
void XLALDestroyMultiTimestamps(MultiLIGOTimeGPSVector *multiTS)
Destroy a MultiLIGOTimeGPSVector timestamps vector.
MultiSSBtimes * XLALGetMultiSSBtimes(const MultiDetectorStateSeries *multiDetStates, SkyPosition skypos, LIGOTimeGPS refTime, SSBprecision precision)
Multi-IFO version of XLALGetSSBtimes().
Definition: SSBtimes.c:657
void XLALDestroyMultiSSBtimes(MultiSSBtimes *multiSSB)
Destroy a MultiSSBtimes structure.
Definition: SSBtimes.c:845
int XLALAddMultiBinaryTimes(MultiSSBtimes **multiSSBOut, const MultiSSBtimes *multiSSBIn, const PulsarDopplerParams *Doppler)
Multi-IFO version of XLALAddBinaryTimes().
Definition: SSBtimes.c:413
@ SSBPREC_RELATIVISTICOPT
optimized relativistic, numerically equivalent to SSBPREC_RELATIVISTIC, but faster
Definition: SSBtimes.h:48
COORDINATESYSTEM_EQUATORIAL
int XLALUserVarReadAllInput(BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list)
void XLALDestroyUserVars(void)
#define XLALRegisterUvarMember(name, type, option, category,...)
REAL8Vector * XLALCreateREAL8Vector(UINT4 length)
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
int int XLALPrintWarning(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_ENOMEM
XLAL_SUCCESS
XLAL_EFUNC
XLAL_ETOL
XLAL_EINVAL
XLAL_EFAILED
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
REAL8 XLALGPSGetREAL8(const LIGOTimeGPS *epoch)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
temp
m2
m1
size_t numDetectors
void(* function)(LALStatus *s, REAL8 *y, REAL8 x, void *p)
Timeseries of DetectorState's, representing the detector-info at different timestamps.
UINT4 length
total number of entries
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
Multi-IFO time-series of DetectorStates.
UINT4 length
number of detectors
DetectorStateSeries ** data
vector of pointers to DetectorStateSeries
array of detectors definitions 'LALDetector'
UINT4 length
number of detectors
LALDetector sites[PULSAR_MAX_DETECTORS]
array of site information
A collection of (multi-IFO) LIGOTimeGPSVector time-stamps vectors.
Definition: SFTfileIO.h:198
Multi-IFO container for SSB timings.
Definition: SSBtimes.h:67
SSBtimes ** data
array of SSBtimes (pointers)
Definition: SSBtimes.h:72
UINT4 length
number of IFOs
Definition: SSBtimes.h:71
Type containing the 'Doppler-parameters' affecting the time-evolution of the phase.
REAL8 period
Binary: orbital period (sec)
LIGOTimeGPS tp
Binary: time of observed periapsis passage (in SSB)
PulsarSpins fkdot
Intrinsic spins: [Freq, f1dot, f2dot, ... ] where fkdot = d^kFreq/dt^k.
REAL8 ecc
Binary: orbital eccentricity.
REAL8 asini
Binary: projected, normalized orbital semi-major axis (s).
REAL8 argp
Binary: argument of periapsis (radians)
REAL8 * data
Simple container for two REAL8-vectors, namely the SSB-timings DeltaT_alpha and Tdot_alpha,...
Definition: SSBtimes.h:60
REAL8Vector * Tdot
dT/dt : time-derivative of SSB-time wrt local time for SFT-alpha
Definition: SSBtimes.h:63
REAL8Vector * DeltaT
Time-difference of SFT-alpha - tau0 in SSB-frame.
Definition: SSBtimes.h:62
LIGOTimeGPS refTime
reference-time 'tau0'
Definition: SSBtimes.h:61
REAL8 longitude
REAL8 latitude
CoordinateSystem system