21 #include <lal/LALConstants.h>
22 #include <lal/LALDatatypes.h>
23 #include <lal/LALDetectors.h>
25 #include <lal/TimeDelay.h>
26 #include <lal/XLALError.h>
30 static double dotprod(
const double vec1[3],
const double vec2[3])
32 return vec1[0] * vec2[0] + vec1[1] * vec2[1] + vec1[2] * vec2[2];
38 const double detector1_earthfixed_xyz_metres[3],
39 const double detector2_earthfixed_xyz_metres[3],
40 const double source_right_ascension_radians,
41 const double source_declination_radians,
57 ehat_src[0] = cos(source_declination_radians) * cos(greenwich_hour_angle);
58 ehat_src[1] = cos(source_declination_radians) * -sin(greenwich_hour_angle);
59 ehat_src[2] = sin(source_declination_radians);
65 delta_xyz[0] = detector2_earthfixed_xyz_metres[0] - detector1_earthfixed_xyz_metres[0];
66 delta_xyz[1] = detector2_earthfixed_xyz_metres[1] - detector1_earthfixed_xyz_metres[1];
67 delta_xyz[2] = detector2_earthfixed_xyz_metres[2] - detector1_earthfixed_xyz_metres[2];
84 const double detector_earthfixed_xyz_metres[3],
85 double source_right_ascension_radians,
86 double source_declination_radians,
90 static const double earth_center[3] = {0.0, 0.0, 0.0};
97 return XLALArrivalTimeDiff(detector_earthfixed_xyz_metres, earth_center, source_right_ascension_radians, source_declination_radians, gpstime);
static double dotprod(const double vec1[3], const double vec2[3])
#define LAL_C_SI
Speed of light in vacuum, m s^-1.
int64_t INT8
Eight-byte signed integer; on some platforms this is equivalent to long int instead.
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.
double XLALArrivalTimeDiff(const double detector1_earthfixed_xyz_metres[3], const double detector2_earthfixed_xyz_metres[3], const double source_right_ascension_radians, const double source_declination_radians, const LIGOTimeGPS *gpstime)
UNDOCUMENTED.
INT8 XLALLightTravelTime(const LALDetector *aDet, const LALDetector *bDet)
Compute the light travel time between two detectors and returns the answer in INT8 nanoseconds.
#define XLAL_ERROR_REAL8(...)
Macro to invoke a failure from a XLAL routine returning a REAL8.
#define XLAL_IS_REAL8_FAIL_NAN(val)
Tests if val is a XLAL REAL8 failure NaN.
@ XLAL_EFUNC
Internal function call failed bit: "or" this with existing error number.
REAL8 XLALGreenwichMeanSiderealTime(const LIGOTimeGPS *gpstime)
Convenience wrapper, calling XLALGreenwichSiderealTime() with the equation of equinoxes set to 0.
REAL8 location[3]
The three components, in an Earth-fixed Cartesian coordinate system, of the position vector from the ...
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.