source: trunk/FACT++/sofa/src/apio13.c@ 18375

Last change on this file since 18375 was 18346, checked in by tbretz, 11 years ago
File size: 12.5 KB
Line 
1#include "sofa.h"
2
3int iauApio13(double utc1, double utc2, double dut1,
4 double elong, double phi, double hm, double xp, double yp,
5 double phpa, double tc, double rh, double wl,
6 iauASTROM *astrom)
7/*
8** - - - - - - - - - -
9** i a u A p i o 1 3
10** - - - - - - - - - -
11**
12** For a terrestrial observer, prepare star-independent astrometry
13** parameters for transformations between CIRS and observed
14** coordinates. The caller supplies UTC, site coordinates, ambient air
15** 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** utc1 double UTC as a 2-part...
24** utc2 double ...quasi Julian Date (Notes 1,2)
25** dut1 double UT1-UTC (seconds)
26** elong double longitude (radians, east +ve, Note 3)
27** phi double geodetic latitude (radians, Note 3)
28** hm double height above ellipsoid (m, geodetic Notes 4,6)
29** xp,yp double polar motion coordinates (radians, Note 5)
30** phpa double pressure at the observer (hPa = mB, Note 6)
31** tc double ambient temperature at the observer (deg C)
32** rh double relative humidity at the observer (range 0-1)
33** wl double wavelength (micrometers, Note 7)
34**
35** Returned:
36** astrom iauASTROM* star-independent astrometry parameters:
37** pmt double unchanged
38** eb double[3] unchanged
39** eh double[3] unchanged
40** em double unchanged
41** v double[3] unchanged
42** bm1 double unchanged
43** bpn double[3][3] unchanged
44** along double longitude + s' (radians)
45** xpl double polar motion xp wrt local meridian (radians)
46** ypl double polar motion yp wrt local meridian (radians)
47** sphi double sine of geodetic latitude
48** cphi double cosine of geodetic latitude
49** diurab double magnitude of diurnal aberration vector
50** eral double "local" Earth rotation angle (radians)
51** refa double refraction constant A (radians)
52** refb double refraction constant B (radians)
53**
54** Returned (function value):
55** int status: +1 = dubious year (Note 2)
56** 0 = OK
57** -1 = unacceptable date
58**
59** Notes:
60**
61** 1) utc1+utc2 is quasi Julian Date (see Note 2), apportioned in any
62** convenient way between the two arguments, for example where utc1
63** is the Julian Day Number and utc2 is the fraction of a day.
64**
65** However, JD cannot unambiguously represent UTC during a leap
66** second unless special measures are taken. The convention in the
67** present function is that the JD day represents UTC days whether
68** the length is 86399, 86400 or 86401 SI seconds.
69**
70** Applications should use the function iauDtf2d to convert from
71** calendar date and time of day into 2-part quasi Julian Date, as
72** it implements the leap-second-ambiguity convention just
73** described.
74**
75** 2) The warning status "dubious year" flags UTCs that predate the
76** introduction of the time scale or that are too far in the future
77** to be trusted. See iauDat for further details.
78**
79** 3) UT1-UTC is tabulated in IERS bulletins. It increases by exactly
80** one second at the end of each positive UTC leap second,
81** introduced in order to keep UT1-UTC within +/- 0.9s. n.b. This
82** practice is under review, and in the future UT1-UTC may grow
83** essentially without limit.
84**
85** 4) The geographical coordinates are with respect to the WGS84
86** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
87** longitude required by the present function is east-positive
88** (i.e. right-handed), in accordance with geographical convention.
89**
90** 5) The polar motion xp,yp can be obtained from IERS bulletins. The
91** values are the coordinates (in radians) of the Celestial
92** Intermediate Pole with respect to the International Terrestrial
93** Reference System (see IERS Conventions 2003), measured along the
94** meridians 0 and 90 deg west respectively. For many applications,
95** xp and yp can be set to zero.
96**
97** Internally, the polar motion is stored in a form rotated onto
98** the local meridian.
99**
100** 6) If hm, the height above the ellipsoid of the observing station
101** in meters, is not known but phpa, the pressure in hPa (=mB), is
102** available, an adequate estimate of hm can be obtained from the
103** expression
104**
105** hm = -29.3 * tsl * log ( phpa / 1013.25 );
106**
107** where tsl is the approximate sea-level air temperature in K
108** (See Astrophysical Quantities, C.W.Allen, 3rd edition, section
109** 52). Similarly, if the pressure phpa is not known, it can be
110** estimated from the height of the observing station, hm, as
111** follows:
112**
113** phpa = 1013.25 * exp ( -hm / ( 29.3 * tsl ) );
114**
115** Note, however, that the refraction is nearly proportional to the
116** pressure and that an accurate phpa value is important for
117** precise work.
118**
119** 7) The argument wl specifies the observing wavelength in
120** micrometers. The transition from optical to radio is assumed to
121** occur at 100 micrometers (about 3000 GHz).
122**
123** 8) It is advisable to take great care with units, as even unlikely
124** values of the input parameters are accepted and processed in
125** accordance with the models used.
126**
127** 9) In cases where the caller wishes to supply his own Earth
128** rotation information and refraction constants, the function
129** iauApc can be used instead of the present function.
130**
131** 10) This is one of several functions that inserts into the astrom
132** structure star-independent parameters needed for the chain of
133** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
134**
135** The various functions support different classes of observer and
136** portions of the transformation chain:
137**
138** functions observer transformation
139**
140** iauApcg iauApcg13 geocentric ICRS <-> GCRS
141** iauApci iauApci13 terrestrial ICRS <-> CIRS
142** iauApco iauApco13 terrestrial ICRS <-> observed
143** iauApcs iauApcs13 space ICRS <-> GCRS
144** iauAper iauAper13 terrestrial update Earth rotation
145** iauApio iauApio13 terrestrial CIRS <-> observed
146**
147** Those with names ending in "13" use contemporary SOFA models to
148** compute the various ephemerides. The others accept ephemerides
149** supplied by the caller.
150**
151** The transformation from ICRS to GCRS covers space motion,
152** parallax, light deflection, and aberration. From GCRS to CIRS
153** comprises frame bias and precession-nutation. From CIRS to
154** observed takes account of Earth rotation, polar motion, diurnal
155** aberration and parallax (unless subsumed into the ICRS <-> GCRS
156** transformation), and atmospheric refraction.
157**
158** 11) The context structure astrom produced by this function is used
159** by iauAtioq and iauAtoiq.
160**
161** Called:
162** iauUtctai UTC to TAI
163** iauTaitt TAI to TT
164** iauUtcut1 UTC to UT1
165** iauSp00 the TIO locator s', IERS 2000
166** iauEra00 Earth rotation angle, IAU 2000
167** iauRefco refraction constants for given ambient conditions
168** iauApio astrometry parameters, CIRS-observed
169**
170** This revision: 2013 October 9
171**
172** SOFA release 2015-02-09
173**
174** Copyright (C) 2015 IAU SOFA Board. See notes at end.
175*/
176{
177 int j;
178 double tai1, tai2, tt1, tt2, ut11, ut12, sp, theta, refa, refb;
179
180/* UTC to other time scales. */
181 j = iauUtctai(utc1, utc2, &tai1, &tai2);
182 if ( j < 0 ) return -1;
183 j = iauTaitt(tai1, tai2, &tt1, &tt2);
184 j = iauUtcut1(utc1, utc2, dut1, &ut11, &ut12);
185 if ( j < 0 ) return -1;
186
187/* TIO locator s'. */
188 sp = iauSp00(tt1, tt2);
189
190/* Earth rotation angle. */
191 theta = iauEra00(ut11, ut12);
192
193/* Refraction constants A and B. */
194 iauRefco(phpa, tc, rh, wl, &refa, &refb);
195
196/* CIRS <-> observed astrometry parameters. */
197 iauApio(sp, theta, elong, phi, hm, xp, yp, refa, refb, astrom);
198
199/* Return any warning status. */
200 return j;
201
202/* Finished. */
203
204/*----------------------------------------------------------------------
205**
206** Copyright (C) 2015
207** Standards Of Fundamental Astronomy Board
208** of the International Astronomical Union.
209**
210** =====================
211** SOFA Software License
212** =====================
213**
214** NOTICE TO USER:
215**
216** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
217** CONDITIONS WHICH APPLY TO ITS USE.
218**
219** 1. The Software is owned by the IAU SOFA Board ("SOFA").
220**
221** 2. Permission is granted to anyone to use the SOFA software for any
222** purpose, including commercial applications, free of charge and
223** without payment of royalties, subject to the conditions and
224** restrictions listed below.
225**
226** 3. You (the user) may copy and distribute SOFA source code to others,
227** and use and adapt its code and algorithms in your own software,
228** on a world-wide, royalty-free basis. That portion of your
229** distribution that does not consist of intact and unchanged copies
230** of SOFA source code files is a "derived work" that must comply
231** with the following requirements:
232**
233** a) Your work shall be marked or carry a statement that it
234** (i) uses routines and computations derived by you from
235** software provided by SOFA under license to you; and
236** (ii) does not itself constitute software provided by and/or
237** endorsed by SOFA.
238**
239** b) The source code of your derived work must contain descriptions
240** of how the derived work is based upon, contains and/or differs
241** from the original SOFA software.
242**
243** c) The names of all routines in your derived work shall not
244** include the prefix "iau" or "sofa" or trivial modifications
245** thereof such as changes of case.
246**
247** d) The origin of the SOFA components of your derived work must
248** not be misrepresented; you must not claim that you wrote the
249** original software, nor file a patent application for SOFA
250** software or algorithms embedded in the SOFA software.
251**
252** e) These requirements must be reproduced intact in any source
253** distribution and shall apply to anyone to whom you have
254** granted a further right to modify the source code of your
255** derived work.
256**
257** Note that, as originally distributed, the SOFA software is
258** intended to be a definitive implementation of the IAU standards,
259** and consequently third-party modifications are discouraged. All
260** variations, no matter how minor, must be explicitly marked as
261** such, as explained above.
262**
263** 4. You shall not cause the SOFA software to be brought into
264** disrepute, either by misuse, or use for inappropriate tasks, or
265** by inappropriate modification.
266**
267** 5. The SOFA software is provided "as is" and SOFA makes no warranty
268** as to its use or performance. SOFA does not and cannot warrant
269** the performance or results which the user may obtain by using the
270** SOFA software. SOFA makes no warranties, express or implied, as
271** to non-infringement of third party rights, merchantability, or
272** fitness for any particular purpose. In no event will SOFA be
273** liable to the user for any consequential, incidental, or special
274** damages, including any lost profits or lost savings, even if a
275** SOFA representative has been advised of such damages, or for any
276** claim by any third party.
277**
278** 6. The provision of any version of the SOFA software under the terms
279** and conditions specified herein does not imply that future
280** versions will also be made available under the same terms and
281** conditions.
282*
283** In any published work or commercial product which uses the SOFA
284** software directly, acknowledgement (see www.iausofa.org) is
285** appreciated.
286**
287** Correspondence concerning SOFA software should be addressed as
288** follows:
289**
290** By email: sofa@ukho.gov.uk
291** By post: IAU SOFA Center
292** HM Nautical Almanac Office
293** UK Hydrographic Office
294** Admiralty Way, Taunton
295** Somerset, TA1 2DN
296** United Kingdom
297**
298**--------------------------------------------------------------------*/
299
300}
Note: See TracBrowser for help on using the repository browser.