/* * - - - - - - - - * g a l _ s 0 6 * - - - - - - - - * * This routine is part of the General Astrodynamics Library * * Description: * * The CIO locator s, positioning the Celestial Intermediate Origin on * the equator of the Celestial Intermediate Pole, given the CIP's X,Y * coordinates. Compatible with IAU 2006/2000A precession-nutation. * * This routine is an independent translation of a FORTRAN routine * that is part of IAU's SOFA software collection. * * Status: * * canonical model. * * Given: * * date1,date2 d TT as a 2-part Julian Date (Note 1) * x,y d CIP coordinates (Note 3) * * Returned: * * gal_s06 d the CIO locator s in radians (Note 2) * * Notes: * * 1) The TT date date1+date2 is a Julian Date, apportioned in any * convenient way between the two arguments. For example, * JD(TT)=2450123.7 could be expressed in any of these ways, * among others: * * date1 date2 * * 2450123.7 0.0 (JD method) * 2451545.0 -1421.3 (J2000 method) * 2400000.5 50123.2 (MJD method) * 2450123.5 0.2 (date & time method) * * The JD method is the most natural and convenient to use in * cases where the loss of several decimal digits of resolution * is acceptable. The J2000 method is best matched to the way * the argument is handled internally and will deliver the * optimum resolution. The MJD method and the date & time methods * are both good compromises between resolution and convenience. * * 2) The CIO locator s is the difference between the right ascensions * of the same point in two systems: the two systems are the GCRS * and the CIP,CIO, and the point is the ascending node of the * CIP equator. The quantity s remains below 0.1 arcsecond * throughout 1900-2100. * * 3) The series used to compute s is in fact for s+xy/2, where x and y * are the x and y components of the CIP unit vector; this series is * more compact than a direct series for s would be. This routine * requires X,Y to be supplied by the caller, who is responsible for * providing values that are consistent with the supplied date. * * 4) The model is consistent with the "P03" precession (Capitaine et * al. 2003), adopted by IAU 2006 Resolution 1, 2006, and the * IAU 2000A nutation (with P03 adjustments). * * Called: * * gal_fal03 mean anomaly of the Moon * gal_falp03 mean anomaly of the Sun * gal_faf03 mean argument of the latitude of the Moon * gal_fad03 mean elongation of the Moon from the Sun * gal_faom03 mean longitude of the Moon's ascending node * gal_fave03 mean longitude of Venus * gal_fae03 mean longitude of Earth * gal_fapa03 general accumulated precession in longitude * * References: * * Capitaine, N., Wallace, P.T. & Chapront, J., 2003, Astron. * Astrophys. 432, 355 * * McCarthy, D.D., Petit, G. (eds.) 2004, IERS Conventions (2003), * IERS Technical Note No. 32, BKG * * This revision: * * 2007 May 29 ( c version 2008 January 19 ) * * * Copyright (C) 2008 Paul C. L. Willmott. See notes at end. * *----------------------------------------------------------------------- */ #include #include "gal_const.h" #include "gal_s06.h" #include "gal_fal03.h" #include "gal_falp03.h" #include "gal_faf03.h" #include "gal_fad03.h" #include "gal_faom03.h" #include "gal_fave03.h" #include "gal_fae03.h" #include "gal_fapa03.h" double gal_s06 ( double date1, double date2, double x, double y ) { /* * Time since J2000, in Julian centuries */ double t ; /* * Miscellaneous */ int i, j ; double a, s0, s1, s2, s3, s4, s5 ; /* * Fundamental arguments */ double fa[8] ; /* * --------------------- * The series for s+XY/2 * --------------------- */ /* * Number of terms in the series */ #define NSP 6 #define NS0 33 #define NS1 3 #define NS2 25 #define NS3 4 #define NS4 1 /* * Polynomial coefficients */ static const double SP[NSP] = { 94e-6 , 3808.65e-6 , -122.68e-6 , -72574.11e-6 , 27.98e-6 , 15.62e-6 , } ; /* * Coefficients of l,l',F,D,Om,LVe,LE,pA * Argument coefficients for t^0 */ static const int KS0[NS0][8] = { { 0, 0, 0, 0, 1, 0, 0, 0, } , { 0, 0, 0, 0, 2, 0, 0, 0, } , { 0, 0, 2, -2, 3, 0, 0, 0, } , { 0, 0, 2, -2, 1, 0, 0, 0, } , { 0, 0, 2, -2, 2, 0, 0, 0, } , { 0, 0, 2, 0, 3, 0, 0, 0, } , { 0, 0, 2, 0, 1, 0, 0, 0, } , { 0, 0, 0, 0, 3, 0, 0, 0, } , { 0, 1, 0, 0, 1, 0, 0, 0, } , { 0, 1, 0, 0, -1, 0, 0, 0, } , { 1, 0, 0, 0, -1, 0, 0, 0, } , { 1, 0, 0, 0, 1, 0, 0, 0, } , { 0, 1, 2, -2, 3, 0, 0, 0, } , { 0, 1, 2, -2, 1, 0, 0, 0, } , { 0, 0, 4, -4, 4, 0, 0, 0, } , { 0, 0, 1, -1, 1, -8, 12, 0, } , { 0, 0, 2, 0, 0, 0, 0, 0, } , { 0, 0, 2, 0, 2, 0, 0, 0, } , { 1, 0, 2, 0, 3, 0, 0, 0, } , { 1, 0, 2, 0, 1, 0, 0, 0, } , { 0, 0, 2, -2, 0, 0, 0, 0, } , { 0, 1, -2, 2, -3, 0, 0, 0, } , { 0, 1, -2, 2, -1, 0, 0, 0, } , { 0, 0, 0, 0, 0, 8,-13, -1, } , { 0, 0, 0, 2, 0, 0, 0, 0, } , { 2, 0, -2, 0, -1, 0, 0, 0, } , { 0, 1, 2, -2, 2, 0, 0, 0, } , { 1, 0, 0, -2, 1, 0, 0, 0, } , { 1, 0, 0, -2, -1, 0, 0, 0, } , { 0, 0, 4, -2, 4, 0, 0, 0, } , { 0, 0, 2, -2, 4, 0, 0, 0, } , { 1, 0, -2, 0, -3, 0, 0, 0, } , { 1, 0, -2, 0, -1, 0, 0, 0, } , } ; /* * Argument coefficients for t^1 */ static const int KS1[NS1][8] = { { 0, 0, 0, 0, 2, 0, 0, 0, } , { 0, 0, 0, 0, 1, 0, 0, 0, } , { 0, 0, 2, -2, 3, 0, 0, 0, } , } ; /* * Argument coefficients for t^2 */ static const int KS2[NS2][8] = { { 0, 0, 0, 0, 1, 0, 0, 0, } , { 0, 0, 2, -2, 2, 0, 0, 0, } , { 0, 0, 2, 0, 2, 0, 0, 0, } , { 0, 0, 0, 0, 2, 0, 0, 0, } , { 0, 1, 0, 0, 0, 0, 0, 0, } , { 1, 0, 0, 0, 0, 0, 0, 0, } , { 0, 1, 2, -2, 2, 0, 0, 0, } , { 0, 0, 2, 0, 1, 0, 0, 0, } , { 1, 0, 2, 0, 2, 0, 0, 0, } , { 0, 1, -2, 2, -2, 0, 0, 0, } , { 1, 0, 0, -2, 0, 0, 0, 0, } , { 0, 0, 2, -2, 1, 0, 0, 0, } , { 1, 0, -2, 0, -2, 0, 0, 0, } , { 0, 0, 0, 2, 0, 0, 0, 0, } , { 1, 0, 0, 0, 1, 0, 0, 0, } , { 1, 0, -2, -2, -2, 0, 0, 0, } , { 1, 0, 0, 0, -1, 0, 0, 0, } , { 1, 0, 2, 0, 1, 0, 0, 0, } , { 2, 0, 0, -2, 0, 0, 0, 0, } , { 2, 0, -2, 0, -1, 0, 0, 0, } , { 0, 0, 2, 2, 2, 0, 0, 0, } , { 2, 0, 2, 0, 2, 0, 0, 0, } , { 2, 0, 0, 0, 0, 0, 0, 0, } , { 1, 0, 2, -2, 2, 0, 0, 0, } , { 0, 0, 2, 0, 0, 0, 0, 0, } , } ; /* * Argument coefficients for t^3 */ static const int KS3[NS3][8] = { { 0, 0, 0, 0, 1, 0, 0, 0, } , { 0, 0, 2, -2, 2, 0, 0, 0, } , { 0, 0, 2, 0, 2, 0, 0, 0, } , { 0, 0, 0, 0, 2, 0, 0, 0, } , } ; /* * Argument coefficients for t^4 */ static const int KS4[NS4][8] = { { 0, 0, 0, 0, 1, 0, 0, 0, } , } ; /* * Sine and cosine coefficients */ /* * Sine ane cosine coefficients for t^0 */ static const double SS0[NS0][2] = { { -2640.73e-6, +0.39e-6, } , { -63.53e-6, +0.02e-6, } , { -11.75e-6, -0.01e-6, } , { -11.21e-6, -0.01e-6, } , { +4.57e-6, 0.00e-6, } , { -2.02e-6, 0.00e-6, } , { -1.98e-6, 0.00e-6, } , { +1.72e-6, 0.00e-6, } , { +1.41e-6, +0.01e-6, } , { +1.26e-6, +0.01e-6, } , { +0.63e-6, 0.00e-6, } , { +0.63e-6, 0.00e-6, } , { -0.46e-6, 0.00e-6, } , { -0.45e-6, 0.00e-6, } , { -0.36e-6, 0.00e-6, } , { +0.24e-6, +0.12e-6, } , { -0.32e-6, 0.00e-6, } , { -0.28e-6, 0.00e-6, } , { -0.27e-6, 0.00e-6, } , { -0.26e-6, 0.00e-6, } , { +0.21e-6, 0.00e-6, } , { -0.19e-6, 0.00e-6, } , { -0.18e-6, 0.00e-6, } , { +0.10e-6, -0.05e-6, } , { -0.15e-6, 0.00e-6, } , { +0.14e-6, 0.00e-6, } , { +0.14e-6, 0.00e-6, } , { -0.14e-6, 0.00e-6, } , { -0.14e-6, 0.00e-6, } , { -0.13e-6, 0.00e-6, } , { +0.11e-6, 0.00e-6, } , { -0.11e-6, 0.00e-6, } , { -0.11e-6, 0.00e-6, } , } ; /* * Sine ane cosine coefficients for t^1 */ static const double SS1[NS1][2] = { { -0.07e-6, +3.57e-6, } , { +1.73e-6, -0.03e-6, } , { 0.00e-6, +0.48e-6, } , } ; /* * Sine ane cosine coefficients for t^2 */ static const double SS2[NS2][2] = { { +743.52e-6, -0.17e-6, } , { 56.91e-6, +0.06e-6, } , { +9.84e-6, -0.01e-6, } , { -8.85e-6, +0.01e-6, } , { -6.38e-6, -0.05e-6, } , { -3.07e-6, 0.00e-6, } , { +2.23e-6, 0.00e-6, } , { +1.67e-6, 0.00e-6, } , { +1.30e-6, 0.00e-6, } , { +0.93e-6, 0.00e-6, } , { +0.68e-6, 0.00e-6, } , { -0.55e-6, 0.00e-6, } , { +0.53e-6, 0.00e-6, } , { -0.27e-6, 0.00e-6, } , { -0.27e-6, 0.00e-6, } , { -0.26e-6, 0.00e-6, } , { -0.25e-6, 0.00e-6, } , { +0.22e-6, 0.00e-6, } , { -0.21e-6, 0.00e-6, } , { +0.20e-6, 0.00e-6, } , { +0.17e-6, 0.00e-6, } , { +0.13e-6, 0.00e-6, } , { -0.13e-6, 0.00e-6, } , { -0.12e-6, 0.00e-6, } , { -0.11e-6, 0.00e-6, } , } ; /* * Sine ane cosine coefficients for t^3 */ static const double SS3[NS3][2] = { { +0.30e-6, -23.42e-6, } , { -0.03e-6, -1.46e-6, } , { -0.01e-6, -0.25e-6, } , { 0.00e-6, +0.23e-6, } , } ; /* * Sine ane cosine coefficients for t^4 */ static const double SS4[NS4][2] = { { -0.26e-6, -0.01e-6, } , } ; /* * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ /* * Interval between fundamental epoch J2000.0 and current date (JC). */ t = ( ( date1 - GAL_J2000 ) + date2 ) / GAL_DJC ; /* * Fundamental Arguments (from IERS Conventions 2003) */ /* * Mean anomaly of the Moon. */ fa[0] = gal_fal03 ( t ) ; /* * Mean anomaly of the Sun. */ fa[1] = gal_falp03 ( t ) ; /* * Mean longitude of the Moon minus that of the ascending node. */ fa[2] = gal_faf03 ( t ) ; /* * Mean elongation of the Moon from the Sun. */ fa[3] = gal_fad03 ( t ) ; /* * Mean longitude of the ascending node of the Moon. */ fa[4] = gal_faom03 ( t ) ; /* * Mean longitude of Venus. */ fa[5] = gal_fave03 ( t ) ; /* * Mean longitude of Earth. */ fa[6] = gal_fae03 ( t ) ; /* * General precession in longitude. */ fa[7] = gal_fapa03 ( t ) ; /* * Evaluate S. */ s0 = SP[0] ; s1 = SP[1] ; s2 = SP[2] ; s3 = SP[3] ; s4 = SP[4] ; s5 = SP[5] ; for ( i = NS0 - 1; i >= 0; i-- ) { a = 0.0 ; for ( j = 0; j < 8; j++ ) { a += ( double )(KS0[i][j]) * fa[j] ; } s0 += ( SS0[i][0] * sin ( a ) + SS0[i][1] * cos ( a ) ) ; } for ( i = NS1 - 1; i >= 0; i-- ) { a = 0.0 ; for ( j = 0; j < 8; j++ ) { a += ( double )(KS1[i][j]) * fa[j] ; } s1 += ( SS1[i][0] * sin ( a ) + SS1[i][1] * cos ( a ) ) ; } for ( i = NS2 - 1; i >= 0; i-- ) { a = 0.0 ; for ( j = 0; j < 8; j++ ) { a += ( double )(KS2[i][j]) * fa[j] ; } s2 += ( SS2[i][0] * sin ( a ) + SS2[i][1] * cos ( a ) ) ; } for ( i = NS3 - 1; i >= 0; i-- ) { a = 0.0 ; for ( j = 0; j < 8; j++ ) { a += ( double )(KS3[i][j]) * fa[j] ; } s3 += ( SS3[i][0] * sin ( a ) + SS3[i][1] * cos ( a ) ) ; } for ( i = NS4 - 1; i >= 0; i-- ) { a = 0.0 ; for ( j = 0; j < 8; j++ ) { a += ( double )(KS4[i][j]) * fa[j] ; } s4 += ( SS4[i][0] * sin ( a ) + SS4[i][1] * cos ( a ) ) ; } return ( s0 + ( s1 + ( s2 + ( s3 + ( s4 + s5 * t ) * t ) * t ) * t ) * t ) * GAL_AS2R - x * y / 2.0 ; /* * Finished. */ } /* * gal - General Astrodynamics Library * Copyright (C) 2008 Paul C. L. Willmott * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. * * Contact: * * Paul Willmott * vp9mu@amsat.org */