source: trunk/FACT++/erfa/src/apio.c@ 18350

Last change on this file since 18350 was 18348, checked in by tbretz, 9 years ago
File size: 8.9 KB
Line 
1#include "erfa.h"
2
3void eraApio(double sp, double theta,
4 double elong, double phi, double hm, double xp, double yp,
5 double refa, double refb,
6 eraASTROM *astrom)
7/*
8** - - - - - - - -
9** e r a 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** Given:
18** sp double the TIO locator s' (radians, Note 1)
19** theta double Earth rotation angle (radians)
20** elong double longitude (radians, east +ve, Note 2)
21** phi double geodetic latitude (radians, Note 2)
22** hm double height above ellipsoid (m, geodetic Note 2)
23** xp,yp double polar motion coordinates (radians, Note 3)
24** refa double refraction constant A (radians, Note 4)
25** refb double refraction constant B (radians, Note 4)
26**
27** Returned:
28** astrom eraASTROM* star-independent astrometry parameters:
29** pmt double unchanged
30** eb double[3] unchanged
31** eh double[3] unchanged
32** em double unchanged
33** v double[3] unchanged
34** bm1 double unchanged
35** bpn double[3][3] unchanged
36** along double longitude + s' (radians)
37** xpl double polar motion xp wrt local meridian (radians)
38** ypl double polar motion yp wrt local meridian (radians)
39** sphi double sine of geodetic latitude
40** cphi double cosine of geodetic latitude
41** diurab double magnitude of diurnal aberration vector
42** eral double "local" Earth rotation angle (radians)
43** refa double refraction constant A (radians)
44** refb double refraction constant B (radians)
45**
46** Notes:
47**
48** 1) sp, the TIO locator s', is a tiny quantity needed only by the
49** most precise applications. It can either be set to zero or
50** predicted using the ERFA function eraSp00.
51**
52** 2) The geographical coordinates are with respect to the ERFA_WGS84
53** reference ellipsoid. TAKE CARE WITH THE LONGITUDE SIGN: the
54** longitude required by the present function is east-positive
55** (i.e. right-handed), in accordance with geographical convention.
56**
57** 3) The polar motion xp,yp can be obtained from IERS bulletins. The
58** values are the coordinates (in radians) of the Celestial
59** Intermediate Pole with respect to the International Terrestrial
60** Reference System (see IERS Conventions 2003), measured along the
61** meridians 0 and 90 deg west respectively. For many applications,
62** xp and yp can be set to zero.
63**
64** Internally, the polar motion is stored in a form rotated onto the
65** local meridian.
66**
67** 4) The refraction constants refa and refb are for use in a
68** dZ = A*tan(Z)+B*tan^3(Z) model, where Z is the observed
69** (i.e. refracted) zenith distance and dZ is the amount of
70** refraction.
71**
72** 5) It is advisable to take great care with units, as even unlikely
73** values of the input parameters are accepted and processed in
74** accordance with the models used.
75**
76** 6) In cases where the caller does not wish to provide the Earth
77** rotation information and refraction constants, the function
78** eraApio13 can be used instead of the present function. This
79** starts from UTC and weather readings etc. and computes suitable
80** values using other ERFA functions.
81**
82** 7) This is one of several functions that inserts into the astrom
83** structure star-independent parameters needed for the chain of
84** astrometric transformations ICRS <-> GCRS <-> CIRS <-> observed.
85**
86** The various functions support different classes of observer and
87** portions of the transformation chain:
88**
89** functions observer transformation
90**
91** eraApcg eraApcg13 geocentric ICRS <-> GCRS
92** eraApci eraApci13 terrestrial ICRS <-> CIRS
93** eraApco eraApco13 terrestrial ICRS <-> observed
94** eraApcs eraApcs13 space ICRS <-> GCRS
95** eraAper eraAper13 terrestrial update Earth rotation
96** eraApio eraApio13 terrestrial CIRS <-> observed
97**
98** Those with names ending in "13" use contemporary ERFA models to
99** compute the various ephemerides. The others accept ephemerides
100** supplied by the caller.
101**
102** The transformation from ICRS to GCRS covers space motion,
103** parallax, light deflection, and aberration. From GCRS to CIRS
104** comprises frame bias and precession-nutation. From CIRS to
105** observed takes account of Earth rotation, polar motion, diurnal
106** aberration and parallax (unless subsumed into the ICRS <-> GCRS
107** transformation), and atmospheric refraction.
108**
109** 8) The context structure astrom produced by this function is used by
110** eraAtioq and eraAtoiq.
111**
112** Called:
113** eraPvtob position/velocity of terrestrial station
114** eraAper astrometry parameters: update ERA
115**
116** Copyright (C) 2013-2015, NumFOCUS Foundation.
117** Derived, with permission, from the SOFA library. See notes at end of file.
118*/
119{
120 double sl, cl, pv[2][3];
121
122/* Longitude with adjustment for TIO locator s'. */
123 astrom->along = elong + sp;
124
125/* Polar motion, rotated onto the local meridian. */
126 sl = sin(astrom->along);
127 cl = cos(astrom->along);
128 astrom->xpl = xp*cl - yp*sl;
129 astrom->ypl = xp*sl + yp*cl;
130
131/* Functions of latitude. */
132 astrom->sphi = sin(phi);
133 astrom->cphi = cos(phi);
134
135/* Observer's geocentric position and velocity (m, m/s, CIRS). */
136 eraPvtob(elong, phi, hm, xp, yp, sp, theta, pv);
137
138/* Magnitude of diurnal aberration vector. */
139 astrom->diurab = sqrt(pv[1][0]*pv[1][0]+pv[1][1]*pv[1][1]) / ERFA_CMPS;
140
141/* Refraction constants. */
142 astrom->refa = refa;
143 astrom->refb = refb;
144
145/* Local Earth rotation angle. */
146 eraAper(theta, astrom);
147
148/* Finished. */
149
150}
151/*----------------------------------------------------------------------
152**
153**
154** Copyright (C) 2013-2015, NumFOCUS Foundation.
155** All rights reserved.
156**
157** This library is derived, with permission, from the International
158** Astronomical Union's "Standards of Fundamental Astronomy" library,
159** available from http://www.iausofa.org.
160**
161** The ERFA version is intended to retain identical functionality to
162** the SOFA library, but made distinct through different function and
163** file names, as set out in the SOFA license conditions. The SOFA
164** original has a role as a reference standard for the IAU and IERS,
165** and consequently redistribution is permitted only in its unaltered
166** state. The ERFA version is not subject to this restriction and
167** therefore can be included in distributions which do not support the
168** concept of "read only" software.
169**
170** Although the intent is to replicate the SOFA API (other than
171** replacement of prefix names) and results (with the exception of
172** bugs; any that are discovered will be fixed), SOFA is not
173** responsible for any errors found in this version of the library.
174**
175** If you wish to acknowledge the SOFA heritage, please acknowledge
176** that you are using a library derived from SOFA, rather than SOFA
177** itself.
178**
179**
180** TERMS AND CONDITIONS
181**
182** Redistribution and use in source and binary forms, with or without
183** modification, are permitted provided that the following conditions
184** are met:
185**
186** 1 Redistributions of source code must retain the above copyright
187** notice, this list of conditions and the following disclaimer.
188**
189** 2 Redistributions in binary form must reproduce the above copyright
190** notice, this list of conditions and the following disclaimer in
191** the documentation and/or other materials provided with the
192** distribution.
193**
194** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
195** the International Astronomical Union nor the names of its
196** contributors may be used to endorse or promote products derived
197** from this software without specific prior written permission.
198**
199** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
200** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
201** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
202** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
203** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
204** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
205** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
206** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
207** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
208** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
209** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
210** POSSIBILITY OF SUCH DAMAGE.
211**
212*/
Note: See TracBrowser for help on using the repository browser.