20 #include <lal/Velocity.h>
39 REAL8 pos1[3], pos2[3];
79 for (
n = 0;
n < 3;
n++ ) {
80 v[
n] = ( pos2[
n] - pos1[
n] ) / tBase;
100 REAL8 trapSum[3], average[3], tempVel[3];
101 REAL8 tBase, vTol, rTol, oldVeloMod, newVeloMod;
145 for (
n = 0;
n < 3;
n++ ) {
146 trapSum[
n] = 0.5 * tempVel[
n];
154 for (
n = 0;
n < 3;
n++ ) {
155 trapSum[
n] += 0.5 * tempVel[
n];
156 average[
n] = trapSum[
n];
163 for (
k = 1;
k < points;
k += 2 ) {
164 t =
t0 + 1.0 *
k * tBase / ( 1.0 * points );
167 for (
n = 0;
n < 3;
n++ ) {
168 trapSum[
n] += tempVel[
n];
171 oldVeloMod = newVeloMod = 0.0;
172 for (
n = 0;
n < 3;
n++ ) {
173 oldVeloMod += average[
n] * average[
n];
174 average[
n] = trapSum[
n] / ( 1.0 * points );
175 newVeloMod += average[
n] * average[
n];
180 rTol = fabs( ( sqrt( oldVeloMod ) - sqrt( newVeloMod ) ) ) / ( sqrt( oldVeloMod ) );
181 }
while ( rTol > vTol );
184 for (
n = 0;
n < 3;
n++ ) {
229 baryinput.
tgps = *time0;
230 baryinput.
dInv = 0.0;
236 baryinput.
alpha = 0.0;
237 baryinput.
delta = 0.0;
244 for (
i = 0;
i < 3;
i++ ) {
287 baryinput.
tgps = *time0;
294 baryinput.
alpha = 0.0;
295 baryinput.
delta = 0.0;
302 for (
i = 0;
i < 3;
i++ ) {
#define XLAL_CHECK_LAL(sp, assertion,...)
#define TRY(func, statusptr)
#define ATTATCHSTATUSPTR(statusptr)
#define ASSERT(assertion, statusptr, code, mesg)
#define DETATCHSTATUSPTR(statusptr)
#define INITSTATUS(statusptr)
#define RETURN(statusptr)
int XLALBarycenterEarth(EarthState *earth, const LIGOTimeGPS *tGPS, const EphemerisData *edat)
Computes the position and orientation of the Earth, at some arrival time , specified LIGOTimeGPS inp...
int XLALBarycenter(EmissionTime *emit, const BarycenterInput *baryinput, const EarthState *earth)
Transforms from detector arrival time in GPS (as specified in the LIGOTimeGPS structure) to pulse em...
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.
#define VELOCITYH_MSGEVAL
#define VELOCITYH_MSGENULL
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...
LIGOTimeGPS * XLALGPSSetREAL8(LIGOTimeGPS *epoch, REAL8 t)
Basic output structure of LALBarycenterEarth.c.
Basic output structure produced by LALBarycenter.c.
REAL8 rDetector[3]
Cartesian coords (0=x,1=y,2=z) of detector position at $t_a$ (GPS), in ICRS J2000 coords.
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)