Loading [MathJax]/extensions/TeX/AMSsymbols.js
LALPulsar 7.1.1.1-3a66518
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
TEMPOcomparison.c
Go to the documentation of this file.
1/*
2* Copyright (C) 2015 Reinhard Prix [XLALified]
3* Copyright (C) 2007 Chris Messenger
4*
5* This program is free software; you can redistribute it and/or modify
6* it under the terms of the GNU General Public License as published by
7* the Free Software Foundation; either version 2 of the License, or
8* (at your option) any later version.
9*
10* This program is distributed in the hope that it will be useful,
11* but WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with with program; see the file COPYING. If not, write to the
17* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18* MA 02110-1301 USA
19*/
20
21/**
22 * \author Chris Messenger
23 * \file
24 * \ingroup lalpulsar_coh
25 * \brief Tests for CW barycentric timing functions by comparing to tempo2
26 *
27 */
28
29#include <stdlib.h>
30#include <math.h>
31#include <stdio.h>
32#include <stdlib.h>
33#include <string.h>
34#include <lal/LALStdlib.h>
35#include <lal/LALConstants.h>
36#include <lal/AVFactories.h>
37#include <lal/SeqFactories.h>
38#include <lal/PulsarDataTypes.h>
39#include <lal/LALInitBarycenter.h>
40#include <lal/GeneratePulsarSignal.h>
41#include <lal/Random.h>
42#include <lal/LALString.h>
43#include <lal/UserInput.h>
44#include <lal/LALPulsarVCSInfo.h>
45#include <lal/TranslateAngles.h>
46
47/*---------- local defines ---------- */
48#define TRUE (1==1)
49#define FALSE (1==0)
50
51#define GBT_LOCATION_X 882589.65
52#define GBT_LOCATION_Y -4924872.32
53#define GBT_LOCATION_Z 3943729.348
54
55#define NARRABRI_LOCATION_X -4752329.7000
56#define NARRABRI_LOCATION_Y 2790505.9340
57#define NARRABRI_LOCATION_Z -3200483.7470
58
59#define ARECIBO_LOCATION_X 2390490.0
60#define ARECIBO_LOCATION_Y -5564764.0
61#define ARECIBO_LOCATION_Z 1994727.0
62
63#define NANSHAN_LOCATION_X -228310.702
64#define NANSHAN_LOCATION_Y 4631922.905
65#define NANSHAN_LOCATION_Z 4367064.059
66
67#define DSS_43_LOCATION_X -4460892.6
68#define DSS_43_LOCATION_Y 2682358.9
69#define DSS_43_LOCATION_Z -3674756.0
70
71#define PARKES_LOCATION_X -4554231.5
72#define PARKES_LOCATION_Y 2816759.1
73#define PARKES_LOCATION_Z -3454036.3
74
75#define JODRELL_LOCATION_X 3822252.643
76#define JODRELL_LOCATION_Y -153995.683
77#define JODRELL_LOCATION_Z 5086051.443
78
79#define VLA_LOCATION_X -1601192.
80#define VLA_LOCATION_Y -5041981.4
81#define VLA_LOCATION_Z 3554871.4
82
83#define NANCAY_LOCATION_X 4324165.81
84#define NANCAY_LOCATION_Y 165927.11
85#define NANCAY_LOCATION_Z 4670132.83
86
87#define EFFELSBERG_LOCATION_X 4033949.5
88#define EFFELSBERG_LOCATION_Y 486989.4
89#define EFFELSBERG_LOCATION_Z 4900430.8
90
91#define JODRELLM4_LOCATION_X 3822252.643
92#define JODRELLM4_LOCATION_Y -153995.683
93#define JODRELLM4_LOCATION_Z 5086051.443
94
95#define GB300_LOCATION_X 881856.58
96#define GB300_LOCATION_Y -4925311.86
97#define GB300_LOCATION_Z 3943459.70
98
99#define GB140_LOCATION_X 882872.57
100#define GB140_LOCATION_Y -4924552.73
101#define GB140_LOCATION_Z 3944154.92
102
103#define GB853_LOCATION_X 882315.33
104#define GB853_LOCATION_Y -4925191.41
105#define GB853_LOCATION_Z 3943414.05
106
107#define LA_PALMA_LOCATION_X 5327021.651
108#define LA_PALMA_LOCATION_Y -1719555.576
109#define LA_PALMA_LOCATION_Z 3051967.932
110
111#define Hobart_LOCATION_X -3950077.96
112#define Hobart_LOCATION_Y 2522377.31
113#define Hobart_LOCATION_Z -4311667.52
114
115#define Hartebeesthoek_LOCATION_X 5085442.780
116#define Hartebeesthoek_LOCATION_Y 2668263.483
117#define Hartebeesthoek_LOCATION_Z -2768697.034
118
119#define WSRT_LOCATION_X 3828445.659
120#define WSRT_LOCATION_Y 445223.600000
121#define WSRT_LOCATION_Z 5064921.5677
122
123#define COE_LOCATION_X 0.0
124#define COE_LOCATION_Y 1.0
125#define COE_LOCATION_Z 0.0
126
127/* 882589.65 -4924872.32 3943729.348 GBT gbt */
128/* -4752329.7000 2790505.9340 -3200483.7470 NARRABRI atca */
129/* 2390490.0 -5564764.0 1994727.0 ARECIBO ao */
130/* -228310.702 4631922.905 4367064.059 NANSHAN nanshan */
131/* -4460892.6 2682358.9 -3674756.0 DSS_43 tid43 */
132/* -4554231.5 2816759.1 -3454036.3 PARKES pks */
133/* 3822252.643 -153995.683 5086051.443 JODRELL jb */
134/* -1601192. -5041981.4 3554871.4 VLA vla */
135/* 4324165.81 165927.11 4670132.83 NANCAY ncy */
136/* 4033949.5 486989.4 4900430.8 EFFELSBERG eff */
137/* 3822252.643 -153995.683 5086051.443 JODRELLM4 jbm4 */
138/* 881856.58 -4925311.86 3943459.70 GB300 gb300 */
139/* 882872.57 -4924552.73 3944154.92 GB140 gb140 */
140/* 882315.33 -4925191.41 3943414.05 GB853 gb853 */
141/* 5327021.651 -1719555.576 3051967.932 LA_PALMA lap */
142/* -3950077.96 2522377.31 -4311667.52 Hobart hob */
143/* 5085442.780 2668263.483 -2768697.034 Hartebeesthoek hart */
144/* 3828445.659 445223.600000 5064921.5677 WSRT wsrt */
145/* # */
146/* ####### From Jodrell obsys.dat file */
147/* # */
148/* 383395.727 -173759.585 5077751.313 MKIII j */
149/* 3817176.557 -162921.170 5089462.046 TABLEY k */
150/* 3828714.504 -169458.987 5080647.749 DARNHALL l */
151/* 3859711.492 -201995.082 5056134.285 KNOCKIN m */
152/* 3923069.135 -146804.404 5009320.570 DEFFORD n */
153/* 0.0 1.0 0.0 COE coe */
154/* # */
155/* ###### Telescope ID changed from the Jodrell obsys.dat file */
156/* # */
157/* 3822473.365 -153692.318 5085851.303 JB_MKII jbmk2 */
158/* 3822294.825 -153862.275 5085987.071 JB_42ft jb42 */
159/* # */
160/* # New telescopes */
161/* # 284543.5 -175324.040 2400. LA_PALMA p */
162/* 1719555.576 5327021.651 3051967.932 LA_PALMA p */
163
164/* ---------- local types ---------- */
165
166/** user input variables */
167typedef struct {
175 CHAR *ephemEarth; /* Earth ephemeris file to use */
176 CHAR *ephemSun; /* Sun ephemeris file to use */
182
184
185/* a time structure to accurately store MJD times so as not to lose any precision */
186typedef struct {
187 INT4 days; /* integer MJD days */
188 REAL8 fracdays; /* fractional day */
189} MJDTime;
190
191/* ---------- global variables ----------*/
192extern int vrbflg;
193
194/* ---------- local prototypes ---------- */
195int initUserVars( int argc, char *argv[], UserVariables_t *uvar );
196
197void TDBMJDtoGPS( LIGOTimeGPS *GPS, MJDTime MJD );
198void AddIntervaltoMJD( double interval, MJDTime *MJDout, MJDTime MJDin );
199void REAL8toMJD( MJDTime *MJD, REAL8 x );
200int UTCMJDtoGPS( LIGOTimeGPS *GPS, MJDTime MJD, INT4 leap );
201void UTCGPStoMJD( MJDTime *MJD, LIGOTimeGPS *GPS, INT4 leap );
202void TDBGPStoMJD( MJDTime *MJD, LIGOTimeGPS GPS, INT4 leap );
205void GPStoTDBMJD( MJDTime *TDBMJD, LIGOTimeGPS GPS );
206
207/*============================================================
208 * FUNCTION definitions
209 *============================================================*/
210
211int
212main( int argc, char *argv[] )
213{
214 FILE *fp = NULL;
215 BarycenterInput XLAL_INIT_DECL( baryinput );
216 INT4 leap0, leap;
218 LIGOTimeGPS TstartSSB, TendSSB, TendGPS;
219 INT4 n;
220 LIGOTimeGPS *TSSB = NULL;
221 MJDTime TstartUTCMJD;
222 LIGOTimeGPS TDET;
223 REAL8 temp;
224 INT4 i;
225 MJDTime tempTOA;
226 REAL8 dt;
227 LIGOTimeGPS TstartGPS;
228 MJDTime *TOA = NULL;
229 CHAR tempstr[1024];
230 CHAR *tempstr2;
231 CHAR TstartMJDstr[2048], TfinishMJDstr[2048], TOAstr[2048];
232 PulsarSignalParams pulsarparams;
233 CHAR parfile[256];
234 CHAR timfile[256];
235 CHAR detcode[16];
236 REAL8 TstartUTCMJDtest;
237 REAL8 diff;
238 MJDTime MJDdiff, MJDtest;
239
240 MJDTime TrefTDBMJD;
241 LIGOTimeGPS TrefSSB_TDB_GPS;
242
243 // ----------------------------------------------------------------------
245 XLAL_CHECK( initUserVars( argc, argv, &uvar ) == XLAL_SUCCESS, XLAL_EFUNC );
246
247 unsigned int seed = uvar.randSeed;
248 if ( uvar.randSeed == 0 ) {
249 seed = clock();
250 }
251 srand( seed );
252
253 // ----- sky position: random or user-specified ----------
255 CHAR *RAJ = NULL, *DECJ = NULL;
256
257 BOOLEAN have_RAJ = XLALUserVarWasSet( &uvar.RAJ );
258 BOOLEAN have_DECJ = XLALUserVarWasSet( &uvar.DECJ );
259 if ( have_RAJ ) {
261 RAJ = XLALStringDuplicate( uvar.RAJ );
262 } else {
263 // pick randomly
264 alpha = LAL_TWOPI * ( 1.0 * rand() / ( RAND_MAX + 1.0 ) ); // alpha uniform in [0, 2pi)
265 XLAL_CHECK( ( RAJ = XLALTranslateRADtoHMS( alpha ) ) != NULL, XLAL_EFUNC );
266 }
267 if ( have_DECJ ) {
269 DECJ = XLALStringDuplicate( uvar.DECJ );
270 } else {
271 // pick randomly
272 delta = LAL_PI_2 - acos( 1 - 2.0 * rand() / RAND_MAX ); // sin(delta) uniform in [-1,1]
273 XLAL_CHECK( ( DECJ = XLALTranslateRADtoDMS( delta ) ) != NULL, XLAL_EFUNC );
274 }
275
276 /* define start time in an MJD structure */
277 REAL8toMJD( &TstartUTCMJD, uvar.TstartUTCMJD );
278 XLALPrintInfo( "TstartUTCMJD=%f converted to MJD days = %d fracdays = %6.12f\n", uvar.TstartUTCMJD, TstartUTCMJD.days, TstartUTCMJD.fracdays );
279
280 /* convert back to test conversions */
281 TstartUTCMJDtest = MJDtoREAL8( TstartUTCMJD );
282 diff = uvar.TstartUTCMJD - TstartUTCMJDtest;
283 if ( fabs( diff ) > 1e-9 ) {
284 fprintf( stderr, "ERROR : Time conversion gives discrepancy of %e sec. Exiting.\n", diff );
285 return ( -1 );
286 }
287 XLALPrintInfo( "MJD conversion gives discrepancies of %e sec\n", diff );
288
289 /* use start time to define an epoch for the leap seconds */
290 /* Note that epochs are defined in TDB !!! but here we only need to be rough to get a leap second value */
291 TDBMJDtoGPS( &epoch, TstartUTCMJD );
292 XLALPrintInfo( "leap second epoch = %d %d\n", epoch.gpsSeconds, epoch.gpsNanoSeconds );
293
294 /* deal with ephemeris files and compute leap seconds */
296 XLAL_CHECK( ( edat = XLALInitBarycenter( uvar.ephemEarth, uvar.ephemSun ) ) != NULL, XLAL_EFUNC );
297
298 leap0 = XLALGPSLeapSeconds( epoch.gpsSeconds );
299 XLALPrintInfo( "leap seconds = %d\n", leap0 );
300
301 /* select detector location */
302 if ( strcmp( uvar.Observatory, "GBT" ) == 0 ) {
303 baryinput.site.location[0] = GBT_LOCATION_X;
304 baryinput.site.location[1] = GBT_LOCATION_Y;
305 baryinput.site.location[2] = GBT_LOCATION_Z;
306 sprintf( detcode, "gbt" );
307 } else if ( strcmp( uvar.Observatory, "NARRABRI" ) == 0 ) {
308 baryinput.site.location[0] = NARRABRI_LOCATION_X;
309 baryinput.site.location[1] = NARRABRI_LOCATION_Y;
310 baryinput.site.location[2] = NARRABRI_LOCATION_Z;
311 sprintf( detcode, "atca" );
312 } else if ( strcmp( uvar.Observatory, "ARECIBO" ) == 0 ) {
313 baryinput.site.location[0] = ARECIBO_LOCATION_X;
314 baryinput.site.location[1] = ARECIBO_LOCATION_Y;
315 baryinput.site.location[2] = ARECIBO_LOCATION_Z;
316 sprintf( detcode, "ao" );
317 } else if ( strcmp( uvar.Observatory, "NANSHAN" ) == 0 ) {
318 baryinput.site.location[0] = NANSHAN_LOCATION_X;
319 baryinput.site.location[1] = NANSHAN_LOCATION_Y;
320 baryinput.site.location[2] = NANSHAN_LOCATION_Z;
321 sprintf( detcode, "nanshan" );
322 } else if ( strcmp( uvar.Observatory, "DSS_43" ) == 0 ) {
323 baryinput.site.location[0] = DSS_43_LOCATION_X;
324 baryinput.site.location[1] = DSS_43_LOCATION_Y;
325 baryinput.site.location[2] = DSS_43_LOCATION_Z;
326 sprintf( detcode, "tid43" );
327 } else if ( strcmp( uvar.Observatory, "PARKES" ) == 0 ) {
328 baryinput.site.location[0] = PARKES_LOCATION_X;
329 baryinput.site.location[1] = PARKES_LOCATION_Y;
330 baryinput.site.location[2] = PARKES_LOCATION_Z;
331 sprintf( detcode, "pks" );
332 } else if ( strcmp( uvar.Observatory, "JODRELL" ) == 0 ) {
333 baryinput.site.location[0] = JODRELL_LOCATION_X;
334 baryinput.site.location[1] = JODRELL_LOCATION_Y;
335 baryinput.site.location[2] = JODRELL_LOCATION_Z;
336 sprintf( detcode, "jb" );
337 } else if ( strcmp( uvar.Observatory, "VLA" ) == 0 ) {
338 baryinput.site.location[0] = VLA_LOCATION_X;
339 baryinput.site.location[1] = VLA_LOCATION_Y;
340 baryinput.site.location[2] = VLA_LOCATION_Z;
341 sprintf( detcode, "vla" );
342 } else if ( strcmp( uvar.Observatory, "NANCAY" ) == 0 ) {
343 baryinput.site.location[0] = NANCAY_LOCATION_X;
344 baryinput.site.location[1] = NANCAY_LOCATION_Y;
345 baryinput.site.location[2] = NANCAY_LOCATION_Z;
346 sprintf( detcode, "ncy" );
347 } else if ( strcmp( uvar.Observatory, "EFFELSBERG" ) == 0 ) {
348 baryinput.site.location[0] = EFFELSBERG_LOCATION_X;
349 baryinput.site.location[1] = EFFELSBERG_LOCATION_Y;
350 baryinput.site.location[2] = EFFELSBERG_LOCATION_Z;
351 sprintf( detcode, "eff" );
352 } else if ( strcmp( uvar.Observatory, "JODRELLM4" ) == 0 ) {
353 baryinput.site.location[0] = JODRELLM4_LOCATION_X;
354 baryinput.site.location[1] = JODRELLM4_LOCATION_Y;
355 baryinput.site.location[2] = JODRELLM4_LOCATION_Z;
356 sprintf( detcode, "jbm4" );
357 } else if ( strcmp( uvar.Observatory, "GB300" ) == 0 ) {
358 baryinput.site.location[0] = GB300_LOCATION_X;
359 baryinput.site.location[1] = GB300_LOCATION_Y;
360 baryinput.site.location[2] = GB300_LOCATION_Z;
361 sprintf( detcode, "gb300" );
362 } else if ( strcmp( uvar.Observatory, "GB140" ) == 0 ) {
363 baryinput.site.location[0] = GB140_LOCATION_X;
364 baryinput.site.location[1] = GB140_LOCATION_Y;
365 baryinput.site.location[2] = GB140_LOCATION_Z;
366 sprintf( detcode, "gb140" );
367 } else if ( strcmp( uvar.Observatory, "GB853" ) == 0 ) {
368 baryinput.site.location[0] = GB853_LOCATION_X;
369 baryinput.site.location[1] = GB853_LOCATION_Y;
370 baryinput.site.location[2] = GB853_LOCATION_Z;
371 sprintf( detcode, "gb853" );
372 } else if ( strcmp( uvar.Observatory, "LA_PALMA" ) == 0 ) {
373 baryinput.site.location[0] = LA_PALMA_LOCATION_X;
374 baryinput.site.location[1] = LA_PALMA_LOCATION_Y;
375 baryinput.site.location[2] = LA_PALMA_LOCATION_Z;
376 sprintf( detcode, "lap" );
377 } else if ( strcmp( uvar.Observatory, "Hobart" ) == 0 ) {
378 baryinput.site.location[0] = Hobart_LOCATION_X;
379 baryinput.site.location[1] = Hobart_LOCATION_Y;
380 baryinput.site.location[2] = Hobart_LOCATION_Z;
381 sprintf( detcode, "hob" );
382 } else if ( strcmp( uvar.Observatory, "Hartebeesthoek" ) == 0 ) {
383 baryinput.site.location[0] = Hartebeesthoek_LOCATION_X;
384 baryinput.site.location[1] = Hartebeesthoek_LOCATION_Y;
385 baryinput.site.location[2] = Hartebeesthoek_LOCATION_Z;
386 sprintf( detcode, "hart" );
387 } else if ( strcmp( uvar.Observatory, "WSRT" ) == 0 ) {
388 baryinput.site.location[0] = WSRT_LOCATION_X;
389 baryinput.site.location[1] = WSRT_LOCATION_Y;
390 baryinput.site.location[2] = WSRT_LOCATION_Z;
391 sprintf( detcode, "wsrt" );
392 } else if ( strcmp( uvar.Observatory, "COE" ) == 0 ) {
393 baryinput.site.location[0] = COE_LOCATION_X;
394 baryinput.site.location[1] = COE_LOCATION_Y;
395 baryinput.site.location[2] = COE_LOCATION_Z;
396 sprintf( detcode, "coe" );
397 } else if ( strcmp( uvar.Observatory, "SSB" ) != 0 ) {
398 fprintf( stderr, "ERROR. Unknown Observatory %s. Exiting.\n", uvar.Observatory );
399 return ( -1 );
400 }
401 XLALPrintInfo( "selected observatory %s - observatoryt code = %s\n", uvar.Observatory, detcode );
402 XLALPrintInfo( "baryinput location = %6.12f %6.12f %6.12f\n", baryinput.site.location[0], baryinput.site.location[1], baryinput.site.location[2] );
403
404 /* convert start time to UTC GPS */
405 UTCMJDtoGPS( &TstartGPS, TstartUTCMJD, leap0 );
406 XLALPrintInfo( "TstartGPS = %d %d\n", TstartGPS.gpsSeconds, TstartGPS.gpsNanoSeconds );
407
408 /* convert back to test conversion */
409 UTCGPStoMJD( &MJDtest, &TstartGPS, leap0 );
410 deltaMJD( &MJDdiff, &MJDtest, &TstartUTCMJD );
411 diff = ( MJDdiff.days + MJDdiff.fracdays ) * 86400;
412 if ( fabs( diff ) > 1e-9 ) {
413 fprintf( stderr, "ERROR : Time conversion gives discrepancy of %e sec. Exiting.\n", diff );
414 return ( -1 );
415 }
416 XLALPrintInfo( "MJD conversion gives discrepancies of %e sec\n", diff );
417
418 /* define reference time in an MJD structure */
419 REAL8toMJD( &TrefTDBMJD, uvar.TrefTDBMJD );
420 XLALPrintInfo( "TrefTDBMJD converted to MJD days = %d fracdays = %6.12f\n", TrefTDBMJD.days, TrefTDBMJD.fracdays );
421
422 /* convert reference time to TDB GPS */
423 TDBMJDtoGPS( &TrefSSB_TDB_GPS, TrefTDBMJD );
424 XLALPrintInfo( "TrefSSB_TDB_GPS = %d %d\n", TrefSSB_TDB_GPS.gpsSeconds, TrefSSB_TDB_GPS.gpsNanoSeconds );
425
426 /* convert back to test conversion */
427 TDBGPStoMJD( &MJDtest, TrefSSB_TDB_GPS, leap0 );
428 deltaMJD( &MJDdiff, &MJDtest, &TrefTDBMJD );
429 diff = ( MJDdiff.days + MJDdiff.fracdays ) * 86400;
430 if ( fabs( diff ) > 1e-9 ) {
431 fprintf( stderr, "ERROR : Time conversion gives discrepancy of %e sec. Exiting.\n", diff );
432 return ( -1 );
433 }
434 XLALPrintInfo( "MJD conversion gives discrepancies of %e sec\n", diff );
435
436 /* fill in required pulsar params structure for Barycentering */
437 LALDetector *site = NULL;
438 site = ( LALDetector * )LALMalloc( sizeof( LALDetector ) );
439 site->location[0] = baryinput.site.location[0];
440 site->location[1] = baryinput.site.location[1];
441 site->location[2] = baryinput.site.location[2];
442 pulsarparams.site = site;
443
444 pulsarparams.pulsar.position.longitude = alpha;
445 pulsarparams.pulsar.position.latitude = delta;
447 pulsarparams.ephemerides = edat;
448
449 /* generate SSB initial TOA in GPS */
450 XLALConvertGPS2SSB( &TstartSSB, TstartGPS, &pulsarparams );
451 XLALPrintInfo( "TstartSSB = %d %d\n", TstartSSB.gpsSeconds, TstartSSB.gpsNanoSeconds );
452
453 /* define TOA end time in GPS */
454 temp = uvar.DurationMJD * 86400.0;
455 TendGPS = TstartGPS;
456 XLALGPSAdd( &TendGPS, temp );
457 XLALPrintInfo( "GPS end time of TOAs = %d %d\n", TendGPS.gpsSeconds, TendGPS.gpsNanoSeconds );
458
459 /* generate SSB end time in GPS (force integer seconds) */
460 XLALConvertGPS2SSB( &TendSSB, TendGPS, &pulsarparams );
461 XLALPrintInfo( "TendSSB = %d %d\n", TendSSB.gpsSeconds, TendSSB.gpsNanoSeconds );
462
463 /* define TOA seperation in the SSB */
464 dt = uvar.DeltaTMJD * 86400.0;
465 n = ( INT4 )ceil( uvar.DurationMJD / uvar.DeltaTMJD );
466 XLALPrintInfo( "TOA seperation at SSB = %g sec\n", dt );
467 XLALPrintInfo( "number of TOAs to generate = %d\n", n );
468
469 /* allocate memory for artificial SSB TOAs */
470 TSSB = ( LIGOTimeGPS * )LALMalloc( n * sizeof( LIGOTimeGPS ) );
471 TOA = ( MJDTime * )LALMalloc( n * sizeof( MJDTime ) );
472
473 /* generate artificial SSB TOAs given the phase model phi = 2*pi*(f0*(t-tref) + 0.5*fdot*(t-tref)^2) */
474 for ( i = 0; i < n; i++ ) {
475 REAL8 dtref, fnow, cyclefrac, dtcor;
476 LIGOTimeGPS tnow;
477
478 /* define current interval */
479 XLALPrintInfo( "current (t-tstart) = %g sec\n", i * dt );
480
481 /* define current t */
482 tnow = TstartSSB;
483 XLALGPSAdd( &tnow, i * dt );
484 XLALPrintInfo( "current t = %d %d\n", tnow.gpsSeconds, tnow.gpsNanoSeconds );
485
486 /* define current t-tref */
487 dtref = XLALGPSDiff( &tnow, &TrefSSB_TDB_GPS );
488 XLALPrintInfo( "current (t - tref) = %9.12f\n", dtref );
489
490 dtcor = 1;
491 while ( dtcor > 1e-9 ) {
492
493 /* define actual cycle fraction at requested time */
494 cyclefrac = fmod( uvar.f0 * dtref + 0.5 * uvar.fdot * dtref * dtref, 1.0 );
495 XLALPrintInfo( "cyclefrac = %9.12f\n", cyclefrac );
496
497 /* define instantaneous frequency */
498 fnow = uvar.f0 + uvar.fdot * dtref;
499 XLALPrintInfo( "instananeous frequency = %9.12f\n", fnow );
500
501 /* add correction to time */
502 dtcor = cyclefrac / fnow;
503 dtref -= dtcor;
504 XLALPrintInfo( "timing correction = %9.12f\n", dtcor );
505 XLALPrintInfo( "corrected dtref to = %9.12f\n", dtref );
506 } // while dtcor>1e-9
507
508 /* define time of zero phase */
509 TSSB[i] = TrefSSB_TDB_GPS;
510 XLALGPSAdd( &TSSB[i], dtref );
511 XLALPrintInfo( "TSSB[%d] = %d %d\n", i, TSSB[i].gpsSeconds, TSSB[i].gpsNanoSeconds );
512 } // for i < n
513
514 /* loop over SSB time of arrivals and compute detector time of arrivals */
515 for ( i = 0; i < n; i++ ) {
516 LIGOTimeGPS TSSBtest;
517 LIGOTimeGPS GPStest;
518
519 /* convert SSB to Detector time */
520 int ret = XLALConvertSSB2GPS( &TDET, TSSB[i], &pulsarparams );
521 if ( ret != XLAL_SUCCESS ) {
522 XLALPrintError( "XLALConvertSSB2GPS() failed with xlalErrno = %d\n", xlalErrno );
523 return ( -1 );
524 }
525
526 XLALPrintInfo( "converted SSB TOA %d %d -> Detector TOA %d %d\n", TSSB[i].gpsSeconds, TSSB[i].gpsNanoSeconds, TDET.gpsSeconds, TDET.gpsNanoSeconds );
527
528 /* convert back for testing conversion */
529 XLALConvertGPS2SSB( &TSSBtest, TDET, &pulsarparams );
530 diff = XLALGPSDiff( &TSSBtest, &TSSB[i] );
531 if ( fabs( diff ) > 1e-9 ) {
532 fprintf( stderr, "ERROR : Time conversion gives discrepancy of %e sec. Exiting.\n", diff );
533 return ( -1 );
534 }
535 XLALPrintInfo( "SSB -> detector conversion gives discrepancies of %e sec\n", diff );
536
537 /* recompute leap seconds incase they've changed */
538 leap = XLALGPSLeapSeconds( TDET.gpsSeconds );
539
540 /* must now convert to an MJD time for TEMPO */
541 /* Using UTC conversion as used by Matt in his successful comparison */
542 UTCGPStoMJD( &tempTOA, &TDET, leap );
543 XLALPrintInfo( "output MJD time = %d %6.12f\n", tempTOA.days, tempTOA.fracdays );
544
545 /* convert back to test conversion */
546 UTCMJDtoGPS( &GPStest, tempTOA, leap );
547 diff = XLALGPSDiff( &TDET, &GPStest );
548 if ( fabs( diff ) > 1e-9 ) {
549 fprintf( stderr, "ERROR. Time conversion gives discrepancy of %e sec. Exiting.\n", diff );
550 return ( -1 );
551 }
552 XLALPrintInfo( "MJD time conversion gives discrepancies of %e sec\n", diff );
553
554 /* fill in results */
555 TOA[i].days = tempTOA.days;
556 TOA[i].fracdays = tempTOA.fracdays;
557
558 } // for i < n
559
560 snprintf( tempstr, sizeof( tempstr ), "%1.13f", TOA[0].fracdays );
561 tempstr2 = tempstr + 2;
562 snprintf( TstartMJDstr, sizeof( TstartMJDstr ), "%d.%s", TOA[0].days, tempstr2 );
563 XLALPrintInfo( "Converted initial TOA MJD %d %6.12f to the string %s\n", TOA[0].days, TOA[0].fracdays, TstartMJDstr );
564
565 snprintf( tempstr, sizeof( tempstr ), "%1.13f", TOA[n - 1].fracdays );
566 tempstr2 = tempstr + 2;
567 snprintf( TfinishMJDstr, sizeof( TfinishMJDstr ), "%d.%s", TOA[n - 1].days, tempstr2 );
568 XLALPrintInfo( "*** Converted MJD to a string %s\n", TfinishMJDstr );
569 XLALPrintInfo( "Converted final TOA MJD %d %6.12f to the string %s\n", TOA[n - 1].days, TOA[n - 1].fracdays, TfinishMJDstr );
570
571 /* define output file names */
572 sprintf( parfile, "%s.par", uvar.PSRJ );
573 sprintf( timfile, "%s.tim", uvar.PSRJ );
574
575 /* output to par file in format required by TEMPO 2 */
576 if ( ( fp = fopen( parfile, "w" ) ) == NULL ) {
577 fprintf( stderr, "ERROR. Could not open file %s. Exiting.\n", parfile );
578 return ( -1 );
579 }
580 fprintf( fp, "PSRJ\t%s\n", uvar.PSRJ );
581 fprintf( fp, "RAJ\t%s\t1\n", RAJ );
582 fprintf( fp, "DECJ\t%s\t1\n", DECJ );
583 fprintf( fp, "PEPOCH\t%6.12f\n", uvar.TrefTDBMJD );
584 fprintf( fp, "POSEPOCH\t%6.12f\n", uvar.TrefTDBMJD );
585 fprintf( fp, "DMEPOCH\t%6.12f\n", uvar.TrefTDBMJD );
586 fprintf( fp, "DM\t0.0\n" );
587 fprintf( fp, "F0\t%6.16f\t1\n", uvar.f0 );
588 fprintf( fp, "F1\t%6.16f\t0\n", uvar.fdot );
589 fprintf( fp, "START\t%s\n", TstartMJDstr );
590 fprintf( fp, "FINISH\t%s\n", TfinishMJDstr );
591 fprintf( fp, "TZRSITE\t%s\n", detcode );
592 fprintf( fp, "CLK\tUTC(NIST)\n" );
593 fprintf( fp, "EPHEM\tDE405\n" );
594 fprintf( fp, "UNITS\tTDB\n" );
595 fprintf( fp, "MODE\t0\n" );
596
597 /* close par file */
598 fclose( fp );
599
600 /* output to tim file in format required by TEMPO 2 */
601 if ( ( fp = fopen( timfile, "w" ) ) == NULL ) {
602 fprintf( stderr, "ERROR. Could not open file %s. Exiting.\n", timfile );
603 return ( -1 );
604 }
605
606 fprintf( fp, "FORMAT 1\n" );
607 for ( i = 0; i < n; i++ ) {
608 /* convert each TOA to a string for output */
609 snprintf( tempstr, sizeof( tempstr ), "%1.16f", TOA[i].fracdays );
610 tempstr2 = tempstr + 2;
611 snprintf( TOAstr, sizeof( TOAstr ), "%d.%s", TOA[i].days, tempstr2 );
612 fprintf( fp, "blank.dat\t1000.0\t%s\t1.0\t%s\n", TOAstr, detcode );
613 XLALPrintInfo( "Converting MJD time %d %6.16f to string %s\n", TOA[i].days, TOA[i].fracdays, TOAstr );
614 } // for i < n
615
616 /* close tim file */
617 fclose( fp );
618
619 /* free memory */
620 XLALFree( TSSB );
621 XLALFree( TOA );
622 XLALFree( site );
626
627 return XLAL_SUCCESS;
628
629} /* main() */
630
631
632/** register all "user-variables" */
633int
634initUserVars( int argc, char *argv[], UserVariables_t *uvar )
635{
636 XLAL_CHECK( argc > 0 && ( argv != NULL ) && ( uvar != NULL ), XLAL_EINVAL );
637
638 /* set a few defaults */
639 uvar->RAJ = NULL;
640 uvar->DECJ = NULL;
641
642 uvar->TstartUTCMJD = 53400;
643 uvar->TrefTDBMJD = 53400;
644 uvar->DeltaTMJD = 1;
645 uvar->DurationMJD = 1800;
646
647 uvar->f0 = 1.0;
648 uvar->fdot = 0.0;
649
650 uvar->PSRJ = XLALStringDuplicate( "TEMPOcomparison" );
651
652 uvar->Observatory = XLALStringDuplicate( "JODRELL" );
653
654 uvar->randSeed = 1;
655
656 uvar->ephemEarth = XLALStringDuplicate( "earth00-40-DE405.dat.gz" );
657 uvar->ephemSun = XLALStringDuplicate( "sun00-40-DE405.dat.gz" );
658
659 /* register user input variables */
660 XLALRegisterUvarMember( RAJ, STRING, 'r', OPTIONAL, "Right ascension hh:mm.ss.ssss [Default=random]" );
661 XLALRegisterUvarMember( DECJ, STRING, 'j', OPTIONAL, "Declination deg:mm.ss.ssss [Default=random]" );
662 XLALRegisterUvarMember( ephemEarth, STRING, 0, OPTIONAL, "Earth ephemeris file to use" );
663 XLALRegisterUvarMember( ephemSun, STRING, 0, OPTIONAL, "Sun ephemeris file to use" );
664 XLALRegisterUvarMember( f0, REAL8, 'f', OPTIONAL, "The signal frequency in Hz at SSB at the reference time" );
665 XLALRegisterUvarMember( fdot, REAL8, 'p', OPTIONAL, "The signal frequency derivitive in Hz at SSB at the reference time" );
666 XLALRegisterUvarMember( TrefTDBMJD, REAL8, 'R', OPTIONAL, "Reference time at the SSB in TDB in MJD" );
667 XLALRegisterUvarMember( TstartUTCMJD, REAL8, 'T', OPTIONAL, "Start time of output TOAs in UTC" );
668 XLALRegisterUvarMember( DeltaTMJD, REAL8, 't', OPTIONAL, "Time inbetween TOAs (in days)" );
669 XLALRegisterUvarMember( DurationMJD, REAL8, 'D', OPTIONAL, "Full duration of TOAs (in days)" );
670 XLALRegisterUvarMember( PSRJ, STRING, 'n', OPTIONAL, "Name of pulsar" );
671 XLALRegisterUvarMember( Observatory, STRING, 'O', OPTIONAL, "TEMPO observatory name (GBT,ARECIBO,NARRABRI,NANSHAN,DSS_43,PARKES,JODRELL,VLA,NANCAY,COE,SSB)" );
672 XLALRegisterUvarMember( randSeed, INT4, 0, OPTIONAL, "The random seed [0 = clock]" );
673
674 /* read all command line variables */
675 BOOLEAN should_exit = 0;
677 if ( should_exit ) {
678 exit( 1 );
679 }
680
681 return XLAL_SUCCESS;
682} /* initUserVars() */
683
684
685
686/* ------------------------------------------------------------------------------- */
687/* the following functions have been written to maintain a high level of precision */
688/* in storing MJD times */
689/* ------------------------------------------------------------------------------- */
690
691/* this function takes a REAL8 input MJD time and returns the same time */
692/* but stored in an MJFTime structure to avoid loss of precision. */
693/* A REAL8 can only store a present day MJD time to 12 decimal figure */
694/* corresponding to 1e-7 sec */
695void
697{
698 /* take integer part of input time */
699 MJD->days = ( INT4 )floor( x );
700 MJD->fracdays = fmod( x, 1.0 );
701} // REAL8toMJD()
702
703REAL8
705{
706 return ( REAL8 )MJD.days + ( REAL8 )MJD.fracdays * 86400.0;
707} // MJDtoREAL8
708
709void
711{
712 MJDTime z;
713
714 /* remove the days part from the other time */
715 z.days = x->days - y->days;
716 z.fracdays = x->fracdays;
717
718 /* remove frac days part */
719 z.fracdays = z.fracdays - y->fracdays;
720 if ( z.fracdays < 0 ) {
721 z.fracdays = 1.0 + z.fracdays;
722 z.days--;
723 }
724
725 dMJD->days = z.days;
726 dMJD->fracdays = z.fracdays;
727
728} // deltaMJD()
729
730/* this function adds a LALTimeInterval in sec.nanosec to an MJDTime structure */
731void
732AddIntervaltoMJD( double interval, MJDTime *MJDout, MJDTime MJDin )
733{
734 REAL8 fracdays = 0.0;
735 INT4 days = 0;
736 REAL8 temp, sfd;
737
738 /* convert seconds part to fractional days */
739 sfd = interval / 86400.0;
740
741 temp = MJDin.fracdays + sfd;
742 fracdays = fmod( temp, 1.0 );
743 days = MJDin.days + ( INT4 )floor( temp );
744
745 MJDout->days = days;
746 MJDout->fracdays = fracdays;
747} // AddIntervaltoMJD()
748
749void
751{
752 REAL8 Tdiff, dtrel;
753 REAL8 MJDtemp;
754 MJDTime MJDtest;
755 LIGOTimeGPS GPStemp;
756
757 /* straight forward conversion from GPS to MJD */
758 /* we do not need the more accurate MJDtime structure */
759 MJDtemp = ( ( REAL8 )GPS.gpsSeconds + 1e-9 * ( REAL8 )GPS.gpsNanoSeconds ) / 86400.0 + 44244.0;
760
761 /* Check not before the start of GPS time (MJD 44222) */
762 if ( MJDtemp < 44244. ) {
763 fprintf( stderr, "Input time is not in range.\n" );
764 exit( 0 );
765 }
766
767 /* compute the relativistic effect in TDB */
768 Tdiff = MJDtemp + ( 2400000.5 - 2451545.0 );
769 /* meanAnomaly = 357.53 + 0.98560028*Tdiff; */ /* mean anomaly in degrees */
770 /* meanAnomaly *= LAL_PI_180; */ /* mean anomaly in rads */
771 /* dtrel = 0.001658*sin(meanAnomaly) + 0.000014*sin(2.*meanAnomaly); */ /* time diff in seconds */
772 dtrel = 0.0016568 * sin( ( 357.5 + 0.98560028 * Tdiff ) * LAL_PI_180 ) +
773 0.0000224 * sin( ( 246.0 + 0.90251882 * Tdiff ) * LAL_PI_180 ) +
774 0.0000138 * sin( ( 355.0 + 1.97121697 * Tdiff ) * LAL_PI_180 ) +
775 0.0000048 * sin( ( 25.0 + 0.08309103 * Tdiff ) * LAL_PI_180 ) +
776 0.0000047 * sin( ( 230.0 + 0.95215058 * Tdiff ) * LAL_PI_180 );
777
778 /* define interval that is the magical number factor of 32.184 + 19 leap seconds to the */
779 /* start of GPS time plus the TDB-TT correction and add it to the GPS input MJD */
780 /* max absolute value of TDB-TT correction is < 0.184 sec */
781 /* add this to the input GPS time */
782 /* this time is now in TDB but represented as a GPS structure */
783 GPStemp = GPS;
784 XLALGPSAdd( &GPStemp, 51.184 + dtrel );
785
786 /* convert to an MJD structure */
787 MJDtest.days = ( INT4 )floor( ( REAL8 )GPStemp.gpsSeconds / 86400.0 ) + 44244;
788 MJDtest.fracdays = fmod( ( REAL8 )GPStemp.gpsSeconds / 86400.0, 1.0 );
789 AddIntervaltoMJD( GPStemp.gpsNanoSeconds / 1e9, TDBMJD, MJDtest );
790
791} // GPStoTDBMJD()
792
793void
795{
796 REAL8 Tdiff, TDBtoTT;
797 REAL8 MJDtemp;
798 LIGOTimeGPS GPStemp;
799 INT4 tempsec, tempnano;
800
801 /* convert MJD to REAL8 for calculation of the TDB-TT factor which */
802 /* is small enough to allow not using the more accurate MJDtime structure */
803 MJDtemp = ( REAL8 )MJD.days + MJD.fracdays;
804 /* printf("\tMJDtemp = %6.12f\n",MJDtemp); */
805
806 /* Check not before the start of GPS time (MJD 44222) */
807 if ( MJDtemp < 44244. ) {
808 fprintf( stderr, "Input time is not in range.\n" );
809 exit( 0 );
810 }
811
812 Tdiff = MJDtemp + ( 2400000.5 - 2451545.0 );
813 /* meanAnomaly = 357.53 + 0.98560028*Tdiff; */ /* mean anomaly in degrees */
814 /* printf("\tmeanAnomaly (deg) = %6.12f\n",meanAnomaly); */
815 /* meanAnomaly *= LAL_PI_180; */ /* mean anomaly in rads */
816 /* TDBtoTT = 0.001658*sin(meanAnomaly) + 0.000014*sin(2.*meanAnomaly); */ /* time diff in seconds */
817 TDBtoTT = 0.0016568 * sin( ( 357.5 + 0.98560028 * Tdiff ) * LAL_PI_180 ) +
818 0.0000224 * sin( ( 246.0 + 0.90251882 * Tdiff ) * LAL_PI_180 ) +
819 0.0000138 * sin( ( 355.0 + 1.97121697 * Tdiff ) * LAL_PI_180 ) +
820 0.0000048 * sin( ( 25.0 + 0.08309103 * Tdiff ) * LAL_PI_180 ) +
821 0.0000047 * sin( ( 230.0 + 0.95215058 * Tdiff ) * LAL_PI_180 );
822
823 /* printf("\tTdiff = %6.12f meanAnomoly (rads) = %6.12f TDBtoTT = %6.12f\n",Tdiff,meanAnomaly,TDBtoTT); */
824
825 /* convert MJDtime to GPS with no corrections (yet) */
826 tempsec = ( MJD.days - 44244 ) * 86400;
827 /* printf("\ttempsec = %d\n",tempsec); */
828 tempsec += ( INT4 )floor( MJD.fracdays * 86400.0 );
829 /* printf("\ttempsec = %d\n",tempsec); */
830 tempnano = ( INT4 )( 1e9 * ( MJD.fracdays * 86400.0 - ( INT4 )floor( MJD.fracdays * 86400.0 ) ) );
831 /* printf("\ttempnano = %d\n",tempnano); */
832 GPStemp.gpsSeconds = tempsec;
833 GPStemp.gpsNanoSeconds = tempnano;
834
835 /* define interval that is the magical number factor of 32.184 + 19 leap seconds to the */
836 /* start of GPS time plus the TDB-TT correction and minus it from the input MJD */
837 /* max absolute value of TDB-TT correction is < 0.184 sec */
838 *GPS = GPStemp;
839 XLALGPSAdd( GPS, -( 51.184 + TDBtoTT ) );
840
841} // TDBMJDtoGPS()
842
843int
845{
846 /* convert MJD to REAL8 for error checking */
847 REAL8 MJDtemp = ( REAL8 )MJD.days + MJD.fracdays;
848
849 /* Check not before the start of GPS time (MJD 44222) */
850 XLAL_CHECK( MJDtemp >= 44244., XLAL_EDOM, "Input time (%f) is not in range.\n", MJDtemp );
851
852 /* convert MJDtime to GPS with no corrections (yet) */
853 INT4 tempsec = ( MJD.days - 44244 ) * 86400 + leap;
854 tempsec += ( INT4 )floor( MJD.fracdays * 86400.0 );
855 INT4 tempnano = ( INT4 )( 1e9 * ( MJD.fracdays * 86400.0 - ( INT4 )floor( MJD.fracdays * 86400.0 ) ) );
856 GPS->gpsSeconds = tempsec;
857 GPS->gpsNanoSeconds = tempnano;
858
859 return XLAL_SUCCESS;
860
861} // UTCMJDtoGPS()
862
863void
865{
866 LIGOTimeGPS tempGPS;
867
868 /* compute integer MJD days */
869 MJD->days = 44244 + ( INT4 )floor( ( ( REAL8 )GPS->gpsSeconds + 1e-9 * ( REAL8 )GPS->gpsNanoSeconds - ( REAL8 )leap ) / 86400.0 );
870
871 /* compute corresponding exact GPS for this integer days MJD */
872 tempGPS.gpsSeconds = ( MJD->days - 44244 ) * 86400 + leap;
873 tempGPS.gpsNanoSeconds = 0;
874
875 /* compute the difference in fractional MJD days */
876 MJD->fracdays = XLALGPSDiff( GPS, &tempGPS ) / 86400.0;
877} // UTCGPStoMJD()
878
879void
881{
882 MJDTime MJDrough;
883 LIGOTimeGPS GPSguess;
884 double diff;
885
886 /* do rough conversion to MJD */
887 UTCGPStoMJD( &MJDrough, &GPS, leap );
888
889 do {
890
891 /* convert rough MJD guess correctly back to GPS */
892 TDBMJDtoGPS( &GPSguess, MJDrough );
893
894 /* add difference to MJD */
895 diff = XLALGPSDiff( &GPS, &GPSguess );
896 AddIntervaltoMJD( diff, MJD, MJDrough );
897
898 /* update current guess */
899 MJDrough = *MJD;
900
901 } while ( diff >= 2e-9 );
902
903} // TDBGPStoMJD()
void LALCheckMemoryLeaks(void)
#define LALMalloc(n)
const LALVCSInfoList lalPulsarVCSInfoList
NULL-terminated list of VCS and build information for LALPulsar and its dependencies
static double double delta
#define STRING(a)
#define fprintf
#define Hartebeesthoek_LOCATION_Z
#define ARECIBO_LOCATION_X
#define JODRELLM4_LOCATION_X
int main(int argc, char *argv[])
#define GBT_LOCATION_X
#define LA_PALMA_LOCATION_Y
#define GBT_LOCATION_Z
#define DSS_43_LOCATION_X
#define COE_LOCATION_Z
#define VLA_LOCATION_Y
#define GB300_LOCATION_Z
#define PARKES_LOCATION_Y
#define GB853_LOCATION_X
#define NANCAY_LOCATION_Z
#define NANSHAN_LOCATION_X
#define GB140_LOCATION_Z
void AddIntervaltoMJD(double interval, MJDTime *MJDout, MJDTime MJDin)
#define Hobart_LOCATION_Z
void TDBMJDtoGPS(LIGOTimeGPS *GPS, MJDTime MJD)
void GPStoTDBMJD(MJDTime *TDBMJD, LIGOTimeGPS GPS)
#define Hartebeesthoek_LOCATION_Y
#define WSRT_LOCATION_X
#define EFFELSBERG_LOCATION_X
void deltaMJD(MJDTime *deltaMJD, MJDTime *x, MJDTime *y)
int initUserVars(int argc, char *argv[], UserVariables_t *uvar)
register all "user-variables"
#define JODRELLM4_LOCATION_Y
#define DSS_43_LOCATION_Y
#define PARKES_LOCATION_Z
#define COE_LOCATION_X
void UTCGPStoMJD(MJDTime *MJD, LIGOTimeGPS *GPS, INT4 leap)
#define NANCAY_LOCATION_X
#define NANSHAN_LOCATION_Y
#define GB300_LOCATION_Y
#define LA_PALMA_LOCATION_Z
int UTCMJDtoGPS(LIGOTimeGPS *GPS, MJDTime MJD, INT4 leap)
#define COE_LOCATION_Y
void REAL8toMJD(MJDTime *MJD, REAL8 x)
#define NANSHAN_LOCATION_Z
#define NARRABRI_LOCATION_Z
#define PARKES_LOCATION_X
#define JODRELL_LOCATION_Z
#define GB853_LOCATION_Y
#define EFFELSBERG_LOCATION_Z
int vrbflg
defined in lal/lib/std/LALError.c
#define GB300_LOCATION_X
#define NARRABRI_LOCATION_X
void TDBGPStoMJD(MJDTime *MJD, LIGOTimeGPS GPS, INT4 leap)
#define WSRT_LOCATION_Y
#define DSS_43_LOCATION_Z
#define WSRT_LOCATION_Z
#define JODRELL_LOCATION_Y
#define NARRABRI_LOCATION_Y
#define VLA_LOCATION_X
#define GB853_LOCATION_Z
#define EFFELSBERG_LOCATION_Y
#define JODRELLM4_LOCATION_Z
#define GB140_LOCATION_Y
#define VLA_LOCATION_Z
#define NANCAY_LOCATION_Y
#define ARECIBO_LOCATION_Z
#define Hartebeesthoek_LOCATION_X
#define ARECIBO_LOCATION_Y
#define GBT_LOCATION_Y
#define Hobart_LOCATION_X
#define LA_PALMA_LOCATION_X
#define Hobart_LOCATION_Y
#define GB140_LOCATION_X
REAL8 MJDtoREAL8(MJDTime MJD)
#define JODRELL_LOCATION_X
double e
int XLALConvertGPS2SSB(LIGOTimeGPS *SSBout, LIGOTimeGPS GPSin, const PulsarSignalParams *params)
Convert earth-frame GPS time into barycentric-frame SSB time for given source.
int XLALConvertSSB2GPS(LIGOTimeGPS *GPSout, LIGOTimeGPS SSBin, const PulsarSignalParams *params)
Convert barycentric frame SSB time into earth-frame GPS time.
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_PI_180
#define LAL_TWOPI
unsigned char BOOLEAN
double REAL8
#define XLAL_INIT_DECL(var,...)
char CHAR
int32_t INT4
void XLALFree(void *p)
char char * XLALStringDuplicate(const char *s)
COORDINATESYSTEM_EQUATORIAL
int XLALTranslateHMStoRAD(REAL8 *radians, const CHAR *hms)
CHAR * XLALTranslateRADtoHMS(REAL8 radians)
int XLALTranslateDMStoRAD(REAL8 *radians, const CHAR *dms)
CHAR * XLALTranslateRADtoDMS(REAL8 radians)
int XLALUserVarReadAllInput(BOOLEAN *should_exit, int argc, char *argv[], const LALVCSInfoList vcs_list)
void XLALDestroyUserVars(void)
#define XLALRegisterUvarMember(name, type, option, category,...)
int XLALUserVarWasSet(const void *cvar)
int XLALGPSLeapSeconds(INT4 gpssec)
#define xlalErrno
int int int XLALPrintInfo(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
#define XLAL_CHECK(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
XLAL_SUCCESS
XLAL_EFUNC
XLAL_EDOM
XLAL_EINVAL
LIGOTimeGPS * XLALGPSAdd(LIGOTimeGPS *epoch, REAL8 dt)
REAL8 XLALGPSDiff(const LIGOTimeGPS *t1, const LIGOTimeGPS *t0)
list y
gpsSeconds
gpsNanoSeconds
temp
interval
n
double alpha
Basic input structure to LALBarycenter.c.
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
INT4 gpsNanoSeconds
REAL8 fracdays
Input parameters to GeneratePulsarSignal(), defining the source and the time-series.
SkyPosition position
source location (in radians)
const EphemerisData * ephemerides
Earth and Sun ephemerides.
struct PulsarSignalParams::@3 pulsar
const LALDetector * site
detector location and orientation
REAL8 longitude
REAL8 latitude
CoordinateSystem system
user input variables
Definition: compareFstats.c:51
CHAR * ephemSun
Sun ephemeris file to use.
INT4 randSeed
allow user to specify random-number seed for reproducible noise-realizations
CHAR * ephemEarth
Earth ephemeris file to use.
enum @4 site
enum @1 epoch