source: trunk/FACT++/erfa/src/pmpx.c@ 18403

Last change on this file since 18403 was 18348, checked in by tbretz, 9 years ago
File size: 5.5 KB
Line 
1#include "erfa.h"
2
3void eraPmpx(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** e r a P m p x
9** - - - - - - - -
10**
11** Proper motion and parallax.
12**
13** Given:
14** rc,dc double ICRS RA,Dec at catalog epoch (radians)
15** pr double RA proper motion (radians/year; Note 1)
16** pd double Dec proper motion (radians/year)
17** px double parallax (arcsec)
18** rv double radial velocity (km/s, +ve if receding)
19** pmt double proper motion time interval (SSB, Julian years)
20** pob double[3] SSB to observer vector (au)
21**
22** Returned:
23** pco double[3] coordinate direction (BCRS unit vector)
24**
25** Notes:
26**
27** 1) The proper motion in RA is dRA/dt rather than cos(Dec)*dRA/dt.
28**
29** 2) The proper motion time interval is for when the starlight
30** reaches the solar system barycenter.
31**
32** 3) To avoid the need for iteration, the Roemer effect (i.e. the
33** small annual modulation of the proper motion coming from the
34** changing light time) is applied approximately, using the
35** direction of the star at the catalog epoch.
36**
37** References:
38**
39** 1984 Astronomical Almanac, pp B39-B41.
40**
41** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
42** the Astronomical Almanac, 3rd ed., University Science Books
43** (2013), Section 7.2.
44**
45** Called:
46** eraPdp scalar product of two p-vectors
47** eraPn decompose p-vector into modulus and direction
48**
49** Copyright (C) 2013-2015, NumFOCUS Foundation.
50** Derived, with permission, from the SOFA library. See notes at end of file.
51*/
52{
53/* Km/s to au/year */
54 const double VF = ERFA_DAYSEC*ERFA_DJM/ERFA_DAU;
55
56/* Light time for 1 au, Julian years */
57 const double AULTY = ERFA_AULT/ERFA_DAYSEC/ERFA_DJY;
58
59 int i;
60 double sr, cr, sd, cd, x, y, z, p[3], dt, pxr, w, pdz, pm[3];
61
62/* Spherical coordinates to unit vector (and useful functions). */
63 sr = sin(rc);
64 cr = cos(rc);
65 sd = sin(dc);
66 cd = cos(dc);
67 p[0] = x = cr*cd;
68 p[1] = y = sr*cd;
69 p[2] = z = sd;
70
71/* Proper motion time interval (y) including Roemer effect. */
72 dt = pmt + eraPdp(p,pob)*AULTY;
73
74/* Space motion (radians per year). */
75 pxr = px * ERFA_DAS2R;
76 w = VF * rv * pxr;
77 pdz = pd * z;
78 pm[0] = - pr*y - pdz*cr + w*x;
79 pm[1] = pr*x - pdz*sr + w*y;
80 pm[2] = pd*cd + w*z;
81
82/* Coordinate direction of star (unit vector, BCRS). */
83 for (i = 0; i < 3; i++) {
84 p[i] += dt*pm[i] - pxr*pob[i];
85 }
86 eraPn(p, &w, pco);
87
88/* Finished. */
89
90}
91/*----------------------------------------------------------------------
92**
93**
94** Copyright (C) 2013-2015, NumFOCUS Foundation.
95** All rights reserved.
96**
97** This library is derived, with permission, from the International
98** Astronomical Union's "Standards of Fundamental Astronomy" library,
99** available from http://www.iausofa.org.
100**
101** The ERFA version is intended to retain identical functionality to
102** the SOFA library, but made distinct through different function and
103** file names, as set out in the SOFA license conditions. The SOFA
104** original has a role as a reference standard for the IAU and IERS,
105** and consequently redistribution is permitted only in its unaltered
106** state. The ERFA version is not subject to this restriction and
107** therefore can be included in distributions which do not support the
108** concept of "read only" software.
109**
110** Although the intent is to replicate the SOFA API (other than
111** replacement of prefix names) and results (with the exception of
112** bugs; any that are discovered will be fixed), SOFA is not
113** responsible for any errors found in this version of the library.
114**
115** If you wish to acknowledge the SOFA heritage, please acknowledge
116** that you are using a library derived from SOFA, rather than SOFA
117** itself.
118**
119**
120** TERMS AND CONDITIONS
121**
122** Redistribution and use in source and binary forms, with or without
123** modification, are permitted provided that the following conditions
124** are met:
125**
126** 1 Redistributions of source code must retain the above copyright
127** notice, this list of conditions and the following disclaimer.
128**
129** 2 Redistributions in binary form must reproduce the above copyright
130** notice, this list of conditions and the following disclaimer in
131** the documentation and/or other materials provided with the
132** distribution.
133**
134** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
135** the International Astronomical Union nor the names of its
136** contributors may be used to endorse or promote products derived
137** from this software without specific prior written permission.
138**
139** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
140** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
141** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
142** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
143** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
144** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
145** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
146** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
147** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
148** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
149** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
150** POSSIBILITY OF SUCH DAMAGE.
151**
152*/
Note: See TracBrowser for help on using the repository browser.