source: trunk/MagicSoft/slalib/fk425.c@ 6892

Last change on this file since 6892 was 731, checked in by tbretz, 24 years ago
*** empty log message ***
  • Property svn:executable set to *
File size: 7.9 KB
Line 
1#include "slalib.h"
2#include "slamac.h"
3void slaFk425 ( double r1950, double d1950, double dr1950,
4 double dd1950, double p1950, double v1950,
5 double *r2000, double *d2000, double *dr2000,
6 double *dd2000, double *p2000, double *v2000 )
7/*
8** - - - - - - - - -
9** s l a F k 4 2 5
10** - - - - - - - - -
11**
12** Convert B1950.0 FK4 star data to J2000.0 FK5.
13**
14** (double precision)
15**
16** This routine converts stars from the old, Bessel-Newcomb, FK4
17** system to the new, IAU 1976, FK5, Fricke system. The precepts
18** of Smith et al (Ref 1) are followed, using the implementation
19** by Yallop et al (Ref 2) of a matrix method due to Standish.
20** Kinoshita's development of Andoyer's post-Newcomb precession is
21** used. The numerical constants from Seidelmann et al (Ref 3) are
22** used canonically.
23**
24** Given: (all B1950.0,FK4)
25**
26** r1950,d1950 double B1950.0 RA,dec (rad)
27** dr1950,dd1950 double B1950.0 proper motions (rad/trop.yr)
28** p1950 double parallax (arcsec)
29** v1950 double radial velocity (km/s, +ve = moving away)
30**
31** Returned: (all J2000.0,FK5)
32**
33** *r2000,*d2000 double J2000.0 RA,dec (rad)
34** *dr2000,*dd2000 double J2000.0 proper motions (rad/jul.yr)
35** *p2000 double parallax (arcsec)
36** *v2000 double radial velocity (km/s, +ve = moving away)
37**
38** Notes:
39**
40** 1) The proper motions in RA are dRA/dt rather than
41** cos(Dec)*dRA/dt, and are per year rather than per century.
42**
43** 2) Conversion from Besselian epoch 1950.0 to Julian epoch
44** 2000.0 only is provided for. Conversions involving other
45** epochs will require use of the appropriate precession,
46** proper motion, and E-terms routines before and/or
47** after FK425 is called.
48**
49** 3) In the FK4 catalogue the proper motions of stars within
50** 10 degrees of the poles do not embody the differential
51** E-term effect and should, strictly speaking, be handled
52** in a different manner from stars outside these regions.
53** However, given the general lack of homogeneity of the star
54** data available for routine astrometry, the difficulties of
55** handling positions that may have been determined from
56** astrometric fields spanning the polar and non-polar regions,
57** the likelihood that the differential E-terms effect was not
58** taken into account when allowing for proper motion in past
59** astrometry, and the undesirability of a discontinuity in
60** the algorithm, the decision has been made in this routine to
61** include the effect of differential E-terms on the proper
62** motions for all stars, whether polar or not. At epoch 2000,
63** and measuring on the sky rather than in terms of dRA, the
64** errors resulting from this simplification are less than
65** 1 milliarcsecond in position and 1 milliarcsecond per
66** century in proper motion.
67**
68** References:
69**
70** 1 Smith, C.A. et al, 1989. "The transformation of astrometric
71** catalog systems to the equinox J2000.0". Astron.J. 97, 265.
72**
73** 2 Yallop, B.D. et al, 1989. "Transformation of mean star places
74** from FK4 B1950.0 to FK5 J2000.0 using matrices in 6-space".
75** Astron.J. 97, 274.
76**
77** 3 Seidelmann, P.K. (ed), 1992. "Explanatory Supplement to
78** the Astronomical Almanac", ISBN 0-935702-68-7.
79**
80** Defined in slamac.h: D2PI
81**
82** Last revision: 26 September 1998
83**
84** Copyright P.T.Wallace. All rights reserved.
85*/
86{
87 double r, d, ur, ud, px, rv, sr, cr, sd, cd, w, wd,
88 x, y, z, xd, yd, zd,
89 rxysq, rxyzsq, rxy, rxyz, spxy, spxyz;
90 int i, j;
91
92/* Star position and velocity vectors */
93 double r0[3], rd0[3];
94
95/* Combined position and velocity vectors */
96 double v1[6], v2[6];
97
98/* Radians per year to arcsec per century */
99 static double pmf = 100.0 * 60.0 * 60.0 * 360.0 / D2PI;
100
101/* Small number to avoid arithmetic problems */
102 double tiny = 1.0e-30;
103
104/*
105** Canonical constants (see references)
106*/
107
108/*
109** Km per sec to AU per tropical century
110** = 86400 * 36524.2198782 / 1.49597870e8
111*/
112 double vf = 21.095;
113
114/* Constant vector and matrix (by rows) */
115 static double a[3] = { -1.62557e-6, -0.31919e-6, -0.13843e-6 };
116 static double ad[3] = { 1.245e-3, -1.580e-3, -0.659e-3 };
117 static double em[6][6] =
118 {
119 { 0.9999256782, /* em[0][0] */
120 -0.0111820611, /* em[0][1] */
121 -0.0048579477, /* em[0][2] */
122 0.00000242395018, /* em[0][3] */
123 -0.00000002710663, /* em[0][4] */
124 -0.00000001177656 }, /* em[0][5] */
125
126 { 0.0111820610, /* em[1][0] */
127 0.9999374784, /* em[1][1] */
128 -0.0000271765, /* em[1][2] */
129 0.00000002710663, /* em[1][3] */
130 0.00000242397878, /* em[1][4] */
131 -0.00000000006587 }, /* em[1][5] */
132
133 { 0.0048579479, /* em[2][0] */
134 -0.0000271474, /* em[2][1] */
135 0.9999881997, /* em[2][2] */
136 0.00000001177656, /* em[2][3] */
137 -0.00000000006582, /* em[2][4] */
138 0.00000242410173 }, /* em[2][5] */
139
140 { -0.000551, /* em[3][0] */
141 -0.238565, /* em[3][1] */
142 0.435739, /* em[3][2] */
143 0.99994704, /* em[3][3] */
144 -0.01118251, /* em[3][4] */
145 -0.00485767 }, /* em[3][5] */
146
147 { 0.238514, /* em[4][0] */
148 -0.002667, /* em[4][1] */
149 -0.008541, /* em[4][2] */
150 0.01118251, /* em[4][3] */
151 0.99995883, /* em[4][4] */
152 -0.00002718 }, /* em[4][5] */
153
154 { -0.435623, /* em[5][0] */
155 0.012254, /* em[5][1] */
156 0.002117, /* em[5][2] */
157 0.00485767, /* em[5][3] */
158 -0.00002714, /* em[5][4] */
159 1.00000956 } /* em[5][5] */
160 };
161
162/* Pick up B1950 data (units radians and arcsec/tc) */
163 r = r1950;
164 d = d1950;
165 ur = dr1950 * pmf;
166 ud = dd1950 * pmf;
167 px = p1950;
168 rv = v1950;
169
170/* Spherical to Cartesian */
171 sr = sin ( r );
172 cr = cos ( r );
173 sd = sin ( d );
174 cd = cos ( d );
175
176 r0[0] = cr * cd;
177 r0[1] = sr * cd;
178 r0[2] = sd;
179
180 w = vf * rv * px;
181
182 rd0[0] = ( -sr * cd * ur ) - ( cr * sd * ud ) + ( w * r0[0] );
183 rd0[1] = ( cr * cd * ur ) - ( sr * sd * ud ) + ( w * r0[1] );
184 rd0[2] = ( cd * ud ) + ( w * r0[2] );
185
186/* Allow for e-terms and express as position+velocity 6-vector */
187 w = ( r0[0] * a[0] ) + ( r0[1] * a[1] ) + ( r0[2] * a[2] );
188 wd = ( r0[0] * ad[0] ) + ( r0[1] * ad[1] ) + ( r0[2] * ad[2] );
189
190 for ( i = 0; i < 3; i++ ) {
191 v1[i] = r0[i] - a[i] + w * r0[i];
192 v1[i+3] = rd0[i] - ad[i] + wd * r0[i];
193 }
194
195/* Convert position+velocity vector to Fricke system */
196 for ( i = 0; i < 6; i++ ) {
197 w = 0.0;
198 for ( j = 0; j < 6; j++ ) {
199 w += em[i][j] * v1[j];
200 }
201 v2[i] = w;
202 }
203
204/* Revert to spherical coordinates */
205 x = v2[0];
206 y = v2[1];
207 z = v2[2];
208 xd = v2[3];
209 yd = v2[4];
210 zd = v2[5];
211
212 rxysq = ( x * x ) + ( y * y );
213 rxyzsq = ( rxysq ) + ( z * z );
214 rxy = sqrt ( rxysq );
215 rxyz = sqrt ( rxyzsq );
216
217 spxy = ( x * xd ) + ( y * yd );
218 spxyz = spxy + ( z * zd );
219
220 if ( (x == 0.0) && (y == 0.0) )
221 r = 0.0;
222 else {
223 r = atan2 ( y, x );
224 if ( r < 0.0 )
225 r += D2PI;
226 }
227 d = atan2 ( z, rxy );
228
229 if ( rxy > tiny ) {
230 ur = ( ( x * yd ) - ( y * xd ) ) / rxysq;
231 ud = ( ( zd * rxysq ) - ( z * spxy ) ) / ( rxyzsq * rxy );
232 }
233
234 if ( px > tiny ) {
235 rv = spxyz / ( px * rxyz * vf );
236 px = px / rxyz;
237 }
238
239/* Return results */
240 *r2000 = r;
241 *d2000 = d;
242 *dr2000 = ur / pmf;
243 *dd2000 = ud / pmf;
244 *v2000 = rv;
245 *p2000 = px;
246}
Note: See TracBrowser for help on using the repository browser.