source: trunk/FACT++/erfa/src/pvtob.c@ 19813

Last change on this file since 19813 was 18921, checked in by tbretz, 7 years ago
Updated to ERFA 1.4.0
File size: 6.1 KB
Line 
1#include "erfa.h"
2
3void eraPvtob(double elong, double phi, double hm,
4 double xp, double yp, double sp, double theta,
5 double pv[2][3])
6/*
7** - - - - - - - - -
8** e r a P v t o b
9** - - - - - - - - -
10**
11** Position and velocity of a terrestrial observing station.
12**
13** Given:
14** elong double longitude (radians, east +ve, Note 1)
15** phi double latitude (geodetic, radians, Note 1)
16** hm double height above ref. ellipsoid (geodetic, m)
17** xp,yp double coordinates of the pole (radians, Note 2)
18** sp double the TIO locator s' (radians, Note 2)
19** theta double Earth rotation angle (radians, Note 3)
20**
21** Returned:
22** pv double[2][3] position/velocity vector (m, m/s, CIRS)
23**
24** Notes:
25**
26** 1) The terrestrial coordinates are with respect to the ERFA_WGS84
27** reference ellipsoid.
28**
29** 2) xp and yp are the coordinates (in radians) of the Celestial
30** Intermediate Pole with respect to the International Terrestrial
31** Reference System (see IERS Conventions), measured along the
32** meridians 0 and 90 deg west respectively. sp is the TIO locator
33** s', in radians, which positions the Terrestrial Intermediate
34** Origin on the equator. For many applications, xp, yp and
35** (especially) sp can be set to zero.
36**
37** 3) If theta is Greenwich apparent sidereal time instead of Earth
38** rotation angle, the result is with respect to the true equator
39** and equinox of date, i.e. with the x-axis at the equinox rather
40** than the celestial intermediate origin.
41**
42** 4) The velocity units are meters per UT1 second, not per SI second.
43** This is unlikely to have any practical consequences in the modern
44** era.
45**
46** 5) No validation is performed on the arguments. Error cases that
47** could lead to arithmetic exceptions are trapped by the eraGd2gc
48** function, and the result set to zeros.
49**
50** References:
51**
52** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
53** IERS Technical Note No. 32, BKG (2004)
54**
55** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
56** the Astronomical Almanac, 3rd ed., University Science Books
57** (2013), Section 7.4.3.3.
58**
59** Called:
60** eraGd2gc geodetic to geocentric transformation
61** eraPom00 polar motion matrix
62** eraTrxp product of transpose of r-matrix and p-vector
63**
64** Copyright (C) 2013-2017, NumFOCUS Foundation.
65** Derived, with permission, from the SOFA library. See notes at end of file.
66*/
67{
68/* Earth rotation rate in radians per UT1 second */
69 const double OM = 1.00273781191135448 * ERFA_D2PI / ERFA_DAYSEC;
70
71 double xyzm[3], rpm[3][3], xyz[3], x, y, z, s, c;
72
73
74/* Geodetic to geocentric transformation (ERFA_WGS84). */
75 (void) eraGd2gc(1, elong, phi, hm, xyzm);
76
77/* Polar motion and TIO position. */
78 eraPom00(xp, yp, sp, rpm);
79 eraTrxp(rpm, xyzm, xyz);
80 x = xyz[0];
81 y = xyz[1];
82 z = xyz[2];
83
84/* Functions of ERA. */
85 s = sin(theta);
86 c = cos(theta);
87
88/* Position. */
89 pv[0][0] = c*x - s*y;
90 pv[0][1] = s*x + c*y;
91 pv[0][2] = z;
92
93/* Velocity. */
94 pv[1][0] = OM * ( -s*x - c*y );
95 pv[1][1] = OM * ( c*x - s*y );
96 pv[1][2] = 0.0;
97
98/* Finished. */
99
100}
101/*----------------------------------------------------------------------
102**
103**
104** Copyright (C) 2013-2017, NumFOCUS Foundation.
105** All rights reserved.
106**
107** This library is derived, with permission, from the International
108** Astronomical Union's "Standards of Fundamental Astronomy" library,
109** available from http://www.iausofa.org.
110**
111** The ERFA version is intended to retain identical functionality to
112** the SOFA library, but made distinct through different function and
113** file names, as set out in the SOFA license conditions. The SOFA
114** original has a role as a reference standard for the IAU and IERS,
115** and consequently redistribution is permitted only in its unaltered
116** state. The ERFA version is not subject to this restriction and
117** therefore can be included in distributions which do not support the
118** concept of "read only" software.
119**
120** Although the intent is to replicate the SOFA API (other than
121** replacement of prefix names) and results (with the exception of
122** bugs; any that are discovered will be fixed), SOFA is not
123** responsible for any errors found in this version of the library.
124**
125** If you wish to acknowledge the SOFA heritage, please acknowledge
126** that you are using a library derived from SOFA, rather than SOFA
127** itself.
128**
129**
130** TERMS AND CONDITIONS
131**
132** Redistribution and use in source and binary forms, with or without
133** modification, are permitted provided that the following conditions
134** are met:
135**
136** 1 Redistributions of source code must retain the above copyright
137** notice, this list of conditions and the following disclaimer.
138**
139** 2 Redistributions in binary form must reproduce the above copyright
140** notice, this list of conditions and the following disclaimer in
141** the documentation and/or other materials provided with the
142** distribution.
143**
144** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
145** the International Astronomical Union nor the names of its
146** contributors may be used to endorse or promote products derived
147** from this software without specific prior written permission.
148**
149** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
150** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
151** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
152** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
153** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
154** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
155** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
156** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
157** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
158** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
159** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
160** POSSIBILITY OF SUCH DAMAGE.
161**
162*/
Note: See TracBrowser for help on using the repository browser.