| 1 | #include "sofa.h"
|
|---|
| 2 |
|
|---|
| 3 | int iauAtio13(double ri, double di,
|
|---|
| 4 | double utc1, double utc2, double dut1,
|
|---|
| 5 | double elong, double phi, double hm, double xp, double yp,
|
|---|
| 6 | double phpa, double tc, double rh, double wl,
|
|---|
| 7 | double *aob, double *zob, double *hob,
|
|---|
| 8 | double *dob, double *rob)
|
|---|
| 9 | /*
|
|---|
| 10 | ** - - - - - - - - - -
|
|---|
| 11 | ** i a u A t i o 1 3
|
|---|
| 12 | ** - - - - - - - - - -
|
|---|
| 13 | **
|
|---|
| 14 | ** CIRS RA,Dec to observed place. The caller supplies UTC, site
|
|---|
| 15 | ** coordinates, ambient air conditions and observing wavelength.
|
|---|
| 16 | **
|
|---|
| 17 | ** This function is part of the International Astronomical Union's
|
|---|
| 18 | ** SOFA (Standards of Fundamental Astronomy) software collection.
|
|---|
| 19 | **
|
|---|
| 20 | ** Status: support function.
|
|---|
| 21 | **
|
|---|
| 22 | ** Given:
|
|---|
| 23 | ** ri double CIRS right ascension (CIO-based, radians)
|
|---|
| 24 | ** di double CIRS declination (radians)
|
|---|
| 25 | ** utc1 double UTC as a 2-part...
|
|---|
| 26 | ** utc2 double ...quasi Julian Date (Notes 1,2)
|
|---|
| 27 | ** dut1 double UT1-UTC (seconds, Note 3)
|
|---|
| 28 | ** elong double longitude (radians, east +ve, Note 4)
|
|---|
| 29 | ** phi double geodetic latitude (radians, Note 4)
|
|---|
| 30 | ** hm double height above ellipsoid (m, geodetic Notes 4,6)
|
|---|
| 31 | ** xp,yp double polar motion coordinates (radians, Note 5)
|
|---|
| 32 | ** phpa double pressure at the observer (hPa = mB, Note 6)
|
|---|
| 33 | ** tc double ambient temperature at the observer (deg C)
|
|---|
| 34 | ** rh double relative humidity at the observer (range 0-1)
|
|---|
| 35 | ** wl double wavelength (micrometers, Note 7)
|
|---|
| 36 | **
|
|---|
| 37 | ** Returned:
|
|---|
| 38 | ** aob double* observed azimuth (radians: N=0,E=90)
|
|---|
| 39 | ** zob double* observed zenith distance (radians)
|
|---|
| 40 | ** hob double* observed hour angle (radians)
|
|---|
| 41 | ** dob double* observed declination (radians)
|
|---|
| 42 | ** rob double* observed right ascension (CIO-based, radians)
|
|---|
| 43 | **
|
|---|
| 44 | ** Returned (function value):
|
|---|
| 45 | ** int status: +1 = dubious year (Note 2)
|
|---|
| 46 | ** 0 = OK
|
|---|
| 47 | ** -1 = unacceptable date
|
|---|
| 48 | **
|
|---|
| 49 | ** Notes:
|
|---|
| 50 | **
|
|---|
| 51 | ** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
|
|---|
| 52 | ** convenient way between the two arguments, for example where utc1
|
|---|
| 53 | ** is the Julian Day Number and utc2 is the fraction of a day.
|
|---|
| 54 | **
|
|---|
| 55 | ** However, JD cannot unambiguously represent UTC during a leap
|
|---|
| 56 | ** second unless special measures are taken. The convention in the
|
|---|
| 57 | ** present function is that the JD day represents UTC days whether
|
|---|
| 58 | ** the length is 86399, 86400 or 86401 SI seconds.
|
|---|
| 59 | **
|
|---|
| 60 | ** Applications should use the function iauDtf2d to convert from
|
|---|
| 61 | ** calendar date and time of day into 2-part quasi Julian Date, as
|
|---|
| 62 | ** it implements the leap-second-ambiguity convention just
|
|---|
| 63 | ** described.
|
|---|
| 64 | **
|
|---|
| 65 | ** 2) The warning status "dubious year" flags UTCs that predate the
|
|---|
| 66 | ** introduction of the time scale or that are too far in the
|
|---|
| 67 | ** future to be trusted. See iauDat for further details.
|
|---|
| 68 | **
|
|---|
| 69 | ** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
|
|---|
| 70 | ** one second at the end of each positive UTC leap second,
|
|---|
| 71 | ** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
|
|---|
| 72 | ** practice is under review, and in the future UT1-UTC may grow
|
|---|
| 73 | ** essentially without limit.
|
|---|
| 74 | **
|
|---|
| 75 | ** 4) The geographical coordinates are with respect to the WGS84
|
|---|
| 76 | ** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
|
|---|
| 77 | ** longitude required by the present function is east-positive
|
|---|
| 78 | ** (i.e. right-handed), in accordance with geographical convention.
|
|---|
| 79 | **
|
|---|
| 80 | ** 5) The polar motion xp,yp can be obtained from IERS bulletins. The
|
|---|
| 81 | ** values are the coordinates (in radians) of the Celestial
|
|---|
| 82 | ** Intermediate Pole with respect to the International Terrestrial
|
|---|
| 83 | ** Reference System (see IERS Conventions 2003), measured along the
|
|---|
| 84 | ** meridians 0 and 90 deg west respectively. For many
|
|---|
| 85 | ** applications, xp and yp can be set to zero.
|
|---|
| 86 | **
|
|---|
| 87 | ** 6) If hm, the height above the ellipsoid of the observing station
|
|---|
| 88 | ** in meters, is not known but phpa, the pressure in hPa (=mB), is
|
|---|
| 89 | ** available, an adequate estimate of hm can be obtained from the
|
|---|
| 90 | ** expression
|
|---|
| 91 | **
|
|---|
| 92 | ** hm = -29.3 * tsl * log ( phpa / 1013.25 );
|
|---|
| 93 | **
|
|---|
| 94 | ** where tsl is the approximate sea-level air temperature in K
|
|---|
| 95 | ** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
|
|---|
| 96 | ** 52). Similarly, if the pressure phpa is not known, it can be
|
|---|
| 97 | ** estimated from the height of the observing station, hm, as
|
|---|
| 98 | ** follows:
|
|---|
| 99 | **
|
|---|
| 100 | ** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
|
|---|
| 101 | **
|
|---|
| 102 | ** Note, however, that the refraction is nearly proportional to
|
|---|
| 103 | ** the pressure and that an accurate phpa value is important for
|
|---|
| 104 | ** precise work.
|
|---|
| 105 | **
|
|---|
| 106 | ** 7) The argument wl specifies the observing wavelength in
|
|---|
| 107 | ** micrometers. The transition from optical to radio is assumed to
|
|---|
| 108 | ** occur at 100 micrometers (about 3000 GHz).
|
|---|
| 109 | **
|
|---|
| 110 | ** 8) "Observed" Az,ZD means the position that would be seen by a
|
|---|
| 111 | ** perfect geodetically aligned theodolite. (Zenith distance is
|
|---|
| 112 | ** used rather than altitude in order to reflect the fact that no
|
|---|
| 113 | ** allowance is made for depression of the horizon.) This is
|
|---|
| 114 | ** related to the observed HA,Dec via the standard rotation, using
|
|---|
| 115 | ** the geodetic latitude (corrected for polar motion), while the
|
|---|
| 116 | ** observed HA and RA are related simply through the Earth rotation
|
|---|
| 117 | ** angle and the site longitude. "Observed" RA,Dec or HA,Dec thus
|
|---|
| 118 | ** means the position that would be seen by a perfect equatorial
|
|---|
| 119 | ** with its polar axis aligned to the Earth's axis of rotation.
|
|---|
| 120 | **
|
|---|
| 121 | ** 9) The accuracy of the result is limited by the corrections for
|
|---|
| 122 | ** refraction, which use a simple A*tan(z) + B*tan^3(z) model.
|
|---|
| 123 | ** Providing the meteorological parameters are known accurately and
|
|---|
| 124 | ** there are no gross local effects, the predicted astrometric
|
|---|
| 125 | ** coordinates should be within 0.05 arcsec (optical) or 1 arcsec
|
|---|
| 126 | ** (radio) for a zenith distance of less than 70 degrees, better
|
|---|
| 127 | ** than 30 arcsec (optical or radio) at 85 degrees and better
|
|---|
| 128 | ** than 20 arcmin (optical) or 30 arcmin (radio) at the horizon.
|
|---|
| 129 | **
|
|---|
| 130 | ** 10) The complementary functions iauAtio13 and iauAtoi13 are self-
|
|---|
| 131 | ** consistent to better than 1 microarcsecond all over the
|
|---|
| 132 | ** celestial sphere.
|
|---|
| 133 | **
|
|---|
| 134 | ** 11) It is advisable to take great care with units, as even unlikely
|
|---|
| 135 | ** values of the input parameters are accepted and processed in
|
|---|
| 136 | ** accordance with the models used.
|
|---|
| 137 | **
|
|---|
| 138 | ** Called:
|
|---|
| 139 | ** iauApio13 astrometry parameters, CIRS-observed, 2013
|
|---|
| 140 | ** iauAtioq quick ICRS to observed
|
|---|
| 141 | **
|
|---|
| 142 | ** This revision: 2013 October 9
|
|---|
| 143 | **
|
|---|
| 144 | ** SOFA release 2015-02-09
|
|---|
| 145 | **
|
|---|
| 146 | ** Copyright (C) 2015 IAU SOFA Board. See notes at end.
|
|---|
| 147 | */
|
|---|
| 148 | {
|
|---|
| 149 | int j;
|
|---|
| 150 | iauASTROM astrom;
|
|---|
| 151 |
|
|---|
| 152 | /* Star-independent astrometry parameters for CIRS->observed. */
|
|---|
| 153 | j = iauApio13(utc1, utc2, dut1, elong, phi, hm, xp, yp,
|
|---|
| 154 | phpa, tc, rh, wl, &astrom);
|
|---|
| 155 |
|
|---|
| 156 | /* Abort if bad UTC. */
|
|---|
| 157 | if ( j < 0 ) return j;
|
|---|
| 158 |
|
|---|
| 159 | /* Transform CIRS to observed. */
|
|---|
| 160 | iauAtioq(ri, di, &astrom, aob, zob, hob, dob, rob);
|
|---|
| 161 |
|
|---|
| 162 | /* Return OK/warning status. */
|
|---|
| 163 | return j;
|
|---|
| 164 |
|
|---|
| 165 | /* Finished. */
|
|---|
| 166 |
|
|---|
| 167 | /*----------------------------------------------------------------------
|
|---|
| 168 | **
|
|---|
| 169 | ** Copyright (C) 2015
|
|---|
| 170 | ** Standards Of Fundamental Astronomy Board
|
|---|
| 171 | ** of the International Astronomical Union.
|
|---|
| 172 | **
|
|---|
| 173 | ** =====================
|
|---|
| 174 | ** SOFA Software License
|
|---|
| 175 | ** =====================
|
|---|
| 176 | **
|
|---|
| 177 | ** NOTICE TO USER:
|
|---|
| 178 | **
|
|---|
| 179 | ** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
|
|---|
| 180 | ** CONDITIONS WHICH APPLY TO ITS USE.
|
|---|
| 181 | **
|
|---|
| 182 | ** 1. The Software is owned by the IAU SOFA Board ("SOFA").
|
|---|
| 183 | **
|
|---|
| 184 | ** 2. Permission is granted to anyone to use the SOFA software for any
|
|---|
| 185 | ** purpose, including commercial applications, free of charge and
|
|---|
| 186 | ** without payment of royalties, subject to the conditions and
|
|---|
| 187 | ** restrictions listed below.
|
|---|
| 188 | **
|
|---|
| 189 | ** 3. You (the user) may copy and distribute SOFA source code to others,
|
|---|
| 190 | ** and use and adapt its code and algorithms in your own software,
|
|---|
| 191 | ** on a world-wide, royalty-free basis. That portion of your
|
|---|
| 192 | ** distribution that does not consist of intact and unchanged copies
|
|---|
| 193 | ** of SOFA source code files is a "derived work" that must comply
|
|---|
| 194 | ** with the following requirements:
|
|---|
| 195 | **
|
|---|
| 196 | ** a) Your work shall be marked or carry a statement that it
|
|---|
| 197 | ** (i) uses routines and computations derived by you from
|
|---|
| 198 | ** software provided by SOFA under license to you; and
|
|---|
| 199 | ** (ii) does not itself constitute software provided by and/or
|
|---|
| 200 | ** endorsed by SOFA.
|
|---|
| 201 | **
|
|---|
| 202 | ** b) The source code of your derived work must contain descriptions
|
|---|
| 203 | ** of how the derived work is based upon, contains and/or differs
|
|---|
| 204 | ** from the original SOFA software.
|
|---|
| 205 | **
|
|---|
| 206 | ** c) The names of all routines in your derived work shall not
|
|---|
| 207 | ** include the prefix "iau" or "sofa" or trivial modifications
|
|---|
| 208 | ** thereof such as changes of case.
|
|---|
| 209 | **
|
|---|
| 210 | ** d) The origin of the SOFA components of your derived work must
|
|---|
| 211 | ** not be misrepresented; you must not claim that you wrote the
|
|---|
| 212 | ** original software, nor file a patent application for SOFA
|
|---|
| 213 | ** software or algorithms embedded in the SOFA software.
|
|---|
| 214 | **
|
|---|
| 215 | ** e) These requirements must be reproduced intact in any source
|
|---|
| 216 | ** distribution and shall apply to anyone to whom you have
|
|---|
| 217 | ** granted a further right to modify the source code of your
|
|---|
| 218 | ** derived work.
|
|---|
| 219 | **
|
|---|
| 220 | ** Note that, as originally distributed, the SOFA software is
|
|---|
| 221 | ** intended to be a definitive implementation of the IAU standards,
|
|---|
| 222 | ** and consequently third-party modifications are discouraged. All
|
|---|
| 223 | ** variations, no matter how minor, must be explicitly marked as
|
|---|
| 224 | ** such, as explained above.
|
|---|
| 225 | **
|
|---|
| 226 | ** 4. You shall not cause the SOFA software to be brought into
|
|---|
| 227 | ** disrepute, either by misuse, or use for inappropriate tasks, or
|
|---|
| 228 | ** by inappropriate modification.
|
|---|
| 229 | **
|
|---|
| 230 | ** 5. The SOFA software is provided "as is" and SOFA makes no warranty
|
|---|
| 231 | ** as to its use or performance. SOFA does not and cannot warrant
|
|---|
| 232 | ** the performance or results which the user may obtain by using the
|
|---|
| 233 | ** SOFA software. SOFA makes no warranties, express or implied, as
|
|---|
| 234 | ** to non-infringement of third party rights, merchantability, or
|
|---|
| 235 | ** fitness for any particular purpose. In no event will SOFA be
|
|---|
| 236 | ** liable to the user for any consequential, incidental, or special
|
|---|
| 237 | ** damages, including any lost profits or lost savings, even if a
|
|---|
| 238 | ** SOFA representative has been advised of such damages, or for any
|
|---|
| 239 | ** claim by any third party.
|
|---|
| 240 | **
|
|---|
| 241 | ** 6. The provision of any version of the SOFA software under the terms
|
|---|
| 242 | ** and conditions specified herein does not imply that future
|
|---|
| 243 | ** versions will also be made available under the same terms and
|
|---|
| 244 | ** conditions.
|
|---|
| 245 | *
|
|---|
| 246 | ** In any published work or commercial product which uses the SOFA
|
|---|
| 247 | ** software directly, acknowledgement (see www.iausofa.org) is
|
|---|
| 248 | ** appreciated.
|
|---|
| 249 | **
|
|---|
| 250 | ** Correspondence concerning SOFA software should be addressed as
|
|---|
| 251 | ** follows:
|
|---|
| 252 | **
|
|---|
| 253 | ** By email: sofa@ukho.gov.uk
|
|---|
| 254 | ** By post: IAU SOFA Center
|
|---|
| 255 | ** HM Nautical Almanac Office
|
|---|
| 256 | ** UK Hydrographic Office
|
|---|
| 257 | ** Admiralty Way, Taunton
|
|---|
| 258 | ** Somerset, TA1 2DN
|
|---|
| 259 | ** United Kingdom
|
|---|
| 260 | **
|
|---|
| 261 | **--------------------------------------------------------------------*/
|
|---|
| 262 |
|
|---|
| 263 | }
|
|---|