source: trunk/FACT++/sofa/src/apio.c@ 18355

Last change on this file since 18355 was 18346, checked in by tbretz, 11 years ago
File size: 10.3 KB
Line 
1#include "sofa.h"
2
3void iauApio(double sp, double theta,
4 double elong, double phi, double hm, double xp, double yp,
5 double refa, double refb,
6 iauASTROM *astrom)
7/*
8** - - - - - - - -
9** i a u A p i o
10** - - - - - - - -
11**
12** For a terrestrial observer, prepare star-independent astrometry
13** parameters for transformations between CIRS and observed
14** coordinates. The caller supplies the Earth orientation information
15** and the refraction constants as well as the site coordinates.
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** sp double the TIO locator s' (radians, Note 1)
24** theta double Earth rotation angle (radians)
25** elong double longitude (radians, east +ve, Note 2)
26** phi double geodetic latitude (radians, Note 2)
27** hm double height above ellipsoid (m, geodetic Note 2)
28** xp,yp double polar motion coordinates (radians, Note 3)
29** refa double refraction constant A (radians, Note 4)
30** refb double refraction constant B (radians, Note 4)
31**
32** Returned:
33** astrom iauASTROM* star-independent astrometry parameters:
34** pmt double unchanged
35** eb double[3] unchanged
36** eh double[3] unchanged
37** em double unchanged
38** v double[3] unchanged
39** bm1 double unchanged
40** bpn double[3][3] unchanged
41** along double longitude + s' (radians)
42** xpl double polar motion xp wrt local meridian (radians)
43** ypl double polar motion yp wrt local meridian (radians)
44** sphi double sine of geodetic latitude
45** cphi double cosine of geodetic latitude
46** diurab double magnitude of diurnal aberration vector
47** eral double "local" Earth rotation angle (radians)
48** refa double refraction constant A (radians)
49** refb double refraction constant B (radians)
50**
51** Notes:
52**
53** 1) sp, the TIO locator s', is a tiny quantity needed only by the
54** most precise applications. It can either be set to zero or
55** predicted using the SOFA function iauSp00.
56**
57** 2) The geographical coordinates are with respect to the WGS84
58** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
59** longitude required by the present function is east-positive
60** (i.e. right-handed), in accordance with geographical convention.
61**
62** 3) The polar motion xp,yp can be obtained from IERS bulletins. The
63** values are the coordinates (in radians) of the Celestial
64** Intermediate Pole with respect to the International Terrestrial
65** Reference System (see IERS Conventions 2003), measured along the
66** meridians 0 and 90 deg west respectively. For many applications,
67** xp and yp can be set to zero.
68**
69** Internally, the polar motion is stored in a form rotated onto the
70** local meridian.
71**
72** 4) The refraction constants refa and refb are for use in a
73** dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
74** (i.e. refracted) zenith distance and dZ is the amount of
75** refraction.
76**
77** 5) It is advisable to take great care with units, as even unlikely
78** values of the input parameters are accepted and processed in
79** accordance with the models used.
80**
81** 6) In cases where the caller does not wish to provide the Earth
82** rotation information and refraction constants, the function
83** iauApio13 can be used instead of the present function. This
84** starts from UTC and weather readings etc. and computes suitable
85** values using other SOFA functions.
86**
87** 7) This is one of several functions that inserts into the astrom
88** structure star-independent parameters needed for the chain of
89** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
90**
91** The various functions support different classes of observer and
92** portions of the transformation chain:
93**
94** functions observer transformation
95**
96** iauApcg iauApcg13 geocentric ICRS <-> GCRS
97** iauApci iauApci13 terrestrial ICRS <-> CIRS
98** iauApco iauApco13 terrestrial ICRS <-> observed
99** iauApcs iauApcs13 space ICRS <-> GCRS
100** iauAper iauAper13 terrestrial update Earth rotation
101** iauApio iauApio13 terrestrial CIRS <-> observed
102**
103** Those with names ending in "13" use contemporary SOFA models to
104** compute the various ephemerides. The others accept ephemerides
105** supplied by the caller.
106**
107** The transformation from ICRS to GCRS covers space motion,
108** parallax, light deflection, and aberration. From GCRS to CIRS
109** comprises frame bias and precession-nutation. From CIRS to
110** observed takes account of Earth rotation, polar motion, diurnal
111** aberration and parallax (unless subsumed into the ICRS <-> GCRS
112** transformation), and atmospheric refraction.
113**
114** 8) The context structure astrom produced by this function is used by
115** iauAtioq and iauAtoiq.
116**
117** Called:
118** iauPvtob position/velocity of terrestrial station
119** iauAper astrometry parameters: update ERA
120**
121** This revision: 2013 October 9
122**
123** SOFA release 2015-02-09
124**
125** Copyright (C) 2015 IAU SOFA Board. See notes at end.
126*/
127{
128 double sl, cl, pv[2][3];
129
130/* Longitude with adjustment for TIO locator s'. */
131 astrom->along = elong + sp;
132
133/* Polar motion, rotated onto the local meridian. */
134 sl = sin(astrom->along);
135 cl = cos(astrom->along);
136 astrom->xpl = xp*cl - yp*sl;
137 astrom->ypl = xp*sl + yp*cl;
138
139/* Functions of latitude. */
140 astrom->sphi = sin(phi);
141 astrom->cphi = cos(phi);
142
143/* Observer's geocentric position and velocity (m, m/s, CIRS). */
144 iauPvtob(elong, phi, hm, xp, yp, sp, theta, pv);
145
146/* Magnitude of diurnal aberration vector. */
147 astrom->diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / CMPS;
148
149/* Refraction constants. */
150 astrom->refa = refa;
151 astrom->refb = refb;
152
153/* Local Earth rotation angle. */
154 iauAper(theta, astrom);
155
156/* Finished. */
157
158/*----------------------------------------------------------------------
159**
160** Copyright (C) 2015
161** Standards Of Fundamental Astronomy Board
162** of the International Astronomical Union.
163**
164** =====================
165** SOFA Software License
166** =====================
167**
168** NOTICE TO USER:
169**
170** BY USING THIS SOFTWARE YOU ACCEPT THE FOLLOWING SIX TERMS AND
171** CONDITIONS WHICH APPLY TO ITS USE.
172**
173** 1. The Software is owned by the IAU SOFA Board ("SOFA").
174**
175** 2. Permission is granted to anyone to use the SOFA software for any
176** purpose, including commercial applications, free of charge and
177** without payment of royalties, subject to the conditions and
178** restrictions listed below.
179**
180** 3. You (the user) may copy and distribute SOFA source code to others,
181** and use and adapt its code and algorithms in your own software,
182** on a world-wide, royalty-free basis. That portion of your
183** distribution that does not consist of intact and unchanged copies
184** of SOFA source code files is a "derived work" that must comply
185** with the following requirements:
186**
187** a) Your work shall be marked or carry a statement that it
188** (i) uses routines and computations derived by you from
189** software provided by SOFA under license to you; and
190** (ii) does not itself constitute software provided by and/or
191** endorsed by SOFA.
192**
193** b) The source code of your derived work must contain descriptions
194** of how the derived work is based upon, contains and/or differs
195** from the original SOFA software.
196**
197** c) The names of all routines in your derived work shall not
198** include the prefix "iau" or "sofa" or trivial modifications
199** thereof such as changes of case.
200**
201** d) The origin of the SOFA components of your derived work must
202** not be misrepresented; you must not claim that you wrote the
203** original software, nor file a patent application for SOFA
204** software or algorithms embedded in the SOFA software.
205**
206** e) These requirements must be reproduced intact in any source
207** distribution and shall apply to anyone to whom you have
208** granted a further right to modify the source code of your
209** derived work.
210**
211** Note that, as originally distributed, the SOFA software is
212** intended to be a definitive implementation of the IAU standards,
213** and consequently third-party modifications are discouraged. All
214** variations, no matter how minor, must be explicitly marked as
215** such, as explained above.
216**
217** 4. You shall not cause the SOFA software to be brought into
218** disrepute, either by misuse, or use for inappropriate tasks, or
219** by inappropriate modification.
220**
221** 5. The SOFA software is provided "as is" and SOFA makes no warranty
222** as to its use or performance. SOFA does not and cannot warrant
223** the performance or results which the user may obtain by using the
224** SOFA software. SOFA makes no warranties, express or implied, as
225** to non-infringement of third party rights, merchantability, or
226** fitness for any particular purpose. In no event will SOFA be
227** liable to the user for any consequential, incidental, or special
228** damages, including any lost profits or lost savings, even if a
229** SOFA representative has been advised of such damages, or for any
230** claim by any third party.
231**
232** 6. The provision of any version of the SOFA software under the terms
233** and conditions specified herein does not imply that future
234** versions will also be made available under the same terms and
235** conditions.
236*
237** In any published work or commercial product which uses the SOFA
238** software directly, acknowledgement (see www.iausofa.org) is
239** appreciated.
240**
241** Correspondence concerning SOFA software should be addressed as
242** follows:
243**
244** By email: sofa@ukho.gov.uk
245** By post: IAU SOFA Center
246** HM Nautical Almanac Office
247** UK Hydrographic Office
248** Admiralty Way, Taunton
249** Somerset, TA1 2DN
250** United Kingdom
251**
252**--------------------------------------------------------------------*/
253
254}
Note: See TracBrowser for help on using the repository browser.