76#include <lal/Velocity.h>
81#define TESTVELOCITYC_ENORM 0
82#define TESTVELOCITYC_ESUB 1
83#define TESTVELOCITYC_EARG 2
84#define TESTVELOCITYC_EBAD 3
85#define TESTVELOCITYC_EFILE 4
87#define TESTVELOCITYC_MSGENORM "Normal exit"
88#define TESTVELOCITYC_MSGESUB "Subroutine failed"
89#define TESTVELOCITYC_MSGEARG "Error parsing arguments"
90#define TESTVELOCITYC_MSGEBAD "Bad argument values"
91#define TESTVELOCITYC_MSGEFILE "Could not create output file"
100#define T0SEC 730000044
107#define EARTHDATAFILE TEST_PKG_DATA_DIR "earth00-40-DE405.dat.gz";
108#define SUNDATAFILE TEST_PKG_DATA_DIR "sun00-40-DE405.dat.gz";
110char EARTHDATA[] = EARTHDATAFILE;
111char SUNDATA[] = SUNDATAFILE;
114#define USAGE "Usage: %s [-d debuglevel] [-a accuracy]\n"
120#define ERROR( code, msg, statement ) \
122 if ( lalDebugLevel & LALERROR ) \
123 XLALPrintError( "Error[0] %d: program %s, file %s, line %d, %s\n" \
124 " %s %s\n", (code), *argv, __FILE__, \
125 __LINE__, "$Id$", statement ? statement : \
129#define INFO( statement ) \
131 if ( lalDebugLevel & LALINFO ) \
132 XLALPrintError( "Info[0]: program %s, file %s, line %d, %s\n" \
133 " %s\n", *argv, __FILE__, __LINE__, \
134 "$Id$", (statement) ); \
137#define SUB( func, statusptr ) \
139 if ( (func), (statusptr)->statusCode ) { \
140 ERROR( TESTVELOCITYC_ESUB, TESTVELOCITYC_MSGESUB, \
141 "Function call \"" #func "\" failed:" ); \
142 return TESTVELOCITYC_ESUB; \
149int main(
int argc,
char *argv[] )
169 velPar.
tBase = TBASE;
176 while ( arg < argc ) {
178 if ( !strcmp( argv[arg],
"-d" ) ) {
179 if ( argc > arg + 1 ) {
188 else if ( !strcmp( argv[arg],
"-a" ) ) {
189 if ( argc > arg + 1 ) {
191 vTol = atof( argv[arg++] );
221 printf(
"Detector velocity at %d = %g, %g, %g \n", T0SEC, vel[0], vel[1], vel[2] );
225 printf(
"Detector position at %d = %g, %g, %g \n", T0SEC, vel[0], vel[1], vel[2] );
229 printf(
"Avg. detector velocity in a interval of %g from %d = %g, %g, %g \n", TBASE, T0SEC, vel[0], vel[1], vel[2] );
233 printf(
"Avg. detector position in a interval of %g from %d = %g, %g, %g \n", TBASE, T0SEC,
pos[0],
pos[1],
pos[2] );
LALDetectorIndexGEO600DIFF
#define SUB(func, statusptr)
#define ERROR(code, msg, statement)
void LALCheckMemoryLeaks(void)
#define TESTVELOCITYC_EARG
#define TESTVELOCITYC_ENORM
#define TESTVELOCITYC_MSGEARG
int main(int argc, char **argv)
const LALDetector lalCachedDetectors[LAL_NUM_DETECTORS]
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.
void LALDetectorVel(LALStatus *status, REAL8 v[3], LIGOTimeGPS *time0, LALDetector detector, EphemerisData *edat)
This function finds the velocity of a given detector at a given time.
void LALDetectorPos(LALStatus *status, REAL8 x[3], LIGOTimeGPS *time0, LALDetector detector, EphemerisData *edat)
This finds velocity of a given detector at a given time.
void LALAvgDetectorVel(LALStatus *status, REAL8 v[3], VelocityPar *in)
This function outputs the average velocity REAL8 v[3] of the detector during a time interval.
void LALAvgDetectorPos(LALStatus *status, REAL8 x[3], VelocityPar *in)
Given a detector and a time interval, this function outputs the average position of the detector duri...
#define XLAL_CHECK_MAIN(assertion,...)
int XLALPrintError(const char *fmt,...) _LAL_GCC_PRINTF_FORMAT_(1
This structure contains all information about the center-of-mass positions of the Earth and Sun,...
This structure stores the parameters required by XLALBarycenter() to calculate Earth velocity at a gi...
EphemerisData * edat
ephemeris data pointer from XLALInitBarycenter()
LALDetector detector
the detector
REAL8 tBase
duration of interval
LIGOTimeGPS startTime
start of time interval
REAL8 vTol
fractional accuracy required for velocity (redundant for average velocity calculation)