source: trunk/FACT++/sofa/src/pmpx.c@ 18368

Last change on this file since 18368 was 18346, checked in by tbretz, 11 years ago
File size: 6.9 KB
Line 
1#include "sofa.h"
2
3void iauPmpx(double rc, double dc, double pr, double pd,
4 double px, double rv, double pmt, double pob[3],
5 double pco[3])
6/*
7** - - - - - - - -
8** i a u P m p x
9** - - - - - - - -
10**
11** Proper motion and parallax.
12**
13** This function is part of the International Astronomical Union's
14** SOFA (Standards of Fundamental Astronomy) software collection.
15**
16** Status: support function.
17**
18** Given:
19** rc,dc double ICRS RA,Dec at catalog epoch (radians)
20** pr double RA proper motion (radians/year; Note 1)
21** pd double Dec proper motion (radians/year)
22** px double parallax (arcsec)
23** rv double radial velocity (km/s, +ve if receding)
24** pmt double proper motion time interval (SSB, Julian years)
25** pob double[3] SSB to observer vector (au)
26**
27** Returned:
28** pco double[3] coordinate direction (BCRS unit vector)
29**
30** Notes:
31**
32** 1) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
33**
34** 2) The proper motion time interval is for when the starlight
35** reaches the solar system barycenter.
36**
37** 3) To avoid the need for iteration, the Roemer effect (i.e. the
38** small annual modulation of the proper motion coming from the
39** changing light time) is applied approximately, using the
40** direction of the star at the catalog epoch.
41**
42** References:
43**
44** 1984 Astronomical Almanac, pp B39-B41.
45**
46** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
47** the Astronomical Almanac, 3rd ed., University Science Books
48** (2013), Section 7.2.
49**
50** Called:
51** iauPdp scalar product of two p-vectors
52** iauPn decompose p-vector into modulus and direction
53**
54** This revision: 2013 October 9
55**
56** SOFA release 2015-02-09
57**
58** Copyright (C) 2015 IAU SOFA Board. See notes at end.
59*/
60{
61/* Km/s to au/year */
62 const double VF = DAYSEC*DJM/DAU;
63
64/* Light time for 1 au, Julian years */
65 const double AULTY = AULT/DAYSEC/DJY;
66
67 int i;
68 double sr, cr, sd, cd, x, y, z, p[3], dt, pxr, w, pdz, pm[3];
69
70/* Spherical coordinates to unit vector (and useful functions). */
71 sr = sin(rc);
72 cr = cos(rc);
73 sd = sin(dc);
74 cd = cos(dc);
75 p[0] = x = cr*cd;
76 p[1] = y = sr*cd;
77 p[2] = z = sd;
78
79/* Proper motion time interval (y) including Roemer effect. */
80 dt = pmt + iauPdp(p,pob)*AULTY;
81
82/* Space motion (radians per year). */
83 pxr = px * DAS2R;
84 w = VF * rv * pxr;
85 pdz = pd * z;
86 pm[0] = - pr*y - pdz*cr + w*x;
87 pm[1] = pr*x - pdz*sr + w*y;
88 pm[2] = pd*cd + w*z;
89
90/* Coordinate direction of star (unit vector, BCRS). */
91 for (i = 0; i < 3; i++) {
92 p[i] += dt*pm[i] - pxr*pob[i];
93 }
94 iauPn(p, &w, pco);
95
96/* Finished. */
97
98/*----------------------------------------------------------------------
99**
100** Copyright (C) 2015
101** Standards Of Fundamental Astronomy Board
102** of the International Astronomical Union.
103**
104** =====================
105** SOFA Software License
106** =====================
107**
108** NOTICE TO USER:
109**
110** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
111** CONDITIONS WHICH APPLY TO ITS USE.
112**
113** 1. The Software is owned by the IAU SOFA Board ("SOFA").
114**
115** 2. Permission is granted to anyone to use the SOFA software for any
116** purpose, including commercial applications, free of charge and
117** without payment of royalties, subject to the conditions and
118** restrictions listed below.
119**
120** 3. You (the user) may copy and distribute SOFA source code to others,
121** and use and adapt its code and algorithms in your own software,
122** on a world-wide, royalty-free basis. That portion of your
123** distribution that does not consist of intact and unchanged copies
124** of SOFA source code files is a "derived work" that must comply
125** with the following requirements:
126**
127** a) Your work shall be marked or carry a statement that it
128** (i) uses routines and computations derived by you from
129** software provided by SOFA under license to you; and
130** (ii) does not itself constitute software provided by and/or
131** endorsed by SOFA.
132**
133** b) The source code of your derived work must contain descriptions
134** of how the derived work is based upon, contains and/or differs
135** from the original SOFA software.
136**
137** c) The names of all routines in your derived work shall not
138** include the prefix "iau" or "sofa" or trivial modifications
139** thereof such as changes of case.
140**
141** d) The origin of the SOFA components of your derived work must
142** not be misrepresented; you must not claim that you wrote the
143** original software, nor file a patent application for SOFA
144** software or algorithms embedded in the SOFA software.
145**
146** e) These requirements must be reproduced intact in any source
147** distribution and shall apply to anyone to whom you have
148** granted a further right to modify the source code of your
149** derived work.
150**
151** Note that, as originally distributed, the SOFA software is
152** intended to be a definitive implementation of the IAU standards,
153** and consequently third-party modifications are discouraged. All
154** variations, no matter how minor, must be explicitly marked as
155** such, as explained above.
156**
157** 4. You shall not cause the SOFA software to be brought into
158** disrepute, either by misuse, or use for inappropriate tasks, or
159** by inappropriate modification.
160**
161** 5. The SOFA software is provided "as is" and SOFA makes no warranty
162** as to its use or performance. SOFA does not and cannot warrant
163** the performance or results which the user may obtain by using the
164** SOFA software. SOFA makes no warranties, express or implied, as
165** to non-infringement of third party rights, merchantability, or
166** fitness for any particular purpose. In no event will SOFA be
167** liable to the user for any consequential, incidental, or special
168** damages, including any lost profits or lost savings, even if a
169** SOFA representative has been advised of such damages, or for any
170** claim by any third party.
171**
172** 6. The provision of any version of the SOFA software under the terms
173** and conditions specified herein does not imply that future
174** versions will also be made available under the same terms and
175** conditions.
176*
177** In any published work or commercial product which uses the SOFA
178** software directly, acknowledgement (see www.iausofa.org) is
179** appreciated.
180**
181** Correspondence concerning SOFA software should be addressed as
182** follows:
183**
184** By email: sofa@ukho.gov.uk
185** By post: IAU SOFA Center
186** HM Nautical Almanac Office
187** UK Hydrographic Office
188** Admiralty Way, Taunton
189** Somerset, TA1 2DN
190** United Kingdom
191**
192**--------------------------------------------------------------------*/
193
194}
Note: See TracBrowser for help on using the repository browser.