| 1 | #include "sofa.h"
|
|---|
| 2 |
|
|---|
| 3 | void iauPvtob(double elong, double phi, double hm,
|
|---|
| 4 | double xp, double yp, double sp, double theta,
|
|---|
| 5 | double pv[2][3])
|
|---|
| 6 | /*
|
|---|
| 7 | ** - - - - - - - - -
|
|---|
| 8 | ** i a u P v t o b
|
|---|
| 9 | ** - - - - - - - - -
|
|---|
| 10 | **
|
|---|
| 11 | ** Position and velocity of a terrestrial observing station.
|
|---|
| 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 | ** elong double longitude (radians, east +ve, Note 1)
|
|---|
| 20 | ** phi double latitude (geodetic, radians, Note 1)
|
|---|
| 21 | ** hm double height above ref. ellipsoid (geodetic, m)
|
|---|
| 22 | ** xp,yp double coordinates of the pole (radians, Note 2)
|
|---|
| 23 | ** sp double the TIO locator s' (radians, Note 2)
|
|---|
| 24 | ** theta double Earth rotation angle (radians, Note 3)
|
|---|
| 25 | **
|
|---|
| 26 | ** Returned:
|
|---|
| 27 | ** pv double[2][3] position/velocity vector (m, m/s, CIRS)
|
|---|
| 28 | **
|
|---|
| 29 | ** Notes:
|
|---|
| 30 | **
|
|---|
| 31 | ** 1) The terrestrial coordinates are with respect to the WGS84
|
|---|
| 32 | ** reference ellipsoid.
|
|---|
| 33 | **
|
|---|
| 34 | ** 2) xp and yp are the coordinates (in radians) of the Celestial
|
|---|
| 35 | ** Intermediate Pole with respect to the International Terrestrial
|
|---|
| 36 | ** Reference System (see IERS Conventions), measured along the
|
|---|
| 37 | ** meridians 0 and 90 deg west respectively. sp is the TIO locator
|
|---|
| 38 | ** s', in radians, which positions the Terrestrial Intermediate
|
|---|
| 39 | ** Origin on the equator. For many applications, xp, yp and
|
|---|
| 40 | ** (especially) sp can be set to zero.
|
|---|
| 41 | **
|
|---|
| 42 | ** 3) If theta is Greenwich apparent sidereal time instead of Earth
|
|---|
| 43 | ** rotation angle, the result is with respect to the true equator
|
|---|
| 44 | ** and equinox of date, i.e. with the x-axis at the equinox rather
|
|---|
| 45 | ** than the celestial intermediate origin.
|
|---|
| 46 | **
|
|---|
| 47 | ** 4) The velocity units are meters per UT1 second, not per SI second.
|
|---|
| 48 | ** This is unlikely to have any practical consequences in the modern
|
|---|
| 49 | ** era.
|
|---|
| 50 | **
|
|---|
| 51 | ** 5) No validation is performed on the arguments. Error cases that
|
|---|
| 52 | ** could lead to arithmetic exceptions are trapped by the iauGd2gc
|
|---|
| 53 | ** function, and the result set to zeros.
|
|---|
| 54 | **
|
|---|
| 55 | ** References:
|
|---|
| 56 | **
|
|---|
| 57 | ** McCarthy, D. D., Petit, G. (eds.), IERS Conventions (2003),
|
|---|
| 58 | ** IERS Technical Note No. 32, BKG (2004)
|
|---|
| 59 | **
|
|---|
| 60 | ** Urban, S. & Seidelmann, P. K. (eds), Explanatory Supplement to
|
|---|
| 61 | ** the Astronomical Almanac, 3rd ed., University Science Books
|
|---|
| 62 | ** (2013), Section 7.4.3.3.
|
|---|
| 63 | **
|
|---|
| 64 | ** Called:
|
|---|
| 65 | ** iauGd2gc geodetic to geocentric transformation
|
|---|
| 66 | ** iauPom00 polar motion matrix
|
|---|
| 67 | ** iauTrxp product of transpose of r-matrix and p-vector
|
|---|
| 68 | **
|
|---|
| 69 | ** This revision: 2013 October 9
|
|---|
| 70 | **
|
|---|
| 71 | ** SOFA release 2015-02-09
|
|---|
| 72 | **
|
|---|
| 73 | ** Copyright (C) 2015 IAU SOFA Board. See notes at end.
|
|---|
| 74 | */
|
|---|
| 75 | {
|
|---|
| 76 | /* Earth rotation rate in radians per UT1 second */
|
|---|
| 77 | const double OM = 1.00273781191135448 * D2PI / DAYSEC;
|
|---|
| 78 |
|
|---|
| 79 | double xyzm[3], rpm[3][3], xyz[3], x, y, z, s, c;
|
|---|
| 80 |
|
|---|
| 81 | /* Geodetic to geocentric transformation (WGS84). */
|
|---|
| 82 | (void) iauGd2gc(1, elong, phi, hm, xyzm);
|
|---|
| 83 |
|
|---|
| 84 | /* Polar motion and TIO position. */
|
|---|
| 85 | iauPom00(xp, yp, sp, rpm);
|
|---|
| 86 | iauTrxp(rpm, xyzm, xyz);
|
|---|
| 87 | x = xyz[0];
|
|---|
| 88 | y = xyz[1];
|
|---|
| 89 | z = xyz[2];
|
|---|
| 90 |
|
|---|
| 91 | /* Functions of ERA. */
|
|---|
| 92 | s = sin(theta);
|
|---|
| 93 | c = cos(theta);
|
|---|
| 94 |
|
|---|
| 95 | /* Position. */
|
|---|
| 96 | pv[0][0] = c*x - s*y;
|
|---|
| 97 | pv[0][1] = s*x + c*y;
|
|---|
| 98 | pv[0][2] = z;
|
|---|
| 99 |
|
|---|
| 100 | /* Velocity. */
|
|---|
| 101 | pv[1][0] = OM * ( -s*x - c*y );
|
|---|
| 102 | pv[1][1] = OM * ( c*x - s*y );
|
|---|
| 103 | pv[1][2] = 0.0;
|
|---|
| 104 |
|
|---|
| 105 | /* Finished. */
|
|---|
| 106 |
|
|---|
| 107 | /*----------------------------------------------------------------------
|
|---|
| 108 | **
|
|---|
| 109 | ** Copyright (C) 2015
|
|---|
| 110 | ** Standards Of Fundamental Astronomy Board
|
|---|
| 111 | ** of the International Astronomical Union.
|
|---|
| 112 | **
|
|---|
| 113 | ** =====================
|
|---|
| 114 | ** SOFA Software License
|
|---|
| 115 | ** =====================
|
|---|
| 116 | **
|
|---|
| 117 | ** NOTICE TO USER:
|
|---|
| 118 | **
|
|---|
| 119 | ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
|
|---|
| 120 | ** CONDITIONS WHICH APPLY TO ITS USE.
|
|---|
| 121 | **
|
|---|
| 122 | ** 1. The Software is owned by the IAU SOFA Board ("SOFA").
|
|---|
| 123 | **
|
|---|
| 124 | ** 2. Permission is granted to anyone to use the SOFA software for any
|
|---|
| 125 | ** purpose, including commercial applications, free of charge and
|
|---|
| 126 | ** without payment of royalties, subject to the conditions and
|
|---|
| 127 | ** restrictions listed below.
|
|---|
| 128 | **
|
|---|
| 129 | ** 3. You (the user) may copy and distribute SOFA source code to others,
|
|---|
| 130 | ** and use and adapt its code and algorithms in your own software,
|
|---|
| 131 | ** on a world-wide, royalty-free basis. That portion of your
|
|---|
| 132 | ** distribution that does not consist of intact and unchanged copies
|
|---|
| 133 | ** of SOFA source code files is a "derived work" that must comply
|
|---|
| 134 | ** with the following requirements:
|
|---|
| 135 | **
|
|---|
| 136 | ** a) Your work shall be marked or carry a statement that it
|
|---|
| 137 | ** (i) uses routines and computations derived by you from
|
|---|
| 138 | ** software provided by SOFA under license to you; and
|
|---|
| 139 | ** (ii) does not itself constitute software provided by and/or
|
|---|
| 140 | ** endorsed by SOFA.
|
|---|
| 141 | **
|
|---|
| 142 | ** b) The source code of your derived work must contain descriptions
|
|---|
| 143 | ** of how the derived work is based upon, contains and/or differs
|
|---|
| 144 | ** from the original SOFA software.
|
|---|
| 145 | **
|
|---|
| 146 | ** c) The names of all routines in your derived work shall not
|
|---|
| 147 | ** include the prefix "iau" or "sofa" or trivial modifications
|
|---|
| 148 | ** thereof such as changes of case.
|
|---|
| 149 | **
|
|---|
| 150 | ** d) The origin of the SOFA components of your derived work must
|
|---|
| 151 | ** not be misrepresented; you must not claim that you wrote the
|
|---|
| 152 | ** original software, nor file a patent application for SOFA
|
|---|
| 153 | ** software or algorithms embedded in the SOFA software.
|
|---|
| 154 | **
|
|---|
| 155 | ** e) These requirements must be reproduced intact in any source
|
|---|
| 156 | ** distribution and shall apply to anyone to whom you have
|
|---|
| 157 | ** granted a further right to modify the source code of your
|
|---|
| 158 | ** derived work.
|
|---|
| 159 | **
|
|---|
| 160 | ** Note that, as originally distributed, the SOFA software is
|
|---|
| 161 | ** intended to be a definitive implementation of the IAU standards,
|
|---|
| 162 | ** and consequently third-party modifications are discouraged. All
|
|---|
| 163 | ** variations, no matter how minor, must be explicitly marked as
|
|---|
| 164 | ** such, as explained above.
|
|---|
| 165 | **
|
|---|
| 166 | ** 4. You shall not cause the SOFA software to be brought into
|
|---|
| 167 | ** disrepute, either by misuse, or use for inappropriate tasks, or
|
|---|
| 168 | ** by inappropriate modification.
|
|---|
| 169 | **
|
|---|
| 170 | ** 5. The SOFA software is provided "as is" and SOFA makes no warranty
|
|---|
| 171 | ** as to its use or performance. SOFA does not and cannot warrant
|
|---|
| 172 | ** the performance or results which the user may obtain by using the
|
|---|
| 173 | ** SOFA software. SOFA makes no warranties, express or implied, as
|
|---|
| 174 | ** to non-infringement of third party rights, merchantability, or
|
|---|
| 175 | ** fitness for any particular purpose. In no event will SOFA be
|
|---|
| 176 | ** liable to the user for any consequential, incidental, or special
|
|---|
| 177 | ** damages, including any lost profits or lost savings, even if a
|
|---|
| 178 | ** SOFA representative has been advised of such damages, or for any
|
|---|
| 179 | ** claim by any third party.
|
|---|
| 180 | **
|
|---|
| 181 | ** 6. The provision of any version of the SOFA software under the terms
|
|---|
| 182 | ** and conditions specified herein does not imply that future
|
|---|
| 183 | ** versions will also be made available under the same terms and
|
|---|
| 184 | ** conditions.
|
|---|
| 185 | *
|
|---|
| 186 | ** In any published work or commercial product which uses the SOFA
|
|---|
| 187 | ** software directly, acknowledgement (see www.iausofa.org) is
|
|---|
| 188 | ** appreciated.
|
|---|
| 189 | **
|
|---|
| 190 | ** Correspondence concerning SOFA software should be addressed as
|
|---|
| 191 | ** follows:
|
|---|
| 192 | **
|
|---|
| 193 | ** By email: sofa@ukho.gov.uk
|
|---|
| 194 | ** By post: IAU SOFA Center
|
|---|
| 195 | ** HM Nautical Almanac Office
|
|---|
| 196 | ** UK Hydrographic Office
|
|---|
| 197 | ** Admiralty Way, Taunton
|
|---|
| 198 | ** Somerset, TA1 2DN
|
|---|
| 199 | ** United Kingdom
|
|---|
| 200 | **
|
|---|
| 201 | **--------------------------------------------------------------------*/
|
|---|
| 202 |
|
|---|
| 203 | }
|
|---|