aboutsummaryrefslogtreecommitdiff
path: root/src/slalib/mappa.f
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2015-03-04 21:21:30 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2015-03-04 21:21:30 -0500
commitd54fe7c1f704a63824c5bfa0ece65245572e9b27 (patch)
treeafc52015ffc2c74e0266653eecef1c8ef8ba5d91 /src/slalib/mappa.f
downloadcalfuse-d54fe7c1f704a63824c5bfa0ece65245572e9b27.tar.gz
Initial commit
Diffstat (limited to 'src/slalib/mappa.f')
-rw-r--r--src/slalib/mappa.f107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/slalib/mappa.f b/src/slalib/mappa.f
new file mode 100644
index 0000000..8dce865
--- /dev/null
+++ b/src/slalib/mappa.f
@@ -0,0 +1,107 @@
+ SUBROUTINE sla_MAPPA (EQ, DATE, AMPRMS)
+*+
+* - - - - - -
+* M A P P A
+* - - - - - -
+*
+* Compute star-independent parameters in preparation for
+* conversions between mean place and geocentric apparent place.
+*
+* The parameters produced by this routine are required in the
+* parallax, light deflection, aberration, and precession/nutation
+* parts of the mean/apparent transformations.
+*
+* The reference frames and timescales used are post IAU 1976.
+*
+* Given:
+* EQ d epoch of mean equinox to be used (Julian)
+* DATE d TDB (JD-2400000.5)
+*
+* Returned:
+* AMPRMS d(21) star-independent mean-to-apparent parameters:
+*
+* (1) time interval for proper motion (Julian years)
+* (2-4) barycentric position of the Earth (AU)
+* (5-7) heliocentric direction of the Earth (unit vector)
+* (8) (grav rad Sun)*2/(Sun-Earth distance)
+* (9-11) ABV: barycentric Earth velocity in units of c
+* (12) sqrt(1-v**2) where v=modulus(ABV)
+* (13-21) precession/nutation (3,3) matrix
+*
+* References:
+* 1984 Astronomical Almanac, pp B39-B41.
+* (also Lederle & Schwan, Astron. Astrophys. 134,
+* 1-6, 1984)
+*
+* Notes:
+*
+* 1) For DATE, the distinction between the required TDB and TT
+* is always negligible. Moreover, for all but the most
+* critical applications UTC is adequate.
+*
+* 2) The accuracy of the routines using the parameters AMPRMS is
+* limited by the routine sla_EVP, used here to compute the
+* Earth position and velocity by the methods of Stumpff.
+* The maximum error in the resulting aberration corrections is
+* about 0.3 milliarcsecond.
+*
+* 3) The vectors AMPRMS(2-4) and AMPRMS(5-7) are referred to
+* the mean equinox and equator of epoch EQ.
+*
+* 4) The parameters AMPRMS produced by this routine are used by
+* sla_MAPQK and sla_MAPQKZ.
+*
+* Called:
+* sla_EPJ MDJ to Julian epoch
+* sla_EVP earth position & velocity
+* sla_DVN normalize vector
+* sla_PRENUT precession/nutation matrix
+*
+* P.T.Wallace Starlink 23 November 1995
+*
+* Copyright (C) 1995 Rutherford Appleton Laboratory
+*-
+
+ IMPLICIT NONE
+
+ DOUBLE PRECISION EQ,DATE,AMPRMS(21)
+
+* Light time for 1 AU (sec)
+ DOUBLE PRECISION CR
+ PARAMETER (CR=499.004782D0)
+
+* Gravitational radius of the sun x 2 (2*mu/c**2, AU)
+ DOUBLE PRECISION GR2
+ PARAMETER (GR2=2D0*9.87063D-9)
+
+ INTEGER I
+
+ DOUBLE PRECISION EBD(3),EHD(3),EH(3),E,VN(3),VM
+
+ DOUBLE PRECISION sla_EPJ
+
+
+
+* Time interval for proper motion correction
+ AMPRMS(1) = sla_EPJ(DATE)-EQ
+
+* Get Earth barycentric and heliocentric position and velocity
+ CALL sla_EVP(DATE,EQ,EBD,AMPRMS(2),EHD,EH)
+
+* Heliocentric direction of earth (normalized) and modulus
+ CALL sla_DVN(EH,AMPRMS(5),E)
+
+* Light deflection parameter
+ AMPRMS(8) = GR2/E
+
+* Aberration parameters
+ DO I=1,3
+ AMPRMS(I+8) = EBD(I)*CR
+ END DO
+ CALL sla_DVN(AMPRMS(9),VN,VM)
+ AMPRMS(12) = SQRT(1D0-VM*VM)
+
+* Precession/nutation matrix
+ CALL sla_PRENUT(EQ,DATE,AMPRMS(13))
+
+ END