source: trunk/MagicSoft/slalib/mapqkz.c@ 1602

Last change on this file since 1602 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 3.4 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaMapqkz ( double rm, double dm, double amprms[21],
4 double *ra, double *da )
5/*
6** - - - - - - - - - -
7** s l a M a p q k z
8** - - - - - - - - - -
9**
10** Quick mean to apparent place: transform a star RA,dec from
11** mean place to geocentric apparent place, given the
12** star-independent parameters, and assuming zero parallax
13** and proper motion.
14**
15** Use of this routine is appropriate when efficiency is important
16** and where many star positions, all with parallax and proper
17** motion either zero or already allowed for, and all referred to
18** the same equator and equinox, are to be transformed for one
19** epoch. The star-independent parameters can be obtained by
20** calling the slaMappa routine.
21**
22** The corresponding routine for the case of non-zero parallax
23** and proper motion is slaMapqk.
24**
25** The reference frames and timescales used are post IAU 1976.
26**
27** Given:
28** rm,dm double mean RA,dec (rad)
29** amprms double[21] star-independent mean-to-apparent parameters:
30**
31** (0-3) not used
32** (4-6) heliocentric direction of the Earth (unit vector)
33** (7) (grav rad Sun)*2/(Sun-Earth distance)
34** (8-10) abv: barycentric Earth velocity in units of c
35** (11) sqrt(1-v**2) where v=modulus(abv)
36** (12-20) precession/nutation (3,3) matrix
37**
38** Returned:
39** *ra,*da double apparent RA,dec (rad)
40**
41** References:
42** 1984 Astronomical Almanac, pp B39-B41.
43** (also Lederle & Schwan, Astron. Astrophys. 134,
44** 1-6, 1984)
45**
46** Notes:
47**
48** 1) The vectors amprms(1-3) and amprms(4-6) are referred to the
49** mean equinox and equator of epoch eq.
50**
51** 2) Strictly speaking, the routine is not valid for solar-system
52** sources, though the error will usually be extremely small.
53** However, to prevent gross errors in the case where the
54** position of the Sun is specified, the gravitational
55** deflection term is restrained within about 920 arcsec of the
56** centre of the Sun's disc. The term has a maximum value of
57** about 1.85 arcsec at this radius, and decreases to zero as
58** the centre of the disc is approached.
59**
60** Called:
61** slaDcs2c spherical to Cartesian
62** slaDvdv dot product
63** slaDmxv matrix x vector
64** slaDcc2s Cartesian to spherical
65** slaDranrm normalize angle 0-2pi
66**
67** Last revision: 17 August 1999
68**
69** Copyright P.T.Wallace. All rights reserved.
70*/
71{
72 int i;
73 double gr2e, ab1, ehn[3], abv[3], p[3], pde, pdep1,
74 w, p1[3], p1dv, p1dvp1, p2[3], p3[3];
75
76
77/* Unpack scalar and vector parameters */
78 gr2e = amprms[7];
79 ab1 = amprms[11];
80 for ( i = 0; i < 3; i++ ) {
81 ehn[i] = amprms[i+4];
82 abv[i] = amprms[i+8];
83 }
84
85/* Spherical to x,y,z */
86 slaDcs2c ( rm, dm, p );
87
88/* Light deflection */
89 pde = slaDvdv ( p, ehn );
90 pdep1 = pde + 1.0;
91 w = gr2e / gmax ( pdep1, 1e-5 );
92 for ( i = 0; i < 3; i++ ) {
93 p1[i] = p[i] + w * ( ehn[i] - pde * p[i] );
94 }
95
96/* Aberration */
97 p1dv = slaDvdv ( p1, abv );
98 p1dvp1 = p1dv + 1.0;
99 w = 1.0 + p1dv / ( ab1 + 1.0 );
100 for ( i = 0; i < 3; i++ ) {
101 p2[i] = ( ( ab1 * p1[i] ) + ( w * abv[i] ) ) / p1dvp1;
102 }
103
104/* Precession and nutation */
105 slaDmxv ( (double(*)[3]) &amprms[12], p2, p3 );
106
107/* Geocentric apparent RA,dec */
108 slaDcc2s ( p3, ra, da );
109 *ra = slaDranrm ( *ra );
110}
Note: See TracBrowser for help on using the repository browser.