source: trunk/FACT++/erfa/src/bp00.c@ 18348

Last change on this file since 18348 was 18348, checked in by tbretz, 9 years ago
File size: 6.9 KB
Line 
1#include "erfa.h"
2
3void eraBp00(double date1, double date2,
4 double rb[3][3], double rp[3][3], double rbp[3][3])
5/*
6** - - - - - - - -
7** e r a B p 0 0
8** - - - - - - - -
9**
10** Frame bias and precession, IAU 2000.
11**
12** Given:
13** date1,date2 double TT as a 2-part Julian Date (Note 1)
14**
15** Returned:
16** rb double[3][3] frame bias matrix (Note 2)
17** rp double[3][3] precession matrix (Note 3)
18** rbp double[3][3] bias-precession matrix (Note 4)
19**
20** Notes:
21**
22** 1) The TT date date1+date2 is a Julian Date, apportioned in any
23** convenient way between the two arguments. For example,
24** JD(TT)=2450123.7 could be expressed in any of these ways,
25** among others:
26**
27** date1 date2
28**
29** 2450123.7 0.0 (JD method)
30** 2451545.0 -1421.3 (J2000 method)
31** 2400000.5 50123.2 (MJD method)
32** 2450123.5 0.2 (date & time method)
33**
34** The JD method is the most natural and convenient to use in
35** cases where the loss of several decimal digits of resolution
36** is acceptable. The J2000 method is best matched to the way
37** the argument is handled internally and will deliver the
38** optimum resolution. The MJD method and the date & time methods
39** are both good compromises between resolution and convenience.
40**
41** 2) The matrix rb transforms vectors from GCRS to mean J2000.0 by
42** applying frame bias.
43**
44** 3) The matrix rp transforms vectors from J2000.0 mean equator and
45** equinox to mean equator and equinox of date by applying
46** precession.
47**
48** 4) The matrix rbp transforms vectors from GCRS to mean equator and
49** equinox of date by applying frame bias then precession. It is
50** the product rp x rb.
51**
52** 5) It is permissible to re-use the same array in the returned
53** arguments. The arrays are filled in the order given.
54**
55** Called:
56** eraBi00 frame bias components, IAU 2000
57** eraPr00 IAU 2000 precession adjustments
58** eraIr initialize r-matrix to identity
59** eraRx rotate around X-axis
60** eraRy rotate around Y-axis
61** eraRz rotate around Z-axis
62** eraCr copy r-matrix
63** eraRxr product of two r-matrices
64**
65** Reference:
66** "Expressions for the Celestial Intermediate Pole and Celestial
67** Ephemeris Origin consistent with the IAU 2000A precession-
68** nutation model", Astron.Astrophys. 400, 1145-1154 (2003)
69**
70** n.b. The celestial ephemeris origin (CEO) was renamed "celestial
71** intermediate origin" (CIO) by IAU 2006 Resolution 2.
72**
73** Copyright (C) 2013-2015, NumFOCUS Foundation.
74** Derived, with permission, from the SOFA library. See notes at end of file.
75*/
76{
77/* J2000.0 obliquity (Lieske et al. 1977) */
78 const double EPS0 = 84381.448 * ERFA_DAS2R;
79
80 double t, dpsibi, depsbi, dra0, psia77, oma77, chia,
81 dpsipr, depspr, psia, oma, rbw[3][3];
82
83/* Interval between fundamental epoch J2000.0 and current date (JC). */
84 t = ((date1 - ERFA_DJ00) + date2) / ERFA_DJC;
85
86/* Frame bias. */
87 eraBi00(&dpsibi, &depsbi, &dra0);
88
89/* Precession angles (Lieske et al. 1977) */
90 psia77 = (5038.7784 + (-1.07259 + (-0.001147) * t) * t) * t * ERFA_DAS2R;
91 oma77 = EPS0 + ((0.05127 + (-0.007726) * t) * t) * t * ERFA_DAS2R;
92 chia = ( 10.5526 + (-2.38064 + (-0.001125) * t) * t) * t * ERFA_DAS2R;
93
94/* Apply IAU 2000 precession corrections. */
95 eraPr00(date1, date2, &dpsipr, &depspr);
96 psia = psia77 + dpsipr;
97 oma = oma77 + depspr;
98
99/* Frame bias matrix: GCRS to J2000.0. */
100 eraIr(rbw);
101 eraRz(dra0, rbw);
102 eraRy(dpsibi*sin(EPS0), rbw);
103 eraRx(-depsbi, rbw);
104 eraCr(rbw, rb);
105
106/* Precession matrix: J2000.0 to mean of date. */
107 eraIr(rp);
108 eraRx(EPS0, rp);
109 eraRz(-psia, rp);
110 eraRx(-oma, rp);
111 eraRz(chia, rp);
112
113/* Bias-precession matrix: GCRS to mean of date. */
114 eraRxr(rp, rbw, rbp);
115
116 return;
117
118}
119/*----------------------------------------------------------------------
120**
121**
122** Copyright (C) 2013-2015, NumFOCUS Foundation.
123** All rights reserved.
124**
125** This library is derived, with permission, from the International
126** Astronomical Union's "Standards of Fundamental Astronomy" library,
127** available from http://www.iausofa.org.
128**
129** The ERFA version is intended to retain identical functionality to
130** the SOFA library, but made distinct through different function and
131** file names, as set out in the SOFA license conditions. The SOFA
132** original has a role as a reference standard for the IAU and IERS,
133** and consequently redistribution is permitted only in its unaltered
134** state. The ERFA version is not subject to this restriction and
135** therefore can be included in distributions which do not support the
136** concept of "read only" software.
137**
138** Although the intent is to replicate the SOFA API (other than
139** replacement of prefix names) and results (with the exception of
140** bugs; any that are discovered will be fixed), SOFA is not
141** responsible for any errors found in this version of the library.
142**
143** If you wish to acknowledge the SOFA heritage, please acknowledge
144** that you are using a library derived from SOFA, rather than SOFA
145** itself.
146**
147**
148** TERMS AND CONDITIONS
149**
150** Redistribution and use in source and binary forms, with or without
151** modification, are permitted provided that the following conditions
152** are met:
153**
154** 1 Redistributions of source code must retain the above copyright
155** notice, this list of conditions and the following disclaimer.
156**
157** 2 Redistributions in binary form must reproduce the above copyright
158** notice, this list of conditions and the following disclaimer in
159** the documentation and/or other materials provided with the
160** distribution.
161**
162** 3 Neither the name of the Standards Of Fundamental Astronomy Board,
163** the International Astronomical Union nor the names of its
164** contributors may be used to endorse or promote products derived
165** from this software without specific prior written permission.
166**
167** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
168** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
169** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
170** FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
171** COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
172** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
173** BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
174** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
175** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
176** LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
177** ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
178** POSSIBILITY OF SUCH DAMAGE.
179**
180*/
Note: See TracBrowser for help on using the repository browser.