sofa.h | sofa.h | |||
---|---|---|---|---|
skipping to change at line 14 | skipping to change at line 14 | |||
/* | /* | |||
** - - - - - - - | ** - - - - - - - | |||
** s o f a . h | ** s o f a . h | |||
** - - - - - - - | ** - - - - - - - | |||
** | ** | |||
** Prototype function declarations for SOFA library. | ** Prototype function declarations for SOFA library. | |||
** | ** | |||
** This file is part of the International Astronomical Union's | ** This file is part of the International Astronomical Union's | |||
** SOFA (Standards Of Fundamental Astronomy) software collection. | ** SOFA (Standards Of Fundamental Astronomy) software collection. | |||
** | ** | |||
** This revision: 2012 February 23 | ** This revision: 2013 August 22 | |||
** | ** | |||
** SOFA release 2012-03-01 | ** SOFA release 2013-12-02 | |||
** | ** | |||
** Copyright (C) 2012 IAU SOFA Board. See notes at end. | ** Copyright (C) 2013 IAU SOFA Board. See notes at end. | |||
*/ | */ | |||
#include "sofam.h" | ||||
#include "math.h" | #include "math.h" | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/* Astronomy/Calendars */ | /* Astronomy/Calendars */ | |||
int iauCal2jd(int iy, int im, int id, double *djm0, double *djm); | int iauCal2jd(int iy, int im, int id, double *djm0, double *djm); | |||
double iauEpb(double dj1, double dj2); | double iauEpb(double dj1, double dj2); | |||
void iauEpb2jd(double epb, double *djm0, double *djm); | void iauEpb2jd(double epb, double *djm0, double *djm); | |||
double iauEpj(double dj1, double dj2); | double iauEpj(double dj1, double dj2); | |||
void iauEpj2jd(double epj, double *djm0, double *djm); | void iauEpj2jd(double epj, double *djm0, double *djm); | |||
int iauJd2cal(double dj1, double dj2, | int iauJd2cal(double dj1, double dj2, | |||
int *iy, int *im, int *id, double *fd); | int *iy, int *im, int *id, double *fd); | |||
int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4]); | int iauJdcalf(int ndp, double dj1, double dj2, int iymdf[4]); | |||
/* Astronomy/Astrometry */ | ||||
void iauAb(double pnat[3], double v[3], double s, double bm1, | ||||
double ppr[3]); | ||||
void iauApcg(double date1, double date2, | ||||
double ebpv[2][3], double ehp[3], | ||||
iauASTROM *astrom); | ||||
void iauApcg13(double date1, double date2, iauASTROM *astrom); | ||||
void iauApci(double date1, double date2, | ||||
double ebpv[2][3], double ehp[3], | ||||
double x, double y, double s, | ||||
iauASTROM *astrom); | ||||
void iauApci13(double date1, double date2, | ||||
iauASTROM *astrom, double *eo); | ||||
void iauApco(double date1, double date2, | ||||
double ebpv[2][3], double ehp[3], | ||||
double x, double y, double s, double theta, | ||||
double elong, double phi, double hm, | ||||
double xp, double yp, double sp, | ||||
double refa, double refb, | ||||
iauASTROM *astrom); | ||||
int iauApco13(double utc1, double utc2, double dut1, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double phpa, double tk, double rh, double wl, | ||||
iauASTROM *astrom, double *eo); | ||||
void iauApcs(double date1, double date2, double pv[2][3], | ||||
double ebpv[2][3], double ehp[3], | ||||
iauASTROM *astrom); | ||||
void iauApcs13(double date1, double date2, double pv[2][3], | ||||
iauASTROM *astrom); | ||||
void iauAper(double theta, iauASTROM *astrom); | ||||
void iauAper13(double ut11, double ut12, iauASTROM *astrom); | ||||
void iauApio(double sp, double theta, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double refa, double refb, | ||||
iauASTROM *astrom); | ||||
int iauApio13(double utc1, double utc2, double dut1, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double phpa, double tk, double rh, double wl, | ||||
iauASTROM *astrom); | ||||
void iauAtci13(double rc, double dc, | ||||
double pr, double pd, double px, double rv, | ||||
double date1, double date2, | ||||
double *ri, double *di, double *eo); | ||||
void iauAtciq(double rc, double dc, double pr, double pd, | ||||
double px, double rv, iauASTROM *astrom, | ||||
double *ri, double *di); | ||||
void iauAtciqn(double rc, double dc, double pr, double pd, | ||||
double px, double rv, iauASTROM *astrom, | ||||
int n, iauLDBODY b[], double *ri, double *di); | ||||
void iauAtciqz(double rc, double dc, iauASTROM *astrom, | ||||
double *ri, double *di); | ||||
int iauAtco13(double rc, double dc, | ||||
double pr, double pd, double px, double rv, | ||||
double utc1, double utc2, double dut1, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double phpa, double tk, double rh, double wl, | ||||
double *aob, double *zob, double *hob, | ||||
double *dob, double *rob, double *eo); | ||||
void iauAtic13(double ri, double di, | ||||
double date1, double date2, | ||||
double *rc, double *dc, double *eo); | ||||
void iauAticq(double ri, double di, iauASTROM *astrom, | ||||
double *rc, double *dc); | ||||
void iauAticqn(double ri, double di, iauASTROM *astrom, | ||||
int n, iauLDBODY b[], double *rc, double *dc); | ||||
int iauAtio13(double ri, double di, | ||||
double utc1, double utc2, double dut1, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double phpa, double tk, double rh, double wl, | ||||
double *aob, double *zob, double *hob, | ||||
double *dob, double *rob); | ||||
void iauAtioq(double ri, double di, iauASTROM *astrom, | ||||
double *aob, double *zob, | ||||
double *hob, double *dob, double *rob); | ||||
int iauAtoc13(const char *type, double ob1, double ob2, | ||||
double utc1, double utc2, double dut1, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double phpa, double tk, double rh, double wl, | ||||
double *rc, double *dc); | ||||
int iauAtoi13(const char *type, double ob1, double ob2, | ||||
double utc1, double utc2, double dut1, | ||||
double elong, double phi, double hm, double xp, double yp, | ||||
double phpa, double tk, double rh, double wl, | ||||
double *ri, double *di); | ||||
void iauAtoiq(const char *type, | ||||
double ob1, double ob2, iauASTROM *astrom, | ||||
double *ri, double *di); | ||||
void iauLd(double bm, double p[3], double q[3], double e[3], | ||||
double em, double dlim, double p1[3]); | ||||
void iauLdn(int n, iauLDBODY b[], double ob[3], double sc[3], | ||||
double sn[3]); | ||||
void iauLdsun(double p[3], double e[3], double em, double p1[3]); | ||||
void iauPmpx(double rc, double dc, double pr, double pd, | ||||
double px, double rv, double pmt, double vob[3], | ||||
double pco[3]); | ||||
int iauPmsafe(double ra1, double dec1, double pmr1, double pmd1, | ||||
double px1, double rv1, | ||||
double ep1a, double ep1b, double ep2a, double ep2b, | ||||
double *ra2, double *dec2, double *pmr2, double *pmd2, | ||||
double *px2, double *rv2); | ||||
void iauPvtob(double elong, double phi, double hm, | ||||
double xp, double yp, double sp, double theta, | ||||
double pv[2][3]); | ||||
void iauRefco(double phpa, double tk, double rh, double wl, | ||||
double *refa, double *refb); | ||||
/* Astronomy/Ephemerides */ | /* Astronomy/Ephemerides */ | |||
int iauEpv00(double date1, double date2, | int iauEpv00(double date1, double date2, | |||
double pvh[2][3], double pvb[2][3]); | double pvh[2][3], double pvb[2][3]); | |||
int iauPlan94(double date1, double date2, int np, double pv[2][3]); | int iauPlan94(double date1, double date2, int np, double pv[2][3]); | |||
/* Astronomy/FundamentalArgs */ | /* Astronomy/FundamentalArgs */ | |||
double iauFad03(double t); | double iauFad03(double t); | |||
double iauFae03(double t); | double iauFae03(double t); | |||
double iauFaf03(double t); | double iauFaf03(double t); | |||
double iauFaju03(double t); | double iauFaju03(double t); | |||
skipping to change at line 180 | skipping to change at line 287 | |||
double iauGmst06(double uta, double utb, double tta, double ttb); | double iauGmst06(double uta, double utb, double tta, double ttb); | |||
double iauGmst82(double dj1, double dj2); | double iauGmst82(double dj1, double dj2); | |||
double iauGst00a(double uta, double utb, double tta, double ttb); | double iauGst00a(double uta, double utb, double tta, double ttb); | |||
double iauGst00b(double uta, double utb); | double iauGst00b(double uta, double utb); | |||
double iauGst06(double uta, double utb, double tta, double ttb, | double iauGst06(double uta, double utb, double tta, double ttb, | |||
double rnpb[3][3]); | double rnpb[3][3]); | |||
double iauGst06a(double uta, double utb, double tta, double ttb); | double iauGst06a(double uta, double utb, double tta, double ttb); | |||
double iauGst94(double uta, double utb); | double iauGst94(double uta, double utb); | |||
/* Astronomy/SpaceMotion */ | /* Astronomy/SpaceMotion */ | |||
int iauPmsafe(double ra1, double dec1, double pmr1, double pmd1, | ||||
double px1, double rv1, double ep1a, double ep1b, | ||||
double ep2a, double ep2b, double *ra2, double *dec2, | ||||
double *pmr2, double *pmd2, double *px2, double *rv2); | ||||
int iauPvstar(double pv[2][3], double *ra, double *dec, | int iauPvstar(double pv[2][3], double *ra, double *dec, | |||
double *pmr, double *pmd, double *px, double *rv); | double *pmr, double *pmd, double *px, double *rv); | |||
int iauStarpv(double ra, double dec, | int iauStarpv(double ra, double dec, | |||
double pmr, double pmd, double px, double rv, | double pmr, double pmd, double px, double rv, | |||
double pv[2][3]); | double pv[2][3]); | |||
/* Astronomy/StarCatalogs */ | /* Astronomy/StarCatalogs */ | |||
void iauFk52h(double r5, double d5, | void iauFk52h(double r5, double d5, | |||
double dr5, double dd5, double px5, double rv5, | double dr5, double dd5, double px5, double rv5, | |||
double *rh, double *dh, | double *rh, double *dh, | |||
skipping to change at line 206 | skipping to change at line 317 | |||
double *r5, double *d5, | double *r5, double *d5, | |||
double *dr5, double *dd5, double *px5, double *rv5); | double *dr5, double *dd5, double *px5, double *rv5); | |||
void iauHfk5z(double rh, double dh, double date1, double date2, | void iauHfk5z(double rh, double dh, double date1, double date2, | |||
double *r5, double *d5, double *dr5, double *dd5); | double *r5, double *d5, double *dr5, double *dd5); | |||
int iauStarpm(double ra1, double dec1, | int iauStarpm(double ra1, double dec1, | |||
double pmr1, double pmd1, double px1, double rv1, | double pmr1, double pmd1, double px1, double rv1, | |||
double ep1a, double ep1b, double ep2a, double ep2b, | double ep1a, double ep1b, double ep2a, double ep2b, | |||
double *ra2, double *dec2, | double *ra2, double *dec2, | |||
double *pmr2, double *pmd2, double *px2, double *rv2); | double *pmr2, double *pmd2, double *px2, double *rv2); | |||
/* Astronomy/Geodetic/Geocentric */ | /* Astronomy/GeodeticGeocentric */ | |||
int iauEform(int n, double *a, double *f); | int iauEform(int n, double *a, double *f); | |||
int iauGc2gd(int n, double xyz[3], | int iauGc2gd(int n, double xyz[3], | |||
double *elong, double *phi, double *height); | double *elong, double *phi, double *height); | |||
int iauGc2gde(double a, double f, double xyz[3], | int iauGc2gde(double a, double f, double xyz[3], | |||
double *elong, double *phi, double *height); | double *elong, double *phi, double *height); | |||
int iauGd2gc(int n, double elong, double phi, double height, | int iauGd2gc(int n, double elong, double phi, double height, | |||
double xyz[3]); | double xyz[3]); | |||
int iauGd2gce(double a, double f, | int iauGd2gce(double a, double f, | |||
double elong, double phi, double height, double xyz[3]); | double elong, double phi, double height, double xyz[3]); | |||
void iauPvtob(double elong, double phi, double height, double xp, | ||||
double yp, double sp, double theta, double pv[2][3]); | ||||
/* Astronomy/Timescales */ | /* Astronomy/Timescales */ | |||
int iauD2dtf(const char *scale, int ndp, double d1, double d2, | int iauD2dtf(const char *scale, int ndp, double d1, double d2, | |||
int *iy, int *im, int *id, int ihmsf[4]); | int *iy, int *im, int *id, int ihmsf[4]); | |||
int iauDat(int iy, int im, int id, double fd, double *deltat); | int iauDat(int iy, int im, int id, double fd, double *deltat); | |||
double iauDtdb(double date1, double date2, | double iauDtdb(double date1, double date2, | |||
double ut, double elong, double u, double v); | double ut, double elong, double u, double v); | |||
int iauDtf2d(const char *scale, int iy, int im, int id, | int iauDtf2d(const char *scale, int iy, int im, int id, | |||
int ihr, int imn, double sec, double *d1, double *d2); | int ihr, int imn, double sec, double *d1, double *d2); | |||
int iauTaitt(double tai1, double tai2, double *tt1, double *tt2); | int iauTaitt(double tai1, double tai2, double *tt1, double *tt2); | |||
skipping to change at line 337 | skipping to change at line 450 | |||
void iauSxpv(double s, double pv[2][3], double spv[2][3]); | void iauSxpv(double s, double pv[2][3], double spv[2][3]); | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif | #endif | |||
/*---------------------------------------------------------------------- | /*---------------------------------------------------------------------- | |||
** | ** | |||
** Copyright (C) 2012 | ** Copyright (C) 2013 | |||
** Standards Of Fundamental Astronomy Board | ** Standards Of Fundamental Astronomy Board | |||
** of the International Astronomical Union. | ** of the International Astronomical Union. | |||
** | ** | |||
** ===================== | ** ===================== | |||
** SOFA Software License | ** SOFA Software License | |||
** ===================== | ** ===================== | |||
** | ** | |||
** NOTICE TO USER: | ** NOTICE TO USER: | |||
** | ** | |||
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND | ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND | |||
End of changes. 9 change blocks. | ||||
5 lines changed or deleted | 118 lines changed or added | |||
sofam.h | sofam.h | |||
---|---|---|---|---|
skipping to change at line 16 | skipping to change at line 16 | |||
** s o f a m . h | ** s o f a m . h | |||
** - - - - - - - - | ** - - - - - - - - | |||
** | ** | |||
** Macros used by SOFA library. | ** Macros used by SOFA library. | |||
** | ** | |||
** This file is part of the International Astronomical Union's | ** This file is part of the International Astronomical Union's | |||
** SOFA (Standards Of Fundamental Astronomy) software collection. | ** SOFA (Standards Of Fundamental Astronomy) software collection. | |||
** | ** | |||
** Please note that the constants defined below are to be used only in | ** Please note that the constants defined below are to be used only in | |||
** the context of the SOFA software, and have no other official IAU | ** the context of the SOFA software, and have no other official IAU | |||
** status. | ** status. In addition, self consistency is not guaranteed. | |||
** | ** | |||
** This revision: 2012 February 23 | ** This revision: 2013 August 27 | |||
** | ** | |||
** SOFA release 2012-03-01 | ** SOFA release 2013-12-02 | |||
** | ** | |||
** Copyright (C) 2012 IAU SOFA Board. See notes at end. | ** Copyright (C) 2013 IAU SOFA Board. See notes at end. | |||
*/ | */ | |||
#include "sofa.h" | /* Star-independent astrometry parameters */ | |||
typedef struct { | ||||
double pmt; /* PM time interval (SSB, Julian years) */ | ||||
double eb[3]; /* SSB to observer (vector, au) */ | ||||
double eh[3]; /* Sun to observer (unit vector) */ | ||||
double em; /* distance from Sun to observer (au) */ | ||||
double v[3]; /* barycentric observer velocity (vector, c) */ | ||||
double bm1; /* sqrt(1-|v|^2): reciprocal of Lorenz factor */ | ||||
double bpn[3][3]; /* bias-precession-nutation matrix */ | ||||
double along; /* longitude + s' + dERA(DUT) (radians) */ | ||||
double phi; /* geodetic latitude (radians) */ | ||||
double xpl; /* polar motion xp wrt local meridian (radians) */ | ||||
double ypl; /* polar motion yp wrt local meridian (radians) */ | ||||
double sphi; /* sine of geodetic latitude */ | ||||
double cphi; /* cosine of geodetic latitude */ | ||||
double diurab; /* magnitude of diurnal aberration vector */ | ||||
double eral; /* "local" Earth rotation angle (radians) */ | ||||
double refa; /* refraction constant A (radians) */ | ||||
double refb; /* refraction constant B (radians) */ | ||||
} iauASTROM; | ||||
/* (Vectors eb, eh, em and v are all with respect to BCRS axes.) */ | ||||
/* Body parameters for light deflection */ | ||||
typedef struct { | ||||
double bm; /* mass of the body (solar masses) */ | ||||
double dl; /* deflection limiter (radians^2/2) */ | ||||
double pv[2][3]; /* barycentric PV of the body (au, au/day) */ | ||||
} iauLDBODY; | ||||
/* Pi */ | /* Pi */ | |||
#define DPI (3.141592653589793238462643) | #define DPI (3.141592653589793238462643) | |||
/* 2Pi */ | /* 2Pi */ | |||
#define D2PI (6.283185307179586476925287) | #define D2PI (6.283185307179586476925287) | |||
/* Radians to degrees */ | ||||
#define DR2D (57.29577951308232087679815) | ||||
/* Degrees to radians */ | /* Degrees to radians */ | |||
#define DD2R (1.745329251994329576923691e-2) | #define DD2R (1.745329251994329576923691e-2) | |||
/* Radians to arcseconds */ | /* Radians to arcseconds */ | |||
#define DR2AS (206264.8062470963551564734) | #define DR2AS (206264.8062470963551564734) | |||
/* Arcseconds to radians */ | /* Arcseconds to radians */ | |||
#define DAS2R (4.848136811095359935899141e-6) | #define DAS2R (4.848136811095359935899141e-6) | |||
/* Seconds of time to radians */ | /* Seconds of time to radians */ | |||
skipping to change at line 81 | skipping to change at line 111 | |||
/* Reference epoch (J2000.0), Modified Julian Date */ | /* Reference epoch (J2000.0), Modified Julian Date */ | |||
#define DJM00 (51544.5) | #define DJM00 (51544.5) | |||
/* 1977 Jan 1.0 as MJD */ | /* 1977 Jan 1.0 as MJD */ | |||
#define DJM77 (43144.0) | #define DJM77 (43144.0) | |||
/* TT minus TAI (s) */ | /* TT minus TAI (s) */ | |||
#define TTMTAI (32.184) | #define TTMTAI (32.184) | |||
/* AU (m) */ | /* Astronomical unit (m) */ | |||
#define DAU (149597870e3) | #define DAU (149597870e3) | |||
/* Speed of light (m/s) */ | ||||
#define CMPS 299792458.0 | ||||
/* Light time for 1 au (s) */ | ||||
#define AULT 499.004782 | ||||
/* Speed of light (AU per day) */ | /* Speed of light (AU per day) */ | |||
#define DC (DAYSEC / 499.004782) | #define DC (DAYSEC / AULT) | |||
/* L_G = 1 - d(TT)/d(TCG) */ | /* L_G = 1 - d(TT)/d(TCG) */ | |||
#define ELG (6.969290134e-10) | #define ELG (6.969290134e-10) | |||
/* L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0 */ | /* L_B = 1 - d(TDB)/d(TCB), and TDB (s) at TAI 1977/1/1.0 */ | |||
#define ELB (1.550519768e-8) | #define ELB (1.550519768e-8) | |||
#define TDB0 (-6.55e-5) | #define TDB0 (-6.55e-5) | |||
/* Schwarzschild radius of the Sun (au) */ | ||||
/* = 2 * 1.32712440041e20 / (2.99792458e8)^2 / 1.49597870700e11 */ | ||||
#define SRS 1.97412574336e-8 | ||||
/* dint(A) - truncate to nearest whole number towards zero (double) */ | /* dint(A) - truncate to nearest whole number towards zero (double) */ | |||
#define dint(A) ((A)<0.0?ceil(A):floor(A)) | #define dint(A) ((A)<0.0?ceil(A):floor(A)) | |||
/* dnint(A) - round to nearest whole number (double) */ | /* dnint(A) - round to nearest whole number (double) */ | |||
#define dnint(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5)) | #define dnint(A) ((A)<0.0?ceil((A)-0.5):floor((A)+0.5)) | |||
/* dsign(A,B) - magnitude of A with sign of B (double) */ | /* dsign(A,B) - magnitude of A with sign of B (double) */ | |||
#define dsign(A,B) ((B)<0.0?-fabs(A):fabs(A)) | #define dsign(A,B) ((B)<0.0?-fabs(A):fabs(A)) | |||
/* max(A,B) - larger (most +ve) of two numbers (generic) */ | ||||
#define gmax(A,B) (((A)>(B))?(A):(B)) | ||||
/* min(A,B) - smaller (least +ve) of two numbers (generic) */ | ||||
#define gmin(A,B) (((A)<(B))?(A):(B)) | ||||
/* Reference ellipsoids */ | /* Reference ellipsoids */ | |||
#define WGS84 1 | #define WGS84 1 | |||
#define GRS80 2 | #define GRS80 2 | |||
#define WGS72 3 | #define WGS72 3 | |||
#endif | #endif | |||
/*---------------------------------------------------------------------- | /*---------------------------------------------------------------------- | |||
** | ** | |||
** Copyright (C) 2012 | ** Copyright (C) 2013 | |||
** Standards Of Fundamental Astronomy Board | ** Standards Of Fundamental Astronomy Board | |||
** of the International Astronomical Union. | ** of the International Astronomical Union. | |||
** | ** | |||
** ===================== | ** ===================== | |||
** SOFA Software License | ** SOFA Software License | |||
** ===================== | ** ===================== | |||
** | ** | |||
** NOTICE TO USER: | ** NOTICE TO USER: | |||
** | ** | |||
** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND | ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND | |||
End of changes. 12 change blocks. | ||||
8 lines changed or deleted | 54 lines changed or added | |||