source: trunk/MagicSoft/slalib/mappa.c

Last change on this file was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.0 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaMappa ( double eq, double date, double amprms[21] )
4/*
5** - - - - - - - - -
6** s l a M a p p a
7** - - - - - - - - -
8**
9** Compute star-independent parameters in preparation for
10** conversions between mean place and geocentric apparent place.
11**
12** The parameters produced by this routine are required in the
13** parallax, light deflection, aberration, and precession/nutation
14** parts of the mean/apparent transformations.
15**
16** The reference frames and timescales used are post IAU 1976.
17**
18** Given:
19** eq double epoch of mean equinox to be used (Julian)
20** date double TDB (JD-2400000.5)
21**
22** Returned:
23** amprms double[21] star-independent mean-to-apparent parameters:
24**
25** (0) time interval for proper motion (Julian years)
26** (1-3) barycentric position of the Earth (AU)
27** (4-6) heliocentric direction of the Earth (unit vector)
28** (7) (grav rad Sun)*2/(Sun-Earth distance)
29** (8-10) abv: barycentric Earth velocity in units of c
30** (11) sqrt(1-v**2) where v=modulus(abv)
31** (12-20) precession/nutation (3,3) matrix
32**
33** References:
34** 1984 Astronomical Almanac, pp B39-B41.
35** (also Lederle & Schwan, Astron. Astrophys. 134, 1-6, 1984)
36**
37** Notes:
38**
39** 1) For date, the distinction between the required TDB and TT
40** is always negligible. Moreover, for all but the most
41** critical applications UTC is adequate.
42**
43** 2) The accuracy of the routines using the parameters amprms is
44** limited by the routine slaEvp, used here to compute the
45** Earth position and velocity by the methods of Stumpff.
46** The maximum error in the resulting aberration corrections is
47** about 0.3 milliarcsecond.
48**
49** 3) The vectors amprms(1-3) and amprms(4-6) are referred to
50** the mean equinox and equator of epoch eq.
51**
52** 4) The parameters amprms produced by this routine are used by
53** slaMapqk and slaMapqkz.
54**
55** Called:
56** slaEpj, slaEvp, slaDvn, slaPrenut
57**
58** Last revision: 26 September 1998
59**
60** Copyright P.T.Wallace. All rights reserved.
61*/
62
63#define CR 499.004782 /* Light time for 1 AU (sec) */
64#define GR2 1.974126e-8 /* Gravitational radius of the Sun x 2:
65 (2*mu/c**2, au) */
66{
67 int i;
68
69 double ebd[3], ehd[3], eh[3], e, vn[3], vm;
70
71/* Time interval for proper motion correction */
72 amprms[0] = slaEpj ( date ) - eq;
73
74/* Get Earth barycentric and heliocentric position and velocity */
75 slaEvp ( date, eq, ebd, &amprms[1], ehd, eh );
76
77/* Heliocentric direction of Earth (normalized) and modulus */
78 slaDvn ( eh, &amprms[4], &e );
79
80/* Light deflection parameter */
81 amprms[7] = GR2 / e;
82
83/* Aberration parameters */
84 for ( i = 0; i < 3; i++ ) {
85 amprms[i+8] = ebd[i] * CR;
86 }
87 slaDvn ( &amprms[8], vn, &vm );
88 amprms[11] = sqrt ( 1.0 - vm * vm );
89
90/* Precession/nutation matrix */
91 slaPrenut ( eq, date, (double(*)[3]) &amprms[12] );
92}
Note: See TracBrowser for help on using the repository browser.