source: trunk/FACT++/erfa/src/erfa.h@ 18403

Last change on this file since 18403 was 18348, checked in by tbretz, 9 years ago
File size: 22.6 KB
Line 
1#ifndef ERFAHDEF
2#define ERFAHDEF
3
4/*
5** - - - - - - -
6** e r f a . h
7** - - - - - - -
8**
9** Prototype function declarations for ERFA library.
10**
11** Copyright (C) 2013-2015, NumFOCUS Foundation.
12** Derived, with permission, from the SOFA library. See notes at end of file.
13*/
14
15#include "erfam.h"
16#include "math.h"
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22/* Astronomy/Calendars */
23int eraCal2jd(int iy, int im, int id, double *djm0, double *djm);
24double eraEpb(double dj1, double dj2);
25void eraEpb2jd(double epb, double *djm0, double *djm);
26double eraEpj(double dj1, double dj2);
27void eraEpj2jd(double epj, double *djm0, double *djm);
28int eraJd2cal(double dj1, double dj2,
29 int *iy, int *im, int *id, double *fd);
30int eraJdcalf(int ndp, double dj1, double dj2, int iymdf[4]);
31
32/* Astronomy/Astrometry */
33void eraAb(double pnat[3], double v[3], double s, double bm1,
34 double ppr[3]);
35void eraApcg(double date1, double date2,
36 double ebpv[2][3], double ehp[3],
37 eraASTROM *astrom);
38void eraApcg13(double date1, double date2, eraASTROM *astrom);
39void eraApci(double date1, double date2,
40 double ebpv[2][3], double ehp[3],
41 double x, double y, double s,
42 eraASTROM *astrom);
43void eraApci13(double date1, double date2,
44 eraASTROM *astrom, double *eo);
45void eraApco(double date1, double date2,
46 double ebpv[2][3], double ehp[3],
47 double x, double y, double s, double theta,
48 double elong, double phi, double hm,
49 double xp, double yp, double sp,
50 double refa, double refb,
51 eraASTROM *astrom);
52int eraApco13(double utc1, double utc2, double dut1,
53 double elong, double phi, double hm, double xp, double yp,
54 double phpa, double tc, double rh, double wl,
55 eraASTROM *astrom, double *eo);
56void eraApcs(double date1, double date2, double pv[2][3],
57 double ebpv[2][3], double ehp[3],
58 eraASTROM *astrom);
59void eraApcs13(double date1, double date2, double pv[2][3],
60 eraASTROM *astrom);
61void eraAper(double theta, eraASTROM *astrom);
62void eraAper13(double ut11, double ut12, eraASTROM *astrom);
63void eraApio(double sp, double theta,
64 double elong, double phi, double hm, double xp, double yp,
65 double refa, double refb,
66 eraASTROM *astrom);
67int eraApio13(double utc1, double utc2, double dut1,
68 double elong, double phi, double hm, double xp, double yp,
69 double phpa, double tc, double rh, double wl,
70 eraASTROM *astrom);
71void eraAtci13(double rc, double dc,
72 double pr, double pd, double px, double rv,
73 double date1, double date2,
74 double *ri, double *di, double *eo);
75void eraAtciq(double rc, double dc, double pr, double pd,
76 double px, double rv, eraASTROM *astrom,
77 double *ri, double *di);
78void eraAtciqn(double rc, double dc, double pr, double pd,
79 double px, double rv, eraASTROM *astrom,
80 int n, eraLDBODY b[], double *ri, double *di);
81void eraAtciqz(double rc, double dc, eraASTROM *astrom,
82 double *ri, double *di);
83int eraAtco13(double rc, double dc,
84 double pr, double pd, double px, double rv,
85 double utc1, double utc2, double dut1,
86 double elong, double phi, double hm, double xp, double yp,
87 double phpa, double tc, double rh, double wl,
88 double *aob, double *zob, double *hob,
89 double *dob, double *rob, double *eo);
90void eraAtic13(double ri, double di,
91 double date1, double date2,
92 double *rc, double *dc, double *eo);
93void eraAticq(double ri, double di, eraASTROM *astrom,
94 double *rc, double *dc);
95void eraAticqn(double ri, double di, eraASTROM *astrom,
96 int n, eraLDBODY b[], double *rc, double *dc);
97int eraAtio13(double ri, double di,
98 double utc1, double utc2, double dut1,
99 double elong, double phi, double hm, double xp, double yp,
100 double phpa, double tc, double rh, double wl,
101 double *aob, double *zob, double *hob,
102 double *dob, double *rob);
103void eraAtioq(double ri, double di, eraASTROM *astrom,
104 double *aob, double *zob,
105 double *hob, double *dob, double *rob);
106int eraAtoc13(const char *type, double ob1, double ob2,
107 double utc1, double utc2, double dut1,
108 double elong, double phi, double hm, double xp, double yp,
109 double phpa, double tc, double rh, double wl,
110 double *rc, double *dc);
111int eraAtoi13(const char *type, double ob1, double ob2,
112 double utc1, double utc2, double dut1,
113 double elong, double phi, double hm, double xp, double yp,
114 double phpa, double tc, double rh, double wl,
115 double *ri, double *di);
116void eraAtoiq(const char *type,
117 double ob1, double ob2, eraASTROM *astrom,
118 double *ri, double *di);
119void eraLd(double bm, double p[3], double q[3], double e[3],
120 double em, double dlim, double p1[3]);
121void eraLdn(int n, eraLDBODY b[], double ob[3], double sc[3],
122 double sn[3]);
123void eraLdsun(double p[3], double e[3], double em, double p1[3]);
124void eraPmpx(double rc, double dc, double pr, double pd,
125 double px, double rv, double pmt, double pob[3],
126 double pco[3]);
127int eraPmsafe(double ra1, double dec1, double pmr1, double pmd1,
128 double px1, double rv1,
129 double ep1a, double ep1b, double ep2a, double ep2b,
130 double *ra2, double *dec2, double *pmr2, double *pmd2,
131 double *px2, double *rv2);
132void eraPvtob(double elong, double phi, double height, double xp,
133 double yp, double sp, double theta, double pv[2][3]);
134void eraRefco(double phpa, double tc, double rh, double wl,
135 double *refa, double *refb);
136
137/* Astronomy/Ephemerides */
138int eraEpv00(double date1, double date2,
139 double pvh[2][3], double pvb[2][3]);
140int eraPlan94(double date1, double date2, int np, double pv[2][3]);
141
142/* Astronomy/FundamentalArgs */
143double eraFad03(double t);
144double eraFae03(double t);
145double eraFaf03(double t);
146double eraFaju03(double t);
147double eraFal03(double t);
148double eraFalp03(double t);
149double eraFama03(double t);
150double eraFame03(double t);
151double eraFane03(double t);
152double eraFaom03(double t);
153double eraFapa03(double t);
154double eraFasa03(double t);
155double eraFaur03(double t);
156double eraFave03(double t);
157
158/* Astronomy/PrecNutPolar */
159void eraBi00(double *dpsibi, double *depsbi, double *dra);
160void eraBp00(double date1, double date2,
161 double rb[3][3], double rp[3][3], double rbp[3][3]);
162void eraBp06(double date1, double date2,
163 double rb[3][3], double rp[3][3], double rbp[3][3]);
164void eraBpn2xy(double rbpn[3][3], double *x, double *y);
165void eraC2i00a(double date1, double date2, double rc2i[3][3]);
166void eraC2i00b(double date1, double date2, double rc2i[3][3]);
167void eraC2i06a(double date1, double date2, double rc2i[3][3]);
168void eraC2ibpn(double date1, double date2, double rbpn[3][3],
169 double rc2i[3][3]);
170void eraC2ixy(double date1, double date2, double x, double y,
171 double rc2i[3][3]);
172void eraC2ixys(double x, double y, double s, double rc2i[3][3]);
173void eraC2t00a(double tta, double ttb, double uta, double utb,
174 double xp, double yp, double rc2t[3][3]);
175void eraC2t00b(double tta, double ttb, double uta, double utb,
176 double xp, double yp, double rc2t[3][3]);
177void eraC2t06a(double tta, double ttb, double uta, double utb,
178 double xp, double yp, double rc2t[3][3]);
179void eraC2tcio(double rc2i[3][3], double era, double rpom[3][3],
180 double rc2t[3][3]);
181void eraC2teqx(double rbpn[3][3], double gst, double rpom[3][3],
182 double rc2t[3][3]);
183void eraC2tpe(double tta, double ttb, double uta, double utb,
184 double dpsi, double deps, double xp, double yp,
185 double rc2t[3][3]);
186void eraC2txy(double tta, double ttb, double uta, double utb,
187 double x, double y, double xp, double yp,
188 double rc2t[3][3]);
189double eraEo06a(double date1, double date2);
190double eraEors(double rnpb[3][3], double s);
191void eraFw2m(double gamb, double phib, double psi, double eps,
192 double r[3][3]);
193void eraFw2xy(double gamb, double phib, double psi, double eps,
194 double *x, double *y);
195void eraNum00a(double date1, double date2, double rmatn[3][3]);
196void eraNum00b(double date1, double date2, double rmatn[3][3]);
197void eraNum06a(double date1, double date2, double rmatn[3][3]);
198void eraNumat(double epsa, double dpsi, double deps, double rmatn[3][3]);
199void eraNut00a(double date1, double date2, double *dpsi, double *deps);
200void eraNut00b(double date1, double date2, double *dpsi, double *deps);
201void eraNut06a(double date1, double date2, double *dpsi, double *deps);
202void eraNut80(double date1, double date2, double *dpsi, double *deps);
203void eraNutm80(double date1, double date2, double rmatn[3][3]);
204double eraObl06(double date1, double date2);
205double eraObl80(double date1, double date2);
206void eraP06e(double date1, double date2,
207 double *eps0, double *psia, double *oma, double *bpa,
208 double *bqa, double *pia, double *bpia,
209 double *epsa, double *chia, double *za, double *zetaa,
210 double *thetaa, double *pa,
211 double *gam, double *phi, double *psi);
212void eraPb06(double date1, double date2,
213 double *bzeta, double *bz, double *btheta);
214void eraPfw06(double date1, double date2,
215 double *gamb, double *phib, double *psib, double *epsa);
216void eraPmat00(double date1, double date2, double rbp[3][3]);
217void eraPmat06(double date1, double date2, double rbp[3][3]);
218void eraPmat76(double date1, double date2, double rmatp[3][3]);
219void eraPn00(double date1, double date2, double dpsi, double deps,
220 double *epsa,
221 double rb[3][3], double rp[3][3], double rbp[3][3],
222 double rn[3][3], double rbpn[3][3]);
223void eraPn00a(double date1, double date2,
224 double *dpsi, double *deps, double *epsa,
225 double rb[3][3], double rp[3][3], double rbp[3][3],
226 double rn[3][3], double rbpn[3][3]);
227void eraPn00b(double date1, double date2,
228 double *dpsi, double *deps, double *epsa,
229 double rb[3][3], double rp[3][3], double rbp[3][3],
230 double rn[3][3], double rbpn[3][3]);
231void eraPn06(double date1, double date2, double dpsi, double deps,
232 double *epsa,
233 double rb[3][3], double rp[3][3], double rbp[3][3],
234 double rn[3][3], double rbpn[3][3]);
235void eraPn06a(double date1, double date2,
236 double *dpsi, double *deps, double *epsa,
237 double rb[3][3], double rp[3][3], double rbp[3][3],
238 double rn[3][3], double rbpn[3][3]);
239void eraPnm00a(double date1, double date2, double rbpn[3][3]);
240void eraPnm00b(double date1, double date2, double rbpn[3][3]);
241void eraPnm06a(double date1, double date2, double rnpb[3][3]);
242void eraPnm80(double date1, double date2, double rmatpn[3][3]);
243void eraPom00(double xp, double yp, double sp, double rpom[3][3]);
244void eraPr00(double date1, double date2,
245 double *dpsipr, double *depspr);
246void eraPrec76(double date01, double date02,
247 double date11, double date12,
248 double *zeta, double *z, double *theta);
249double eraS00(double date1, double date2, double x, double y);
250double eraS00a(double date1, double date2);
251double eraS00b(double date1, double date2);
252double eraS06(double date1, double date2, double x, double y);
253double eraS06a(double date1, double date2);
254double eraSp00(double date1, double date2);
255void eraXy06(double date1, double date2, double *x, double *y);
256void eraXys00a(double date1, double date2,
257 double *x, double *y, double *s);
258void eraXys00b(double date1, double date2,
259 double *x, double *y, double *s);
260void eraXys06a(double date1, double date2,
261 double *x, double *y, double *s);
262
263/* Astronomy/RotationAndTime */
264double eraEe00(double date1, double date2, double epsa, double dpsi);
265double eraEe00a(double date1, double date2);
266double eraEe00b(double date1, double date2);
267double eraEe06a(double date1, double date2);
268double eraEect00(double date1, double date2);
269double eraEqeq94(double date1, double date2);
270double eraEra00(double dj1, double dj2);
271double eraGmst00(double uta, double utb, double tta, double ttb);
272double eraGmst06(double uta, double utb, double tta, double ttb);
273double eraGmst82(double dj1, double dj2);
274double eraGst00a(double uta, double utb, double tta, double ttb);
275double eraGst00b(double uta, double utb);
276double eraGst06(double uta, double utb, double tta, double ttb,
277 double rnpb[3][3]);
278double eraGst06a(double uta, double utb, double tta, double ttb);
279double eraGst94(double uta, double utb);
280
281/* Astronomy/SpaceMotion */
282int eraPvstar(double pv[2][3], double *ra, double *dec,
283 double *pmr, double *pmd, double *px, double *rv);
284int eraStarpv(double ra, double dec,
285 double pmr, double pmd, double px, double rv,
286 double pv[2][3]);
287
288/* Astronomy/StarCatalogs */
289void eraFk52h(double r5, double d5,
290 double dr5, double dd5, double px5, double rv5,
291 double *rh, double *dh,
292 double *drh, double *ddh, double *pxh, double *rvh);
293void eraFk5hip(double r5h[3][3], double s5h[3]);
294void eraFk5hz(double r5, double d5, double date1, double date2,
295 double *rh, double *dh);
296void eraH2fk5(double rh, double dh,
297 double drh, double ddh, double pxh, double rvh,
298 double *r5, double *d5,
299 double *dr5, double *dd5, double *px5, double *rv5);
300void eraHfk5z(double rh, double dh, double date1, double date2,
301 double *r5, double *d5, double *dr5, double *dd5);
302int eraStarpm(double ra1, double dec1,
303 double pmr1, double pmd1, double px1, double rv1,
304 double ep1a, double ep1b, double ep2a, double ep2b,
305 double *ra2, double *dec2,
306 double *pmr2, double *pmd2, double *px2, double *rv2);
307
308/* Astronomy/GalacticCoordinates */
309void eraG2icrs ( double dl, double db, double *dr, double *dd );
310void eraIcrs2g ( double dr, double dd, double *dl, double *db );
311
312/* Astronomy/GeodeticGeocentric */
313int eraEform(int n, double *a, double *f);
314int eraGc2gd(int n, double xyz[3],
315 double *elong, double *phi, double *height);
316int eraGc2gde(double a, double f, double xyz[3],
317 double *elong, double *phi, double *height);
318int eraGd2gc(int n, double elong, double phi, double height,
319 double xyz[3]);
320int eraGd2gce(double a, double f,
321 double elong, double phi, double height, double xyz[3]);
322
323/* Astronomy/Timescales */
324int eraD2dtf(const char *scale, int ndp, double d1, double d2,
325 int *iy, int *im, int *id, int ihmsf[4]);
326int eraDat(int iy, int im, int id, double fd, double *deltat);
327double eraDtdb(double date1, double date2,
328 double ut, double elong, double u, double v);
329int eraDtf2d(const char *scale, int iy, int im, int id,
330 int ihr, int imn, double sec, double *d1, double *d2);
331int eraTaitt(double tai1, double tai2, double *tt1, double *tt2);
332int eraTaiut1(double tai1, double tai2, double dta,
333 double *ut11, double *ut12);
334int eraTaiutc(double tai1, double tai2, double *utc1, double *utc2);
335int eraTcbtdb(double tcb1, double tcb2, double *tdb1, double *tdb2);
336int eraTcgtt(double tcg1, double tcg2, double *tt1, double *tt2);
337int eraTdbtcb(double tdb1, double tdb2, double *tcb1, double *tcb2);
338int eraTdbtt(double tdb1, double tdb2, double dtr,
339 double *tt1, double *tt2);
340int eraTttai(double tt1, double tt2, double *tai1, double *tai2);
341int eraTttcg(double tt1, double tt2, double *tcg1, double *tcg2);
342int eraTttdb(double tt1, double tt2, double dtr,
343 double *tdb1, double *tdb2);
344int eraTtut1(double tt1, double tt2, double dt,
345 double *ut11, double *ut12);
346int eraUt1tai(double ut11, double ut12, double dta,
347 double *tai1, double *tai2);
348int eraUt1tt(double ut11, double ut12, double dt,
349 double *tt1, double *tt2);
350int eraUt1utc(double ut11, double ut12, double dut1,
351 double *utc1, double *utc2);
352int eraUtctai(double utc1, double utc2, double *tai1, double *tai2);
353int eraUtcut1(double utc1, double utc2, double dut1,
354 double *ut11, double *ut12);
355
356/* VectorMatrix/AngleOps */
357void eraA2af(int ndp, double angle, char *sign, int idmsf[4]);
358void eraA2tf(int ndp, double angle, char *sign, int ihmsf[4]);
359int eraAf2a(char s, int ideg, int iamin, double asec, double *rad);
360double eraAnp(double a);
361double eraAnpm(double a);
362void eraD2tf(int ndp, double days, char *sign, int ihmsf[4]);
363int eraTf2a(char s, int ihour, int imin, double sec, double *rad);
364int eraTf2d(char s, int ihour, int imin, double sec, double *days);
365
366/* VectorMatrix/BuildRotations */
367void eraRx(double phi, double r[3][3]);
368void eraRy(double theta, double r[3][3]);
369void eraRz(double psi, double r[3][3]);
370
371/* VectorMatrix/CopyExtendExtract */
372void eraCp(double p[3], double c[3]);
373void eraCpv(double pv[2][3], double c[2][3]);
374void eraCr(double r[3][3], double c[3][3]);
375void eraP2pv(double p[3], double pv[2][3]);
376void eraPv2p(double pv[2][3], double p[3]);
377
378/* VectorMatrix/Initialization */
379void eraIr(double r[3][3]);
380void eraZp(double p[3]);
381void eraZpv(double pv[2][3]);
382void eraZr(double r[3][3]);
383
384/* VectorMatrix/MatrixOps */
385void eraRxr(double a[3][3], double b[3][3], double atb[3][3]);
386void eraTr(double r[3][3], double rt[3][3]);
387
388/* VectorMatrix/MatrixVectorProducts */
389void eraRxp(double r[3][3], double p[3], double rp[3]);
390void eraRxpv(double r[3][3], double pv[2][3], double rpv[2][3]);
391void eraTrxp(double r[3][3], double p[3], double trp[3]);
392void eraTrxpv(double r[3][3], double pv[2][3], double trpv[2][3]);
393
394/* VectorMatrix/RotationVectors */
395void eraRm2v(double r[3][3], double w[3]);
396void eraRv2m(double w[3], double r[3][3]);
397
398/* VectorMatrix/SeparationAndAngle */
399double eraPap(double a[3], double b[3]);
400double eraPas(double al, double ap, double bl, double bp);
401double eraSepp(double a[3], double b[3]);
402double eraSeps(double al, double ap, double bl, double bp);
403
404/* VectorMatrix/SphericalCartesian */
405void eraC2s(double p[3], double *theta, double *phi);
406void eraP2s(double p[3], double *theta, double *phi, double *r);
407void eraPv2s(double pv[2][3],
408 double *theta, double *phi, double *r,
409 double *td, double *pd, double *rd);
410void eraS2c(double theta, double phi, double c[3]);
411void eraS2p(double theta, double phi, double r, double p[3]);
412void eraS2pv(double theta, double phi, double r,
413 double td, double pd, double rd,
414 double pv[2][3]);
415
416/* VectorMatrix/VectorOps */
417double eraPdp(double a[3], double b[3]);
418double eraPm(double p[3]);
419void eraPmp(double a[3], double b[3], double amb[3]);
420void eraPn(double p[3], double *r, double u[3]);
421void eraPpp(double a[3], double b[3], double apb[3]);
422void eraPpsp(double a[3], double s, double b[3], double apsb[3]);
423void eraPvdpv(double a[2][3], double b[2][3], double adb[2]);
424void eraPvm(double pv[2][3], double *r, double *s);
425void eraPvmpv(double a[2][3], double b[2][3], double amb[2][3]);
426void eraPvppv(double a[2][3], double b[2][3], double apb[2][3]);
427void eraPvu(double dt, double pv[2][3], double upv[2][3]);
428void eraPvup(double dt, double pv[2][3], double p[3]);
429void eraPvxpv(double a[2][3], double b[2][3], double axb[2][3]);
430void eraPxp(double a[3], double b[3], double axb[3]);
431void eraS2xpv(double s1, double s2, double pv[2][3], double spv[2][3]);
432void eraSxp(double s, double p[3], double sp[3]);
433void eraSxpv(double s, double pv[2][3], double spv[2][3]);
434
435#ifdef __cplusplus
436}
437#endif
438
439#endif
440
441
442/*----------------------------------------------------------------------
443**
444**
445** Copyright (C) 2013-2015, NumFOCUS Foundation.
446** All rights reserved.
447**
448** This library is derived, with permission, from the International
449** Astronomical Union's "Standards of Fundamental Astronomy" library,
450** available from http://www.iausofa.org.
451**
452** The ERFA version is intended to retain identical functionality to
453** the SOFA library, but made distinct through different function and
454** file names, as set out in the SOFA license conditions. The SOFA
455** original has a role as a reference standard for the IAU and IERS,
456** and consequently redistribution is permitted only in its unaltered
457** state. The ERFA version is not subject to this restriction and
458** therefore can be included in distributions which do not support the
459** concept of "read only" software.
460**
461** Although the intent is to replicate the SOFA API (other than
462** replacement of prefix names) and results (with the exception of
463** bugs; any that are discovered will be fixed), SOFA is not
464** responsible for any errors found in this version of the library.
465**
466** If you wish to acknowledge the SOFA heritage, please acknowledge
467** that you are using a library derived from SOFA, rather than SOFA
468** itself.
469**
470**
471** TERMS AND CONDITIONS
472**
473** Redistribution and use in source and binary forms, with or without
474** modification, are permitted provided that the following conditions
475** are met:
476**
477** 1 Redistributions of source code must retain the above copyright
478** notice, this list of conditions and the following disclaimer.
479**
480** 2 Redistributions in binary form must reproduce the above copyright
481** notice, this list of conditions and the following disclaimer in
482** the documentation and/or other materials provided with the
483** distribution.
484**
485** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
486** the International Astronomical Union nor the names of its
487** contributors may be used to endorse or promote products derived
488** from this software without specific prior written permission.
489**
490** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
491** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
492** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
493** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
494** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
495** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
496** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
497** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
498** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
499** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
500** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
501** POSSIBILITY OF SUCH DAMAGE.
502**
503*/
Note: See TracBrowser for help on using the repository browser.