22 #include <lal/LALStdlib.h> 23 #include <lal/LALConstants.h> 26 #include <lal/SkyCoordinates.h> 29 #define LAL_EARTHFLAT (0.00335281) 30 #define LAL_HSERIES (0.0001) 31 #define LAL_BSERIES (0.001) 421 REAL8 sina, sinA, cosA;
449 sina = sinD*sinP + cosD*cosP*cosH;
451 cosA = sinD*cosP - cosD*sinP*cosH;
476 REAL8 sinD, sinH, cosH;
503 sinD = sina*sinP + cosa*cosA*cosP;
505 cosH = sina*cosP - cosa*cosA*sinP;
545 c = sqrt( 1.0 / ( cosP*cosP + fFac*sinP*sinP ) );
564 r = sqrt( x*x + y*y + s*s );
593 x = rInv*location->
x;
594 y = rInv*location->
y;
595 z = rInv*location->
z;
596 pi = sqrt( x*x + y*y );
613 REAL8 za, e,
f,
p, p3,
q, q2, d, d2,
b,
v, w, g, h, gh,
t, phi, tanP;
629 p = ( 4.0/3.0 )*( pi*pi + za*za - f2*f2 );
642 v = pow( d2 + q, 1.0/3.0 )
643 + pow( -0.5*q*h*( 1.0 - 0.25*h*( 1.0 - 0.5*h ) ), 1.0/3.0 );
645 v = pow( d2 + q, 1.0/3.0 )
646 - pow( 0.5*q*h*( 1.0 - 0.25*h*( 1.0 - 0.5*h ) ), 1.0/3.0 );
648 v = pow( d2, 1.0/3.0 )*( b*( 2.0/3.0 + b*b*10.0/81.0 ) );
649 }
else if ( b < 1.0 ) {
650 v = pow( d2, 1.0/3.0 )*( pow( 1.0 + b, 1.0/3.0 ) -
651 pow( 1.0 - b, 1.0/3.0 ) );
653 v = pow( d2, 1.0/3.0 )*( pow( b + 1.0, 1.0/3.0 ) +
654 pow( b - 1.0, 1.0/3.0 ) );
657 v = 2.0*sqrt( -p )*cos( acos( q/( -p*sqrt( -p ) ) )/3.0 );
662 w = fabs( e )*sqrt( 1.0 + h );
666 g = -0.25*e*h*( 1.0 - 0.25*h*( 1.0 - 0.5*h ) );
667 gh = fabs( pi*( f*pi - v*g )/w );
670 t = g*( sqrt( 1.0 + h ) - 1.0 );
672 t = 0.5*g*h*( 1.0 - 0.25*h*( 1.0 - 0.5*h ) );
675 tanP = ( pi -
t )*( pi + t )/( 2.0*f1*pi*
t );
680 location->
elevation = ( pi - t/pi )*cos( phi );
681 location->
elevation += ( fabs( z ) - f1 )*sin( phi );
void LALGeodeticToGeocentric(LALStatus *stat, EarthPosition *location)
Epoch relative to GPS epoch, see LIGOTimeGPS type for more details.
void LALEquatorialToGeographic(LALStatus *stat, SkyPosition *output, SkyPosition *input, LIGOTimeGPS *gpsTime)
REAL8 XLALGreenwichMeanSiderealTime(const LIGOTimeGPS *gpstime)
Convenience wrapper, calling XLALGreenwichSiderealTime() with the equation of equinoxes set to 0...
REAL8 radius
The distance of the point from the geocentre, in metres.
The sky-fixed equatorial coordinate system.
REAL8 elevation
The vertical distance of the point above the reference ellipsoid, in metres.
REAL8 latitude
The latitudinal coordinate (in radians), as defined above.
#define SKYCOORDINATESH_ESYS
Wrong coordinate system in input.
SkyPosition geocentric
The geographic coordinates of the direction from the centre of the Earth through the point; that is...
This structure stores the two spherical coordinates of a sky position; ie a generic latitude and long...
CoordinateSystem system
The coordinate system in which latitude/longitude are expressed.
void LALGeographicToEquatorial(LALStatus *stat, SkyPosition *output, SkyPosition *input, LIGOTimeGPS *gpsTime)
void LALGeocentricToGeodetic(LALStatus *stat, EarthPosition *location)
static double f(double theta, double y, double xi)
#define RETURN(statusptr)
#define INITSTATUS(statusptr)
The Earth-fixed geographic coordinate system.
double REAL8
Double precision real floating-point number (8 bytes).
#define ABORT(statusptr, code, mesg)
A horizon coordinate system.
LAL status structure, see The LALStatus structure for more details.
#define LAL_REARTH_SI
Earth equatorial radius, m.
void LALHorizonToSystem(LALStatus *stat, SkyPosition *output, SkyPosition *input, const SkyPosition *zenith)
REAL8 longitude
The longitudinal coordinate (in radians), as defined above.
This structure stores the location of a point on (or near) the surface of the Earth in both geodetic ...
#define SKYCOORDINATESH_ENUL
Unexpected null pointer in arguments.
SkyPosition geodetic
The geographic coordinates of the upward vertical direction from the point; that is, the point's geodetic latitude and longitude.
REAL8 z
The Earth-fixed geocentric Cartesian coordinates of the point, in metres.
void LALSystemToHorizon(LALStatus *stat, SkyPosition *output, SkyPosition *input, const SkyPosition *zenith)
#define ASSERT(assertion, statusptr, code, mesg)
#define LAL_TWOPI
2*pi is circumference of a circle divided by its radius