source: trunk/FACT++/sofa/src/atoc13.c@ 18365

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