From 0a1aa610b2ba4530ba0f1653ffafd1cc0d3a1a73 Mon Sep 17 00:00:00 2001 From: Yanos Date: Sat, 7 Jun 2014 09:31:58 +0200 Subject: [PATCH 1/3] Prepare Nutation. --- SwephNet/SwephNet/Houses/SweHouse.cs | 1 + SwephNet/SwephNet/SweLib.cs | 75 ++++++++++++++-------------- 2 files changed, 39 insertions(+), 37 deletions(-) diff --git a/SwephNet/SwephNet/Houses/SweHouse.cs b/SwephNet/SwephNet/Houses/SweHouse.cs index e0ec846..3a0f3ee 100644 --- a/SwephNet/SwephNet/Houses/SweHouse.cs +++ b/SwephNet/SwephNet/Houses/SweHouse.cs @@ -118,6 +118,7 @@ public Houses.HouseResult Houses(JulianDay day, GeoPosition position, HouseSyste // double armc, eps; double[] nutlo = new double[2]; var jde = _Sweph.EphemerisTime(day); var eps = SweLib.Epsiln(jde, 0) * SweLib.RADTODEG; + var nutlo = SweLib.Nutation(jde, JPL.JplHorizonMode.None); // SE.SwephLib.swi_nutation(tjde, 0, nutlo); // for (i = 0; i < 2; i++) // nutlo[i] *= SwissEph.RADTODEG; diff --git a/SwephNet/SwephNet/SweLib.cs b/SwephNet/SwephNet/SweLib.cs index 6461985..128f350 100644 --- a/SwephNet/SwephNet/SweLib.cs +++ b/SwephNet/SwephNet/SweLib.cs @@ -318,43 +318,44 @@ internal static double Epsiln(double jd, JPL.JplHorizonMode horizons) #region Nutation in longitude and obliquity - //internal double[] Nutation(double J, JPL.JplHorizonMode jplMode) - //{ - // double[] result; - // if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0 && IncludeCodeForDpsiDepsIAU1980) - // { - // result = NutationIAU1980(J); - // } - // else if (NUT_IAU_1980) - // { - // result = NutationIAU1980(J); - // } - // else if (NUT_IAU_2000A || NUT_IAU_2000B) - // { - // result = NutationIAU2000ab(J); - // /*if ((iflag & SEFLG_JPLHOR_APPROX) && FRAME_BIAS_APPROX_HORIZONS) {*/ - // if ((jplMode & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) - // { - // result[0] += -41.7750 / 3600.0 / 1000.0 * DEGTORAD; - // result[1] += -6.8192 / 3600.0 / 1000.0 * DEGTORAD; - // } - // } - // if (IncludeCodeForDpsiDepsIAU1980) - // { - // if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0) - // { - // double n = (int)(swed.eop_tjd_end - swed.eop_tjd_beg + 0.000001); - // double J2 = J; - // if (J < swed.eop_tjd_beg_horizons) - // J2 = swed.eop_tjd_beg_horizons; - // double dpsi = bessel(swed.dpsi, n + 1, J2 - swed.eop_tjd_beg); - // double deps = bessel(swed.deps, n + 1, J2 - swed.eop_tjd_beg); - // result[0] += dpsi / 3600.0 * DEGTORAD; - // result[1] += deps / 3600.0 * DEGTORAD; - // } - // } - // return result; - //} + internal static double[] Nutation(double J, JPL.JplHorizonMode jplMode) + { + throw new NotImplementedException("SweLib.Nutation()"); + // double[] result; + // if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0 && IncludeCodeForDpsiDepsIAU1980) + // { + // result = NutationIAU1980(J); + // } + // else if (NUT_IAU_1980) + // { + // result = NutationIAU1980(J); + // } + // else if (NUT_IAU_2000A || NUT_IAU_2000B) + // { + // result = NutationIAU2000ab(J); + // /*if ((iflag & SEFLG_JPLHOR_APPROX) && FRAME_BIAS_APPROX_HORIZONS) {*/ + // if ((jplMode & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) + // { + // result[0] += -41.7750 / 3600.0 / 1000.0 * DEGTORAD; + // result[1] += -6.8192 / 3600.0 / 1000.0 * DEGTORAD; + // } + // } + // if (IncludeCodeForDpsiDepsIAU1980) + // { + // if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0) + // { + // double n = (int)(swed.eop_tjd_end - swed.eop_tjd_beg + 0.000001); + // double J2 = J; + // if (J < swed.eop_tjd_beg_horizons) + // J2 = swed.eop_tjd_beg_horizons; + // double dpsi = bessel(swed.dpsi, n + 1, J2 - swed.eop_tjd_beg); + // double deps = bessel(swed.deps, n + 1, J2 - swed.eop_tjd_beg); + // result[0] += dpsi / 3600.0 * DEGTORAD; + // result[1] += deps / 3600.0 * DEGTORAD; + // } + // } + // return result; + } #endregion From 315f47b019b54365e21e966d34d38565e69e0b16 Mon Sep 17 00:00:00 2001 From: Yanos Date: Sat, 7 Jun 2014 11:35:50 +0200 Subject: [PATCH 2/3] Nutation implemented. --- SwephNet/SwephNet/Houses/SweHouse.cs | 9 +- SwephNet/SwephNet/ISwephData.cs | 25 + SwephNet/SwephNet/Lib/SweLib.cs | 1119 ++++++++++ SwephNet/SwephNet/Lib/SweNut200a.cs | 2809 ++++++++++++++++++++++++++ SwephNet/SwephNet/SweLib.cs | 429 ---- SwephNet/SwephNet/Sweph.cs | 41 +- SwephNet/SwephNet/SwephNet.csproj | 4 +- 7 files changed, 4000 insertions(+), 436 deletions(-) create mode 100644 SwephNet/SwephNet/ISwephData.cs create mode 100644 SwephNet/SwephNet/Lib/SweLib.cs create mode 100644 SwephNet/SwephNet/Lib/SweNut200a.cs delete mode 100644 SwephNet/SwephNet/SweLib.cs diff --git a/SwephNet/SwephNet/Houses/SweHouse.cs b/SwephNet/SwephNet/Houses/SweHouse.cs index 3a0f3ee..59ddecc 100644 --- a/SwephNet/SwephNet/Houses/SweHouse.cs +++ b/SwephNet/SwephNet/Houses/SweHouse.cs @@ -118,11 +118,10 @@ public Houses.HouseResult Houses(JulianDay day, GeoPosition position, HouseSyste // double armc, eps; double[] nutlo = new double[2]; var jde = _Sweph.EphemerisTime(day); var eps = SweLib.Epsiln(jde, 0) * SweLib.RADTODEG; - var nutlo = SweLib.Nutation(jde, JPL.JplHorizonMode.None); - // SE.SwephLib.swi_nutation(tjde, 0, nutlo); - // for (i = 0; i < 2; i++) - // nutlo[i] *= SwissEph.RADTODEG; - // armc = SE.swe_degnorm(SE.swe_sidtime0(tjd_ut, eps + nutlo[1], nutlo[0]) * 15 + geolon); + var nutlo = _Sweph.Lib.Nutation(jde, JPL.JplHorizonMode.None); + for (int i = 0; i < 2; i++) + nutlo[i] *= SweLib.RADTODEG; + //armc = SE.swe_degnorm(SE.swe_sidtime0(tjd_ut, eps + nutlo[1], nutlo[0]) * 15 + geolon); //#if TRACE // //swi_open_trace(NULL); // //if (swi_trace_count <= TRACE_COUNT_MAX) { diff --git a/SwephNet/SwephNet/ISwephData.cs b/SwephNet/SwephNet/ISwephData.cs new file mode 100644 index 0000000..910e31b --- /dev/null +++ b/SwephNet/SwephNet/ISwephData.cs @@ -0,0 +1,25 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SwephNet +{ + /// + /// Data + /// + public interface ISwephData + { + double EopTjdBeg { get; } + double EopTjdBeg_horizons { get; } + double EopTjdEnd { get; } + double EopTjdEnd_add { get; } + bool EopDpsiLoaded { get; } + + /// + /// works for 100 years after 1962 + /// + double[] Dpsi { get; } + double[] Deps { get; } + } +} diff --git a/SwephNet/SwephNet/Lib/SweLib.cs b/SwephNet/SwephNet/Lib/SweLib.cs new file mode 100644 index 0000000..dce9361 --- /dev/null +++ b/SwephNet/SwephNet/Lib/SweLib.cs @@ -0,0 +1,1119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SwephNet +{ + /// + /// Library + /// + public class SweLib + { + #region Embedded types + + /// + /// Precession coefficients for remote past and future. + /// + public enum PrecessionCoefficients + { + Vondrak2011, + Williams1994, + Simon1994, + Laskar1986, + Bretagnon2003, + } + + /// + /// IAU precession 1976 or 2003 for recent centuries. + /// + public enum PrecessionIAU + { + None, + IAU_1976, + IAU_2000, + /// + /// precession model P03 + /// + IAU_2006 + } + + /// + /// Nutation models + /// + public enum NutationModel + { + None, + IAU_1980, + /// + /// very time consuming ! + /// + IAU_2000A, + /// + /// fast, but precision of milli-arcsec + /// + IAU_2000B + } + + #endregion + + #region Constants + + /// + /// Value to convert Degrees to Radian + /// + public const double DEGTORAD = 0.0174532925199433; + + /// + /// Value to convert Radian to Degrees + /// + public const double RADTODEG = 57.2957795130823; + + /// + /// PI * 2 + /// + public const Double TWOPI = Math.PI * 2.0; + + /// + /// J2000 +/- two centuries + /// + const double PrecessionIAU_1976_Centuries = 2.0; + /// + /// J2000 +/- two centuries + /// + const double PrecessionIAU_2000_Centuries = 2.0; + /// + /// J2000 +/- 75 centuries + /// + /// + /// we use P03 for whole ephemeris + /// + const double PrecessionIAU_2006_Centuries = 75.0; + + #endregion + + ISwephData _Swed; + + /// + /// New library + /// + public SweLib(ISwephData swed) + { + _Swed = swed; + } + + #region Calculation tools + + /// + /// Reduce x modulo 360 degrees + /// + public static double DegNorm(double x) + { + double y; + y = (x % 360.0); + if (Math.Abs(y) < 1e-13) y = 0; // Alois fix 11-dec-1999 + if (y < 0.0) y += 360.0; + return (y); + } + + /// + /// Reduce x modulo TWOPI degrees + /// + public static double RadNorm(double x) + { + double y; + y = (x % TWOPI); + if (Math.Abs(y) < 1e-13) y = 0; /* Alois fix 11-dec-1999 */ + if (y < 0.0) y += TWOPI; + return (y); + } + + /// + /// Convert a degrees value to radians + /// + public static double DegToRad(double x) + { + return x * DEGTORAD; + } + + #endregion + + #region Precession and ecliptic obliquity + + const double AS2R = (DEGTORAD / 3600.0); + const double D2PI = Math.PI * 2.0; + const double EPS0 = (84381.406 * AS2R); + const int NPOL_PEPS = 4; + const int NPER_PEPS = 10; + const int NPOL_PECL = 4; + const int NPER_PECL = 8; + const int NPOL_PEQU = 4; + const int NPER_PEQU = 14; + + /// + /// for pre_peps(): polynomials + /// + static double[,] pepol = new double[,]{ + {+8134.017132, +84028.206305}, + {+5043.0520035, +0.3624445}, + {-0.00710733, -0.00004039}, + {+0.000000271, -0.000000110} + }; + + /// + /// for pre_peps(): periodics + /// + static double[,] peper = new double[,]{ + {+409.90, +396.15, +537.22, +402.90, +417.15, +288.92, +4043.00, +306.00, +277.00, +203.00}, + {-6908.287473, -3198.706291, +1453.674527, -857.748557, +1173.231614, -156.981465, +371.836550, -216.619040, +193.691479, +11.891524}, + {+753.872780, -247.805823, +379.471484, -53.880558, -90.109153, -353.600190, -63.115353, -28.248187, +17.703387, +38.911307}, + {-2845.175469, +449.844989, -1255.915323, +886.736783, +418.887514, +997.912441, -240.979710, +76.541307, -36.788069, -170.964086}, + {-1704.720302, -862.308358, +447.832178, -889.571909, +190.402846, -56.564991, -296.222622, -75.859952, +67.473503, +3.014055} + }; + + /// + /// for pre_pecl(): polynomials + /// + static double[,] pqpol = new double[,]{ + {+5851.607687, -1600.886300}, + {-0.1189000, +1.1689818}, + {-0.00028913, -0.00000020}, + {+0.000000101, -0.000000437} + }; + + /// + /// for pre_pecl(): periodics + /// + static double[,] pqper = new double[,]{ + {708.15, 2309, 1620, 492.2, 1183, 622, 882, 547}, + {-5486.751211, -17.127623, -617.517403, 413.44294, 78.614193, -180.732815, -87.676083, 46.140315}, + {-684.66156, 2446.28388, 399.671049, -356.652376, -186.387003, -316.80007, 198.296701, 101.135679}, /* typo in publication fixed */ + {667.66673, -2354.886252, -428.152441, 376.202861, 184.778874, 335.321713, -185.138669, -120.97283}, + {-5523.863691, -549.74745, -310.998056, 421.535876, -36.776172, -145.278396, -34.74445, 22.885731} + }; + + /// + /// for pre_pequ(): polynomials + /// + static double[,] xypol = new double[,]{ + {+5453.282155, -73750.930350}, + {+0.4252841, -0.7675452}, + {-0.00037173, -0.00018725}, + {-0.000000152, +0.000000231} + }; + + /// + /// for pre_pequ(): periodics + /// + static double[,] xyper = new double[,]{ + {256.75, 708.15, 274.2, 241.45, 2309, 492.2, 396.1, 288.9, 231.1, 1610, 620, 157.87, 220.3, 1200}, + {-819.940624, -8444.676815, 2600.009459, 2755.17563, -167.659835, 871.855056, 44.769698, -512.313065, -819.415595, -538.071099, -189.793622, -402.922932, 179.516345, -9.814756}, + {75004.344875, 624.033993, 1251.136893, -1102.212834, -2660.66498, 699.291817, 153.16722, -950.865637, 499.754645, -145.18821, 558.116553, -23.923029, -165.405086, 9.344131}, + {81491.287984, 787.163481, 1251.296102, -1257.950837, -2966.79973, 639.744522, 131.600209, -445.040117, 584.522874, -89.756563, 524.42963, -13.549067, -210.157124, -44.919798}, + {1558.515853, 7774.939698, -2219.534038, -2523.969396, 247.850422, -846.485643, -1393.124055, 368.526116, 749.045012, 444.704518, 235.934465, 374.049623, -171.33018, -22.899655} + }; + + /// + /// return dpre, deps + /// + internal static Tuple LdpPeps(double tjd) + { + int i; + double w, a, s, c; + int npol = NPOL_PEPS; + int nper = NPER_PEPS; + double t = (tjd - SweDate.J2000) / 36525.0; + double p = 0; + double q = 0; + // periodic terms + for (i = 0; i < nper; i++) + { + w = D2PI * t; + a = w / peper[0, i]; + s = Math.Sin(a); + c = Math.Cos(a); + p += c * peper[1, i] + s * peper[3, i]; + q += c * peper[2, i] + s * peper[4, i]; + } + // polynomial terms + w = 1; + for (i = 0; i < npol; i++) + { + p += pepol[i, 0] * w; + q += pepol[i, 1] * w; + w *= t; + } + // both to radians + p *= AS2R; + q *= AS2R; + // return + return new Tuple(p, q); + } + + const double OFFSET_EPS_JPLHORIZONS = (35.95); + const double DCOR_EPS_JPL_TJD0 = 2437846.5; + const int NDCOR_EPS_JPL = 51; + static double[] dcor_eps_jpl = new double[]{ + 36.726, 36.627, 36.595, 36.578, 36.640, 36.659, 36.731, 36.765, + 36.662, 36.555, 36.335, 36.321, 36.354, 36.227, 36.289, 36.348, 36.257, 36.163, + 35.979, 35.896, 35.842, 35.825, 35.912, 35.950, 36.093, 36.191, 36.009, 35.943, + 35.875, 35.771, 35.788, 35.753, 35.822, 35.866, 35.771, 35.732, 35.543, 35.498, + 35.449, 35.409, 35.497, 35.556, 35.672, 35.760, 35.596, 35.565, 35.510, 35.394, + 35.385, 35.375, 35.415, + }; + + /// + /// Obliquity of the ecliptic at Julian date jd + /// + /// + /// IAU Coefficients are from: + /// J. H. Lieske, T. Lederle, W. Fricke, and B. Morando, + /// "Expressions for the Precession Quantities Based upon the IAU + /// (1976) System of Astronomical Constants," Astronomy and Astrophysics + /// 58, 1-16 (1977). + /// + /// Before or after 200 years from J2000, the formula used is from: + /// J. Laskar, "Secular terms of classical planetary theories + /// using the results of general theory," Astronomy and Astrophysics + /// 157, 59070 (1986). + /// + /// Bretagnon, P. et al.: 2003, "Expressions for Precession Consistent with + /// the IAU 2000A Model". A&A 400,785 + /// B03 84381.4088 -46.836051*t -1667*10-7*t2 +199911*10-8*t3 -523*10-9*t4 -248*10-10*t5 -3*10-11*t6 + /// C03 84381.406 -46.836769*t -1831*10-7*t2 +20034*10-7*t3 -576*10-9*t4 -434*10-10*t5 + /// + /// See precess and page B18 of the Astronomical Almanac. + /// + internal static double Epsiln(double jd, JPL.JplHorizonMode horizons) + { + double eps = 0; + double T = (jd - 2451545.0) / 36525.0; + if ((horizons & JPL.JplHorizonMode.JplHorizons) != 0 && IncludeCodeForDpsiDepsIAU1980) + { + eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448) * DEGTORAD / 3600; + } + else if ((horizons & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) + { + eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448) * DEGTORAD / 3600; + } + else if (UsePrecessionIAU == PrecessionIAU.IAU_1976 && Math.Abs(T) <= PrecessionIAU_1976_Centuries) + { + eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448) * DEGTORAD / 3600; + } + else if (UsePrecessionIAU == PrecessionIAU.IAU_2000 && Math.Abs(T) <= PrecessionIAU_2000_Centuries) + { + eps = (((1.813e-3 * T - 5.9e-4) * T - 46.84024) * T + 84381.406) * DEGTORAD / 3600; + } + else if (UsePrecessionIAU == PrecessionIAU.IAU_2006 && Math.Abs(T) <= PrecessionIAU_2006_Centuries) + { + eps = (((((-4.34e-8 * T - 5.76e-7) * T + 2.0034e-3) * T - 1.831e-4) * T - 46.836769) * T + 84381.406) * DEGTORAD / 3600.0; + } + else if (UsePrecessionCoefficient == PrecessionCoefficients.Bretagnon2003) + { + eps = ((((((-3e-11 * T - 2.48e-8) * T - 5.23e-7) * T + 1.99911e-3) * T - 1.667e-4) * T - 46.836051) * T + 84381.40880) * DEGTORAD / 3600.0; + } + else if (UsePrecessionCoefficient == PrecessionCoefficients.Simon1994) + { + eps = (((((2.5e-8 * T - 5.1e-7) * T + 1.9989e-3) * T - 1.52e-4) * T - 46.80927) * T + 84381.412) * DEGTORAD / 3600.0; + } + else if (UsePrecessionCoefficient == PrecessionCoefficients.Williams1994) + { + eps = ((((-1.0e-6 * T + 2.0e-3) * T - 1.74e-4) * T - 46.833960) * T + 84381.409) * DEGTORAD / 3600.0;/* */ + } + else if (UsePrecessionCoefficient == PrecessionCoefficients.Laskar1986) + { + T /= 10.0; + eps = (((((((((2.45e-10 * T + 5.79e-9) * T + 2.787e-7) * T + + 7.12e-7) * T - 3.905e-5) * T - 2.4967e-3) * T + - 5.138e-3) * T + 1.99925) * T - 0.0155) * T - 468.093) * T + + 84381.448; + eps *= DEGTORAD / 3600.0; + } + else + { + // Vondrak2011 + var tup = LdpPeps(jd); + eps = tup.Item2; + if ((horizons & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) + { + double tofs = (jd - DCOR_EPS_JPL_TJD0) / 365.25; + double dofs = OFFSET_EPS_JPLHORIZONS; + if (tofs < 0) + { + tofs = 0; + dofs = dcor_eps_jpl[0]; + } + else if (tofs >= NDCOR_EPS_JPL - 1) + { + tofs = NDCOR_EPS_JPL; + dofs = dcor_eps_jpl[NDCOR_EPS_JPL - 1]; + } + else + { + double t0 = (int)tofs; + double t1 = t0 + 1; + dofs = dcor_eps_jpl[(int)t0]; + dofs = (tofs - t0) * (dcor_eps_jpl[(int)t0] - dcor_eps_jpl[(int)t1]) + dcor_eps_jpl[(int)t0]; + } + dofs /= (1000.0 * 3600.0); + eps += dofs * DEGTORAD; + } + } + return eps; + } + + #endregion + + #region Nutation in longitude and obliquity + + /// + /// Nutation in longitude and obliquity + /// computed at Julian date J. + /// + /// References: + /// "Summary of 1980 IAU Theory of Nutation (Final Report of the + /// IAU Working Group on Nutation)", P. K. Seidelmann et al., in + /// Transactions of the IAU Vol. XVIII A, Reports on Astronomy, + /// P. A. Wayman, ed.; D. Reidel Pub. Co., 1982. + /// + /// "Nutation and the Earth's Rotation", + /// I.A.U. Symposium No. 78, May, 1977, page 256. + /// I.A.U., 1980. + /// + /// Woolard, E.W., "A redevelopment of the theory of nutation", + /// The Astronomical Journal, 58, 1-3 (1953). + /// + /// This program implements all of the 1980 IAU nutation series. + /// Results checked at 100 points against the 1986 AA; all agreed. + /// + /// + /// - S. L. Moshier, November 1987 + /// October, 1992 - typo fixed in nutation matrix + /// + /// - D. Koch, November 1995: small changes in structure, + /// Corrections to IAU 1980 Series added from Expl. Suppl. p. 116 + /// + /// Each term in the expansion has a trigonometric + /// argument given by + /// W = i*MM + j*MS + k*FF + l*DD + m*OM + /// where the variables are defined below. + /// The nutation in longitude is a sum of terms of the + /// form (a + bT) * Math.Sin(W). The terms for nutation in obliquity + /// are of the form (c + dT) * cos(W). The coefficients + /// are arranged in the tabulation as follows: + /// + /// Coefficient: + /// i j k l m a b c d + /// 0, 0, 0, 0, 1, -171996, -1742, 92025, 89, + /// The first line of the table, above, is done separately + /// since two of the values do not fit into 16 bit integers. + /// The values a and c are arc seconds times 10000. b and d + /// are arc seconds per Julian century times 100000. i through m + /// are integers. See the program for interpretation of MM, MS, + /// etc., which are mean orbital elements of the Sun and Moon. + /// + /// If terms with coefficient less than X are omitted, the peak + /// errors will be: + /// + /// omit error, omit error, + /// a < longitude c < obliquity + /// .0005" .0100" .0008" .0094" + /// .0046 .0492 .0095 .0481 + /// .0123 .0880 .0224 .0905 + /// .0386 .1808 .0895 .1129 + /// + + #region Nutation values + + static short[] base_nt = new short[] { + /* LS and OC are units of 0.0001" + *LS2 and OC2 are units of 0.00001" + *MM,MS,FF,DD,OM, LS, LS2,OC, OC2 */ + 0, 0, 0, 0, 2, 2062, 2, -895, 5, + -2, 0, 2, 0, 1, 46, 0, -24, 0, + 2, 0,-2, 0, 0, 11, 0, 0, 0, + -2, 0, 2, 0, 2, -3, 0, 1, 0, + 1,-1, 0,-1, 0, -3, 0, 0, 0, + 0,-2, 2,-2, 1, -2, 0, 1, 0, + 2, 0,-2, 0, 1, 1, 0, 0, 0, + 0, 0, 2,-2, 2,-13187,-16, 5736,-31, + 0, 1, 0, 0, 0, 1426,-34, 54, -1, + 0, 1, 2,-2, 2, -517, 12, 224, -6, + 0,-1, 2,-2, 2, 217, -5, -95, 3, + 0, 0, 2,-2, 1, 129, 1, -70, 0, + 2, 0, 0,-2, 0, 48, 0, 1, 0, + 0, 0, 2,-2, 0, -22, 0, 0, 0, + 0, 2, 0, 0, 0, 17, -1, 0, 0, + 0, 1, 0, 0, 1, -15, 0, 9, 0, + 0, 2, 2,-2, 2, -16, 1, 7, 0, + 0,-1, 0, 0, 1, -12, 0, 6, 0, + -2, 0, 0, 2, 1, -6, 0, 3, 0, + 0,-1, 2,-2, 1, -5, 0, 3, 0, + 2, 0, 0,-2, 1, 4, 0, -2, 0, + 0, 1, 2,-2, 1, 4, 0, -2, 0, + 1, 0, 0,-1, 0, -4, 0, 0, 0, + 2, 1, 0,-2, 0, 1, 0, 0, 0, + 0, 0,-2, 2, 1, 1, 0, 0, 0, + 0, 1,-2, 2, 0, -1, 0, 0, 0, + 0, 1, 0, 0, 2, 1, 0, 0, 0, + -1, 0, 0, 1, 1, 1, 0, 0, 0, + 0, 1, 2,-2, 0, -1, 0, 0, 0, + 0, 0, 2, 0, 2, -2274, -2, 977, -5, + 1, 0, 0, 0, 0, 712, 1, -7, 0, + 0, 0, 2, 0, 1, -386, -4, 200, 0, + 1, 0, 2, 0, 2, -301, 0, 129, -1, + 1, 0, 0,-2, 0, -158, 0, -1, 0, + -1, 0, 2, 0, 2, 123, 0, -53, 0, + 0, 0, 0, 2, 0, 63, 0, -2, 0, + 1, 0, 0, 0, 1, 63, 1, -33, 0, + -1, 0, 0, 0, 1, -58, -1, 32, 0, + -1, 0, 2, 2, 2, -59, 0, 26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, 0, 2, 0, 0, 0, + 0, 0, 2, 1, 2, 2, 0, -1, 0, + -1, 0, 0, 0, 2, 1, 0, -1, 0, + + 1, 0, 0,-4, 0, -1, 0, 0, 0, + -2, 0, 2, 2, 2, 1, 0, -1, 0, + -1, 0, 2, 4, 2, -2, 0, 1, 0, + 2, 0, 0,-4, 0, -1, 0, 0, 0, + 1, 1, 2,-2, 2, 1, 0, -1, 0, + 1, 0, 2, 2, 1, -1, 0, 1, 0, + -2, 0, 2, 4, 2, -1, 0, 1, 0, + -1, 0, 4, 0, 2, 1, 0, 0, 0, + 1,-1, 0,-2, 0, 1, 0, 0, 0, + 2, 0, 2,-2, 1, 1, 0, -1, 0, + 2, 0, 2, 2, 2, -1, 0, 0, 0, + 1, 0, 0, 2, 1, -1, 0, 0, 0, + 0, 0, 4,-2, 2, 1, 0, 0, 0, + 3, 0, 2,-2, 2, 1, 0, 0, 0, + 1, 0, 2,-2, 0, -1, 0, 0, 0, + 0, 1, 2, 0, 1, 1, 0, 0, 0, + -1,-1, 0, 2, 1, 1, 0, 0, 0, + 0, 0,-2, 0, 1, -1, 0, 0, 0, + 0, 0, 2,-1, 2, -1, 0, 0, 0, + 0, 1, 0, 2, 0, -1, 0, 0, 0, + 1, 0,-2,-2, 0, -1, 0, 0, 0, + 0,-1, 2, 0, 1, -1, 0, 0, 0, + 1, 1, 0,-2, 1, -1, 0, 0, 0, + 1, 0,-2, 2, 0, -1, 0, 0, 0, + 2, 0, 0, 2, 0, 1, 0, 0, 0, + 0, 0, 2, 4, 2, -1, 0, 0, 0, + 0, 1, 0, 1, 0, 1, 0, 0, 0, + }; + + static short[] corr_1987_nt = new short[] { + /* corrections to IAU 1980 nutation series by Herring 1987 + * in 0.00001" !!! + * LS OC */ + 101, 0, 0, 0, 1,-725, 0, 213, 0, + 101, 1, 0, 0, 0, 523, 0, 208, 0, + 101, 0, 2,-2, 2, 102, 0, -41, 0, + 101, 0, 2, 0, 2, -81, 0, 32, 0, + /* LC OS !!! */ + 102, 0, 0, 0, 1, 417, 0, 224, 0, + 102, 1, 0, 0, 0, 61, 0, -24, 0, + 102, 0, 2,-2, 2,-118, 0, -47, 0, + }; + + static short[] _nt = null; + static short[] nt + { + get + { + if (_nt == null) + { + if (NutationCorrection1987) + { + _nt = base_nt.Concat(corr_1987_nt).ToArray(); + } + else + { + _nt = base_nt; + } + } + return _nt; + } + } + + #endregion + + static double[] NutationIAU1980(double J) + { + // arrays to hold sines and cosines of multiple angles + double[,] ss = new double[5, 8]; + double[,] cc = new double[5, 8]; + double[] args = new double[5]; + int[] ns = new int[5]; + + // Julian centuries from 2000 January 1.5, + // barycentric dynamical time + double T = (J - 2451545.0) / 36525.0; + double T2 = T * T; + + // Fundamental arguments in the FK5 reference system. + // The coefficients, originally given to 0.001", + // are converted here to degrees. + // longitude of the mean ascending node of the lunar orbit + // on the ecliptic, measured from the mean equinox of date + double OM = -6962890.539 * T + 450160.280 + (0.008 * T + 7.455) * T2; + OM = DegNorm(OM / 3600) * DEGTORAD; + + // mean longitude of the Sun minus the + // mean longitude of the Sun's perigee + double MS = 129596581.224 * T + 1287099.804 - (0.012 * T + 0.577) * T2; + MS = DegNorm(MS / 3600) * DEGTORAD; + + // mean longitude of the Moon minus the + // mean longitude of the Moon's perigee + double MM = 1717915922.633 * T + 485866.733 + (0.064 * T + 31.310) * T2; + MM = DegNorm(MM / 3600) * DEGTORAD; + + // mean longitude of the Moon minus the + // mean longitude of the Moon's node + double FF = 1739527263.137 * T + 335778.877 + (0.011 * T - 13.257) * T2; + FF = DegNorm(FF / 3600) * DEGTORAD; + + // mean elongation of the Moon from the Sun. + double DD = 1602961601.328 * T + 1072261.307 + (0.019 * T - 6.891) * T2; + DD = DegNorm(DD / 3600) * DEGTORAD; + args[0] = MM; + ns[0] = 3; + args[1] = MS; + ns[1] = 2; + args[2] = FF; + ns[2] = 4; + args[3] = DD; + ns[3] = 4; + args[4] = OM; + ns[4] = 2; + + // Calculate Math.Sin( i*MM ), etc. for needed multiple angles + for (int k = 0; k <= 4; k++) + { + double arg = args[k]; + int n = ns[k]; + double su = Math.Sin(arg); + double cu = Math.Cos(arg); + ss[k, 0] = su; /* sin(L) */ + cc[k, 0] = cu; /* cos(L) */ + double sv = 2.0 * su * cu; + double cv = cu * cu - su * su; + ss[k, 1] = sv; /* sin(2L) */ + cc[k, 1] = cv; + for (int i = 2; i < n; i++) + { + double s = su * cv + cu * sv; + cv = cu * cv - su * sv; + sv = s; + ss[k, i] = sv; /* sin( i+1 L ) */ + cc[k, i] = cv; + } + } + + // first terms, not in table: */ + double C = (-0.01742 * T - 17.1996) * ss[4, 0]; /* sin(OM) */ + double D = (0.00089 * T + 9.2025) * cc[4, 0]; /* cos(OM) */ + var wnt = nt; // Working reference to nt + for (int p = 0, pcnt = wnt.Length; p < pcnt; p += 9) + { + // argument of sine and cosine + int k1 = 0; + double cv = 0.0; + double sv = 0.0; + for (int m = 0; m < 5; m++) + { + int j = wnt[p + m]; + if (j > 100) + j = 0; // p[0] is a flag + if (j != 0) + { + int k = j; + if (j < 0) + k = -k; + double su = ss[m, k - 1]; /* sin(k*angle) */ + if (j < 0) + su = -su; + double cu = cc[m, k - 1]; + if (k1 == 0) + { /* set first angle */ + sv = su; + cv = cu; + k1 = 1; + } + else + { /* combine angles */ + double sw = su * cv + cu * sv; + cv = cu * cv - su * sv; + sv = sw; + } + } + } + + // longitude coefficient, in 0.0001" + double f = wnt[p + 5] * 0.0001; + if (wnt[p + 6] != 0) + f += 0.00001 * T * wnt[p + 6]; + + // obliquity coefficient, in 0.0001" + double g = wnt[p + 7] * 0.0001; + if (wnt[p + 8] != 0) + g += 0.00001 * T * wnt[p + 8]; + if (p >= 100) + { /* coefficients in 0.00001" */ + f *= 0.1; + g *= 0.1; + } + + // accumulate the terms + if (p != 102) + { + C += f * sv; + D += g * cv; + } + else + { /* cos for nutl and sin for nuto */ + C += f * cv; + D += g * sv; + } + } + + // Save answers, expressed in radians + double[] result = new double[2]; + result[0] = DEGTORAD * C / 3600.0; + result[1] = DEGTORAD * D / 3600.0; + + // nutlo[0] += (-0.071590 / 3600.0) * DEGTORAD; + // nutlo[1] += (-0.008000 / 3600.0) * DEGTORAD; + + // nutlo[0] += (-0.047878 / 3600.0) * DEGTORAD; + // nutlo[1] += (-0.004035 / 3600.0) * DEGTORAD; + + return result; + } + + /// + /// Nutation IAU 2000A model + /// (MHB2000 luni-solar and planetary nutation, without free core nutation) + /// + /// Function returns nutation in longitude and obliquity in radians with + /// respect to the equinox of date. For the obliquity of the ecliptic + /// the calculation of Lieske & al. (1977) must be used. + /// + /// The precision in recent years is about 0.001 arc seconds. + /// + /// The calculation includes luni-solar and planetary nutation. + /// Free core nutation, which cannot be predicted, is omitted, + /// the error being of the order of a few 0.0001 arc seconds. + /// + /// References: + /// + /// Capitaine, N., Wallace, P.T., Chapront, J., A & A 432, 366 (2005). + /// + /// Chapront, J., Chapront-Touze, M. & Francou, G., A & A 387, 700 (2002). + /// + /// Lieske, J.H., Lederle, T., Fricke, W. & Morando, B., "Expressions + /// for the precession quantities based upon the IAU (1976) System of + /// Astronomical Constants", A & A 58, 1-16 (1977). + /// + /// Mathews, P.M., Herring, T.A., Buffet, B.A., "Modeling of nutation + /// and precession New nutation series for nonrigid Earth and + /// insights into the Earth's interior", J.Geophys.Res., 107, B4, + /// 2002. + /// + /// Simon, J.-L., Bretagnon, P., Chapront, J., Chapront-Touze, M., + /// Francou, G., Laskar, J., A & A 282, 663-683 (1994). + /// + /// Souchay, J., Loysel, B., Kinoshita, H., Folgueira, M., A & A Supp. + /// Ser. 135, 111 (1999). + /// + /// Wallace, P.T., "Software for Implementing the IAU 2000 + /// Resolutions", in IERS Workshop 5.1 (2002). + /// + /// Nutation IAU 2000A series in: + /// Kaplan, G.H., United States Naval Observatory Circular No. 179 (Oct. 2005) + /// aa.usno.navy.mil/publications/docs/Circular_179.html + /// + /// MHB2000 code at + /// - ftp://maia.usno.navy.mil/conv2000/chapter5/IAU2000A. + /// - http://www.iau-sofa.rl.ac.uk/2005_0901/Downloads.html + /// + static double[] NutationIAU2000ab(double J) + { + double dpsi = 0, deps = 0; + + double T = (J - SweDate.J2000) / 36525.0; + + // luni-solar nutation + // Fundamental arguments, Simon & al. (1994) + // Mean anomaly of the Moon. + double M = DegNorm((485868.249036 + + T * (1717915923.2178 + + T * (31.8792 + + T * (0.051635 + + T * (-0.00024470))))) / 3600.0) * DEGTORAD; + + // Mean anomaly of the Sun + double SM = DegNorm((1287104.79305 + + T * (129596581.0481 + + T * (-0.5532 + + T * (0.000136 + + T * (-0.00001149))))) / 3600.0) * DEGTORAD; + + // Mean argument of the latitude of the Moon. + double F = DegNorm((335779.526232 + + T * (1739527262.8478 + + T * (-12.7512 + + T * (-0.001037 + + T * (0.00000417))))) / 3600.0) * DEGTORAD; + + // Mean elongation of the Moon from the Sun. + double D = DegNorm((1072260.70369 + + T * (1602961601.2090 + + T * (-6.3706 + + T * (0.006593 + + T * (-0.00003169))))) / 3600.0) * DEGTORAD; + + // /* Mean longitude of the ascending node of the Moon. */ + double OM = DegNorm((450160.398036 + + T * (-6962890.5431 + + T * (7.4722 + + T * (0.007702 + + T * (-0.00005939))))) / 3600.0) * DEGTORAD; + + // luni-solar nutation series, in reverse order, starting with small terms + var nls = Lib.SweNut200a.nls; + var cls = Lib.SweNut200a.cls; + int inls; + if (UseNutationModel == NutationModel.IAU_2000B) + inls = Lib.SweNut200a.NLS_2000B; + else + inls = Lib.SweNut200a.NLS; + for (int i = inls - 1; i >= 0; i--) + { + int j = i * 5; + double darg = RadNorm((double)nls[j + 0] * M + + (double)nls[j + 1] * SM + + (double)nls[j + 2] * F + + (double)nls[j + 3] * D + + (double)nls[j + 4] * OM); + double sinarg = Math.Sin(darg); + double cosarg = Math.Cos(darg); + int k = i * 6; + dpsi += (cls[k + 0] + cls[k + 1] * T) * sinarg + cls[k + 2] * cosarg; + deps += (cls[k + 3] + cls[k + 4] * T) * cosarg + cls[k + 5] * sinarg; + } + + double[] result = new double[]{ + dpsi * Lib.SweNut200a.O1MAS2DEG, + deps * Lib.SweNut200a.O1MAS2DEG + }; + + if (UseNutationModel == NutationModel.IAU_2000A) + { + // planetary nutation + // note: The MHB2000 code computes the luni-solar and planetary nutation + // in different routines, using slightly different Delaunay + // arguments in the two cases. This behaviour is faithfully + // reproduced here. Use of the Simon et al. expressions for both + // cases leads to negligible changes, well below 0.1 microarcsecond. + + // Mean anomaly of the Moon. + double AL = RadNorm(2.35555598 + 8328.6914269554 * T); + + // Mean anomaly of the Sun. + double ALSU = RadNorm(6.24006013 + 628.301955 * T); + + // Mean argument of the latitude of the Moon. + double AF = RadNorm(1.627905234 + 8433.466158131 * T); + + // Mean elongation of the Moon from the Sun. + double AD = RadNorm(5.198466741 + 7771.3771468121 * T); + + // Mean longitude of the ascending node of the Moon. + double AOM = RadNorm(2.18243920 - 33.757045 * T); + + // Planetary longitudes, Mercury through Neptune (Souchay et al. 1999). + double ALME = RadNorm(4.402608842 + 2608.7903141574 * T); + double ALVE = RadNorm(3.176146697 + 1021.3285546211 * T); + double ALEA = RadNorm(1.753470314 + 628.3075849991 * T); + double ALMA = RadNorm(6.203480913 + 334.0612426700 * T); + double ALJU = RadNorm(0.599546497 + 52.9690962641 * T); + double ALSA = RadNorm(0.874016757 + 21.3299104960 * T); + double ALUR = RadNorm(5.481293871 + 7.4781598567 * T); + double ALNE = RadNorm(5.321159000 + 3.8127774000 * T); + + // General accumulated precession in longitude. + double APA = (0.02438175 + 0.00000538691 * T) * T; + + // planetary nutation series (in reverse order). + var npl = Lib.SweNut200a.npl; + var icpl = Lib.SweNut200a.icpl; + dpsi = 0; + deps = 0; + for (int i = Lib.SweNut200a.NPL - 1; i >= 0; i--) + { + int j = i * 14; + double darg = RadNorm((double)npl[j + 0] * AL + + (double)npl[j + 1] * ALSU + + (double)npl[j + 2] * AF + + (double)npl[j + 3] * AD + + (double)npl[j + 4] * AOM + + (double)npl[j + 5] * ALME + + (double)npl[j + 6] * ALVE + + (double)npl[j + 7] * ALEA + + (double)npl[j + 8] * ALMA + + (double)npl[j + 9] * ALJU + + (double)npl[j + 10] * ALSA + + (double)npl[j + 11] * ALUR + + (double)npl[j + 12] * ALNE + + (double)npl[j + 13] * APA); + int k = i * 4; + double sinarg = Math.Sin(darg); + double cosarg = Math.Cos(darg); + dpsi += (double)icpl[k + 0] * sinarg + (double)icpl[k + 1] * cosarg; + deps += (double)icpl[k + 2] * sinarg + (double)icpl[k + 3] * cosarg; + } + result[0] += dpsi * Lib.SweNut200a.O1MAS2DEG; + result[1] += deps * Lib.SweNut200a.O1MAS2DEG; + + // changes required by adoption of P03 precession + // according to Capitaine et al. A & A 412, 366 (2005) = IAU 2006 + dpsi = -8.1 * Math.Sin(OM) - 0.6 * Math.Sin(2 * F - 2 * D + 2 * OM); + dpsi += T * (47.8 * Math.Sin(OM) + 3.7 * Math.Sin(2 * F - 2 * D + 2 * OM) + 0.6 * Math.Sin(2 * F + 2 * OM) - 0.6 * Math.Sin(2 * OM)); + deps = T * (-25.6 * Math.Cos(OM) - 1.6 * Math.Cos(2 * F - 2 * D + 2 * OM)); + result[0] += dpsi / (3600.0 * 1000000.0); + result[1] += deps / (3600.0 * 1000000.0); + } + + // Result + result[0] *= DEGTORAD; + result[1] *= DEGTORAD; + return result; + } + + + static double Bessel(double[] v, int n, double t) + { + // double B; double[] d = new double[6]; + if (t <= 0) + { + return v[0]; + } + if (t >= n - 1) + { + return v[n - 1]; + } + double p = Math.Floor(t); + int iy = (int)t; + + // Zeroth order estimate is value at start of year + double ans = v[iy]; + int k = iy + 1; + if (k >= n) + return ans; + + // The fraction of tabulation interval + p = t - p; + ans += p * (v[k] - v[iy]); + if ((iy - 1 < 0) || (iy + 2 >= n)) + return ans; // can't do second differences + + // Make table of first differences + k = iy - 2; + var d = new double[6]; + for (int i = 0; i < 5; i++) + { + if ((k < 0) || (k + 1 >= n)) + d[i] = 0; + else + d[i] = v[k + 1] - v[k]; + k += 1; + } + + // Compute second differences + for (int i = 0; i < 4; i++) + d[i] = d[i + 1] - d[i]; + double B = 0.25 * p * (p - 1.0); + ans += B * (d[1] + d[2]); + if (iy + 2 >= n) + return ans; + + // Compute third differences + for (int i = 0; i < 3; i++) + d[i] = d[i + 1] - d[i]; + B = 2.0 * B / 3.0; + ans += (p - 0.5) * B * d[1]; + if ((iy - 2 < 0) || (iy + 3 > n)) + return ans; + + // Compute fourth differences + for (int i = 0; i < 2; i++) + d[i] = d[i + 1] - d[i]; + B = 0.125 * B * (p + 1.0) * (p - 2.0); + ans += B * (d[0] + d[1]); + + return ans; + } + + /// + /// Nutation + /// + internal double[] Nutation(double J, JPL.JplHorizonMode jplMode) + { + double[] result = new double[2]; + if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0 && IncludeCodeForDpsiDepsIAU1980) + { + result = NutationIAU1980(J); + } + else if (UseNutationModel == NutationModel.IAU_1980) + { + result = NutationIAU1980(J); + } + else if (UseNutationModel == NutationModel.IAU_2000A || UseNutationModel == NutationModel.IAU_2000B) + { + result = NutationIAU2000ab(J); + if ((jplMode & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) + { + result[0] += -41.7750 / 3600.0 / 1000.0 * DEGTORAD; + result[1] += -6.8192 / 3600.0 / 1000.0 * DEGTORAD; + } + } + if (IncludeCodeForDpsiDepsIAU1980) + { + if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0) + { + int n = (int)(_Swed.EopTjdEnd - _Swed.EopTjdBeg + 0.000001); + double J2 = J; + if (J < _Swed.EopTjdBeg_horizons) + J2 = _Swed.EopTjdBeg_horizons; + double dpsi = Bessel(_Swed.Dpsi, n + 1, J2 - _Swed.EopTjdBeg); + double deps = Bessel(_Swed.Deps, n + 1, J2 - _Swed.EopTjdBeg); + result[0] += dpsi / 3600.0 * DEGTORAD; + result[1] += deps / 3600.0 * DEGTORAD; + } + } + return result; + } + + #endregion + + #region Parameters + + /// + /// Precession coefficients for remote past and future + /// + public static PrecessionCoefficients UsePrecessionCoefficient = PrecessionCoefficients.Vondrak2011; + + /// + /// IAU precession 1976 or 2003 for recent centuries. + /// + public static PrecessionIAU UsePrecessionIAU = PrecessionIAU.None; + + /// + /// Nutation model + /// + public static NutationModel UseNutationModel = NutationModel.IAU_2000B; + + /// + /// You can set the latter false if you do not want to compile the + /// code required to reproduce JPL Horizons. + /// Keep it TRUE in order to reproduce JPL Horizons following + /// IERS Conventions 1996 (1992), p. 22. Call swe_calc_ut() with + /// iflag|SEFLG_JPLHOR. This options runs only, if the files + /// DPSI_DEPS_IAU1980_FILE_EOPC04 and DPSI_DEPS_IAU1980_FILE_FINALS + /// are in the ephemeris path. + /// + public static bool IncludeCodeForDpsiDepsIAU1980 = true; + + /// + /// If the above define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 is FALSE or + /// the software does not find the earth orientation files (see above) + /// in the ephemeris path, then SEFLG_JPLHOR will run as + /// SEFLG_JPLHOR_APPROX. + /// The following define APPROXIMATE_HORIZONS_ASTRODIENST defines + /// the handling of SEFLG_JPLHOR_APPROX. + /// With this flag, planetary positions are always calculated + /// using a recent precession/nutation model. + /// If APPROXIMATE_HORIZONS_ASTRODIENST is FALSE, then the + /// frame bias as recommended by IERS Conventions 2003 and 2010 + /// is *not* applied. Instead, dpsi_bias and deps_bias are added to + /// nutation. This procedure is found in some older astronomical software. + /// Equatorial apparent positions will be close to JPL Horizons + /// (within a few mas) beetween 1962 and current years. Ecl. longitude + /// will be good, latitude bad. + /// If APPROXIMATE_HORIZONS_ASTRODIENST is TRUE, the approximation of + /// JPL Horizons is even better. Frame bias matrix is applied with + /// some correction to RA and another correction is added to epsilon. + /// + public static bool ApproximateHorizonsAstrodienst = true; + + /// + /// The latter, if combined with SEFLG_JPLHOR provides good agreement + /// with JPL Horizons for 1800 - today. However, Horizons uses correct + /// dpsi and deps only after 20-jan-1962. For all dates before that + /// it uses dpsi and deps of 20-jan-1962, which provides a continuous + /// ephemeris, but does not make sense otherwise. + /// Before 1800, even this option does not provide agreement with Horizons, + /// because Horizons uses a different precession model (Owen 1986) + /// before 1800, which is not included in the Swiss Ephemeris. + /// If this macro is FALSE then the program defaults to SEFLG_JPLHOR_APPROX + /// outside the time range of correction data dpsi and deps. + /// Note that this will result in a non-continuous ephemeris near + /// 20-jan-1962 and current years. + /// + /// + /// Horizons method before 20-jan-1962 + /// + public static bool UseHorizonsMethodBefore1980 = true; + + /// + /// Set TRUE, to include Herring's (1987) corrections to IAU 1980 + /// nutation series. AA (1996) neglects them. + /// + public static bool NutationCorrection1987 + { + get { return _NutationCorrection1987; } + set { _NutationCorrection1987 = value; _nt = null; } + } + static bool _NutationCorrection1987 = false; + + #endregion + + } +} diff --git a/SwephNet/SwephNet/Lib/SweNut200a.cs b/SwephNet/SwephNet/Lib/SweNut200a.cs new file mode 100644 index 0000000..b4f65ae --- /dev/null +++ b/SwephNet/SwephNet/Lib/SweNut200a.cs @@ -0,0 +1,2809 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SwephNet.Lib +{ + /// + /// SweNut200a.h + /// + public static class SweNut200a + { + /// + /// 0.1 microarcsecond to degrees + /// + public const double O1MAS2DEG = (1 / 3600.0 / 10000000.0); + + /// + /// Number of terms in the luni-solar nutation model + /// + public const int NLS = 678; + public const int NLS_2000B = 77; + + /// + /// Number of terms in the planetary nutation model + /// + public const int NPL = 687; + + #region Luni-Solar argument multipliers + + /// + /// Luni-Solar argument multipliers + /// L L' F D Om + /// + public static Int16[] nls = new Int16[]{ + 0, 0, 0, 0, 1, + 0, 0, 2, -2, 2, + 0, 0, 2, 0, 2, + 0, 0, 0, 0, 2, + 0, 1, 0, 0, 0, + 0, 1, 2, -2, 2, + 1, 0, 0, 0, 0, + 0, 0, 2, 0, 1, + 1, 0, 2, 0, 2, + 0, -1, 2, -2, 2, + 0, 0, 2, -2, 1, + -1, 0, 2, 0, 2, + -1, 0, 0, 2, 0, + 1, 0, 0, 0, 1, + -1, 0, 0, 0, 1, + -1, 0, 2, 2, 2, + 1, 0, 2, 0, 1, + -2, 0, 2, 0, 1, + 0, 0, 0, 2, 0, + 0, 0, 2, 2, 2, + 0, -2, 2, -2, 2, + -2, 0, 0, 2, 0, + 2, 0, 2, 0, 2, + 1, 0, 2, -2, 2, + -1, 0, 2, 0, 1, + 2, 0, 0, 0, 0, + 0, 0, 2, 0, 0, + 0, 1, 0, 0, 1, + -1, 0, 0, 2, 1, + 0, 2, 2, -2, 2, + 0, 0, -2, 2, 0, + 1, 0, 0, -2, 1, + 0, -1, 0, 0, 1, + -1, 0, 2, 2, 1, + 0, 2, 0, 0, 0, + 1, 0, 2, 2, 2, + -2, 0, 2, 0, 0, + 0, 1, 2, 0, 2, + 0, 0, 2, 2, 1, + 0, -1, 2, 0, 2, + 0, 0, 0, 2, 1, + 1, 0, 2, -2, 1, + 2, 0, 2, -2, 2, + -2, 0, 0, 2, 1, + 2, 0, 2, 0, 1, + 0, -1, 2, -2, 1, + 0, 0, 0, -2, 1, + -1, -1, 0, 2, 0, + 2, 0, 0, -2, 1, + 1, 0, 0, 2, 0, + 0, 1, 2, -2, 1, + 1, -1, 0, 0, 0, + -2, 0, 2, 0, 2, + 3, 0, 2, 0, 2, + 0, -1, 0, 2, 0, + 1, -1, 2, 0, 2, + 0, 0, 0, 1, 0, + -1, -1, 2, 2, 2, + -1, 0, 2, 0, 0, + 0, -1, 2, 2, 2, + -2, 0, 0, 0, 1, + 1, 1, 2, 0, 2, + 2, 0, 0, 0, 1, + -1, 1, 0, 1, 0, + 1, 1, 0, 0, 0, + 1, 0, 2, 0, 0, + -1, 0, 2, -2, 1, + 1, 0, 0, 0, 2, + -1, 0, 0, 1, 0, + 0, 0, 2, 1, 2, + -1, 0, 2, 4, 2, + -1, 1, 0, 1, 1, + 0, -2, 2, -2, 1, + 1, 0, 2, 2, 1, + -2, 0, 2, 2, 2, + -1, 0, 0, 0, 2, + 1, 1, 2, -2, 2, + -2, 0, 2, 4, 2, + -1, 0, 4, 0, 2, + 2, 0, 2, -2, 1, + 2, 0, 2, 2, 2, + 1, 0, 0, 2, 1, + 3, 0, 0, 0, 0, + 3, 0, 2, -2, 2, + 0, 0, 4, -2, 2, + 0, 1, 2, 0, 1, + 0, 0, -2, 2, 1, + 0, 0, 2, -2, 3, + -1, 0, 0, 4, 0, + 2, 0, -2, 0, 1, + -2, 0, 0, 4, 0, + -1, -1, 0, 2, 1, + -1, 0, 0, 1, 1, + 0, 1, 0, 0, 2, + 0, 0, -2, 0, 1, + 0, -1, 2, 0, 1, + 0, 0, 2, -1, 2, + 0, 0, 2, 4, 2, + -2, -1, 0, 2, 0, + 1, 1, 0, -2, 1, + -1, 1, 0, 2, 0, + -1, 1, 0, 1, 2, + 1, -1, 0, 0, 1, + 1, -1, 2, 2, 2, + -1, 1, 2, 2, 2, + 3, 0, 2, 0, 1, + 0, 1, -2, 2, 0, + -1, 0, 0, -2, 1, + 0, 1, 2, 2, 2, + -1, -1, 2, 2, 1, + 0, -1, 0, 0, 2, + 1, 0, 2, -4, 1, + -1, 0, -2, 2, 0, + 0, -1, 2, 2, 1, + 2, -1, 2, 0, 2, + 0, 0, 0, 2, 2, + 1, -1, 2, 0, 1, + -1, 1, 2, 0, 2, + 0, 1, 0, 2, 0, + 0, -1, -2, 2, 0, + 0, 3, 2, -2, 2, + 0, 0, 0, 1, 1, + -1, 0, 2, 2, 0, + 2, 1, 2, 0, 2, + 1, 1, 0, 0, 1, + 1, 1, 2, 0, 1, + 2, 0, 0, 2, 0, + 1, 0, -2, 2, 0, + -1, 0, 0, 2, 2, + 0, 1, 0, 1, 0, + 0, 1, 0, -2, 1, + -1, 0, 2, -2, 2, + 0, 0, 0, -1, 1, + -1, 1, 0, 0, 1, + 1, 0, 2, -1, 2, + 1, -1, 0, 2, 0, + 0, 0, 0, 4, 0, + 1, 0, 2, 1, 2, + 0, 0, 2, 1, 1, + 1, 0, 0, -2, 2, + -1, 0, 2, 4, 1, + 1, 0, -2, 0, 1, + 1, 1, 2, -2, 1, + 0, 0, 2, 2, 0, + -1, 0, 2, -1, 1, + -2, 0, 2, 2, 1, + 4, 0, 2, 0, 2, + 2, -1, 0, 0, 0, + 2, 1, 2, -2, 2, + 0, 1, 2, 1, 2, + 1, 0, 4, -2, 2, + -1, -1, 0, 0, 1, + 0, 1, 0, 2, 1, + -2, 0, 2, 4, 1, + 2, 0, 2, 0, 0, + 1, 0, 0, 1, 0, + -1, 0, 0, 4, 1, + -1, 0, 4, 0, 1, + 2, 0, 2, 2, 1, + 0, 0, 2, -3, 2, + -1, -2, 0, 2, 0, + 2, 1, 0, 0, 0, + 0, 0, 4, 0, 2, + 0, 0, 0, 0, 3, + 0, 3, 0, 0, 0, + 0, 0, 2, -4, 1, + 0, -1, 0, 2, 1, + 0, 0, 0, 4, 1, + -1, -1, 2, 4, 2, + 1, 0, 2, 4, 2, + -2, 2, 0, 2, 0, + -2, -1, 2, 0, 1, + -2, 0, 0, 2, 2, + -1, -1, 2, 0, 2, + 0, 0, 4, -2, 1, + 3, 0, 2, -2, 1, + -2, -1, 0, 2, 1, + 1, 0, 0, -1, 1, + 0, -2, 0, 2, 0, + -2, 0, 0, 4, 1, + -3, 0, 0, 0, 1, + 1, 1, 2, 2, 2, + 0, 0, 2, 4, 1, + 3, 0, 2, 2, 2, + -1, 1, 2, -2, 1, + 2, 0, 0, -4, 1, + 0, 0, 0, -2, 2, + 2, 0, 2, -4, 1, + -1, 1, 0, 2, 1, + 0, 0, 2, -1, 1, + 0, -2, 2, 2, 2, + 2, 0, 0, 2, 1, + 4, 0, 2, -2, 2, + 2, 0, 0, -2, 2, + 0, 2, 0, 0, 1, + 1, 0, 0, -4, 1, + 0, 2, 2, -2, 1, + -3, 0, 0, 4, 0, + -1, 1, 2, 0, 1, + -1, -1, 0, 4, 0, + -1, -2, 2, 2, 2, + -2, -1, 2, 4, 2, + 1, -1, 2, 2, 1, + -2, 1, 0, 2, 0, + -2, 1, 2, 0, 1, + 2, 1, 0, -2, 1, + -3, 0, 2, 0, 1, + -2, 0, 2, -2, 1, + -1, 1, 0, 2, 2, + 0, -1, 2, -1, 2, + -1, 0, 4, -2, 2, + 0, -2, 2, 0, 2, + -1, 0, 2, 1, 2, + 2, 0, 0, 0, 2, + 0, 0, 2, 0, 3, + -2, 0, 4, 0, 2, + -1, 0, -2, 0, 1, + -1, 1, 2, 2, 1, + 3, 0, 0, 0, 1, + -1, 0, 2, 3, 2, + 2, -1, 2, 0, 1, + 0, 1, 2, 2, 1, + 0, -1, 2, 4, 2, + 2, -1, 2, 2, 2, + 0, 2, -2, 2, 0, + -1, -1, 2, -1, 1, + 0, -2, 0, 0, 1, + 1, 0, 2, -4, 2, + 1, -1, 0, -2, 1, + -1, -1, 2, 0, 1, + 1, -1, 2, -2, 2, + -2, -1, 0, 4, 0, + -1, 0, 0, 3, 0, + -2, -1, 2, 2, 2, + 0, 2, 2, 0, 2, + 1, 1, 0, 2, 0, + 2, 0, 2, -1, 2, + 1, 0, 2, 1, 1, + 4, 0, 0, 0, 0, + 2, 1, 2, 0, 1, + 3, -1, 2, 0, 2, + -2, 2, 0, 2, 1, + 1, 0, 2, -3, 1, + 1, 1, 2, -4, 1, + -1, -1, 2, -2, 1, + 0, -1, 0, -1, 1, + 0, -1, 0, -2, 1, + -2, 0, 0, 0, 2, + -2, 0, -2, 2, 0, + -1, 0, -2, 4, 0, + 1, -2, 0, 0, 0, + 0, 1, 0, 1, 1, + -1, 2, 0, 2, 0, + 1, -1, 2, -2, 1, + 1, 2, 2, -2, 2, + 2, -1, 2, -2, 2, + 1, 0, 2, -1, 1, + 2, 1, 2, -2, 1, + -2, 0, 0, -2, 1, + 1, -2, 2, 0, 2, + 0, 1, 2, 1, 1, + 1, 0, 4, -2, 1, + -2, 0, 4, 2, 2, + 1, 1, 2, 1, 2, + 1, 0, 0, 4, 0, + 1, 0, 2, 2, 0, + 2, 0, 2, 1, 2, + 3, 1, 2, 0, 2, + 4, 0, 2, 0, 1, + -2, -1, 2, 0, 0, + 0, 1, -2, 2, 1, + 1, 0, -2, 1, 0, + 0, -1, -2, 2, 1, + 2, -1, 0, -2, 1, + -1, 0, 2, -1, 2, + 1, 0, 2, -3, 2, + 0, 1, 2, -2, 3, + 0, 0, 2, -3, 1, + -1, 0, -2, 2, 1, + 0, 0, 2, -4, 2, + -2, 1, 0, 0, 1, + -1, 0, 0, -1, 1, + 2, 0, 2, -4, 2, + 0, 0, 4, -4, 4, + 0, 0, 4, -4, 2, + -1, -2, 0, 2, 1, + -2, 0, 0, 3, 0, + 1, 0, -2, 2, 1, + -3, 0, 2, 2, 2, + -3, 0, 2, 2, 1, + -2, 0, 2, 2, 0, + 2, -1, 0, 0, 1, + -2, 1, 2, 2, 2, + 1, 1, 0, 1, 0, + 0, 1, 4, -2, 2, + -1, 1, 0, -2, 1, + 0, 0, 0, -4, 1, + 1, -1, 0, 2, 1, + 1, 1, 0, 2, 1, + -1, 2, 2, 2, 2, + 3, 1, 2, -2, 2, + 0, -1, 0, 4, 0, + 2, -1, 0, 2, 0, + 0, 0, 4, 0, 1, + 2, 0, 4, -2, 2, + -1, -1, 2, 4, 1, + 1, 0, 0, 4, 1, + 1, -2, 2, 2, 2, + 0, 0, 2, 3, 2, + -1, 1, 2, 4, 2, + 3, 0, 0, 2, 0, + -1, 0, 4, 2, 2, + 1, 1, 2, 2, 1, + -2, 0, 2, 6, 2, + 2, 1, 2, 2, 2, + -1, 0, 2, 6, 2, + 1, 0, 2, 4, 1, + 2, 0, 2, 4, 2, + 1, 1, -2, 1, 0, + -3, 1, 2, 1, 2, + 2, 0, -2, 0, 2, + -1, 0, 0, 1, 2, + -4, 0, 2, 2, 1, + -1, -1, 0, 1, 0, + 0, 0, -2, 2, 2, + 1, 0, 0, -1, 2, + 0, -1, 2, -2, 3, + -2, 1, 2, 0, 0, + 0, 0, 2, -2, 4, + -2, -2, 0, 2, 0, + -2, 0, -2, 4, 0, + 0, -2, -2, 2, 0, + 1, 2, 0, -2, 1, + 3, 0, 0, -4, 1, + -1, 1, 2, -2, 2, + 1, -1, 2, -4, 1, + 1, 1, 0, -2, 2, + -3, 0, 2, 0, 0, + -3, 0, 2, 0, 2, + -2, 0, 0, 1, 0, + 0, 0, -2, 1, 0, + -3, 0, 0, 2, 1, + -1, -1, -2, 2, 0, + 0, 1, 2, -4, 1, + 2, 1, 0, -4, 1, + 0, 2, 0, -2, 1, + 1, 0, 0, -3, 1, + -2, 0, 2, -2, 2, + -2, -1, 0, 0, 1, + -4, 0, 0, 2, 0, + 1, 1, 0, -4, 1, + -1, 0, 2, -4, 1, + 0, 0, 4, -4, 1, + 0, 3, 2, -2, 2, + -3, -1, 0, 4, 0, + -3, 0, 0, 4, 1, + 1, -1, -2, 2, 0, + -1, -1, 0, 2, 2, + 1, -2, 0, 0, 1, + 1, -1, 0, 0, 2, + 0, 0, 0, 1, 2, + -1, -1, 2, 0, 0, + 1, -2, 2, -2, 2, + 0, -1, 2, -1, 1, + -1, 0, 2, 0, 3, + 1, 1, 0, 0, 2, + -1, 1, 2, 0, 0, + 1, 2, 0, 0, 0, + -1, 2, 2, 0, 2, + -1, 0, 4, -2, 1, + 3, 0, 2, -4, 2, + 1, 2, 2, -2, 1, + 1, 0, 4, -4, 2, + -2, -1, 0, 4, 1, + 0, -1, 0, 2, 2, + -2, 1, 0, 4, 0, + -2, -1, 2, 2, 1, + 2, 0, -2, 2, 0, + 1, 0, 0, 1, 1, + 0, 1, 0, 2, 2, + 1, -1, 2, -1, 2, + -2, 0, 4, 0, 1, + 2, 1, 0, 0, 1, + 0, 1, 2, 0, 0, + 0, -1, 4, -2, 2, + 0, 0, 4, -2, 4, + 0, 2, 2, 0, 1, + -3, 0, 0, 6, 0, + -1, -1, 0, 4, 1, + 1, -2, 0, 2, 0, + -1, 0, 0, 4, 2, + -1, -2, 2, 2, 1, + -1, 0, 0, -2, 2, + 1, 0, -2, -2, 1, + 0, 0, -2, -2, 1, + -2, 0, -2, 0, 1, + 0, 0, 0, 3, 1, + 0, 0, 0, 3, 0, + -1, 1, 0, 4, 0, + -1, -1, 2, 2, 0, + -2, 0, 2, 3, 2, + 1, 0, 0, 2, 2, + 0, -1, 2, 1, 2, + 3, -1, 0, 0, 0, + 2, 0, 0, 1, 0, + 1, -1, 2, 0, 0, + 0, 0, 2, 1, 0, + 1, 0, 2, 0, 3, + 3, 1, 0, 0, 0, + 3, -1, 2, -2, 2, + 2, 0, 2, -1, 1, + 1, 1, 2, 0, 0, + 0, 0, 4, -1, 2, + 1, 2, 2, 0, 2, + -2, 0, 0, 6, 0, + 0, -1, 0, 4, 1, + -2, -1, 2, 4, 1, + 0, -2, 2, 2, 1, + 0, -1, 2, 2, 0, + -1, 0, 2, 3, 1, + -2, 1, 2, 4, 2, + 2, 0, 0, 2, 2, + 2, -2, 2, 0, 2, + -1, 1, 2, 3, 2, + 3, 0, 2, -1, 2, + 4, 0, 2, -2, 1, + -1, 0, 0, 6, 0, + -1, -2, 2, 4, 2, + -3, 0, 2, 6, 2, + -1, 0, 2, 4, 0, + 3, 0, 0, 2, 1, + 3, -1, 2, 0, 1, + 3, 0, 2, 0, 0, + 1, 0, 4, 0, 2, + 5, 0, 2, -2, 2, + 0, -1, 2, 4, 1, + 2, -1, 2, 2, 1, + 0, 1, 2, 4, 2, + 1, -1, 2, 4, 2, + 3, -1, 2, 2, 2, + 3, 0, 2, 2, 1, + 5, 0, 2, 0, 2, + 0, 0, 2, 6, 2, + 4, 0, 2, 2, 2, + 0, -1, 1, -1, 1, + -1, 0, 1, 0, 3, + 0, -2, 2, -2, 3, + 1, 0, -1, 0, 1, + 2, -2, 0, -2, 1, + -1, 0, 1, 0, 2, + -1, 0, 1, 0, 1, + -1, -1, 2, -1, 2, + -2, 2, 0, 2, 2, + -1, 0, 1, 0, 0, + -4, 1, 2, 2, 2, + -3, 0, 2, 1, 1, + -2, -1, 2, 0, 2, + 1, 0, -2, 1, 1, + 2, -1, -2, 0, 1, + -4, 0, 2, 2, 0, + -3, 1, 0, 3, 0, + -1, 0, -1, 2, 0, + 0, -2, 0, 0, 2, + 0, -2, 0, 0, 2, + -3, 0, 0, 3, 0, + -2, -1, 0, 2, 2, + -1, 0, -2, 3, 0, + -4, 0, 0, 4, 0, + 2, 1, -2, 0, 1, + 2, -1, 0, -2, 2, + 0, 0, 1, -1, 0, + -1, 2, 0, 1, 0, + -2, 1, 2, 0, 2, + 1, 1, 0, -1, 1, + 1, 0, 1, -2, 1, + 0, 2, 0, 0, 2, + 1, -1, 2, -3, 1, + -1, 1, 2, -1, 1, + -2, 0, 4, -2, 2, + -2, 0, 4, -2, 1, + -2, -2, 0, 2, 1, + -2, 0, -2, 4, 0, + 1, 2, 2, -4, 1, + 1, 1, 2, -4, 2, + -1, 2, 2, -2, 1, + 2, 0, 0, -3, 1, + -1, 2, 0, 0, 1, + 0, 0, 0, -2, 0, + -1, -1, 2, -2, 2, + -1, 1, 0, 0, 2, + 0, 0, 0, -1, 2, + -2, 1, 0, 1, 0, + 1, -2, 0, -2, 1, + 1, 0, -2, 0, 2, + -3, 1, 0, 2, 0, + -1, 1, -2, 2, 0, + -1, -1, 0, 0, 2, + -3, 0, 0, 2, 0, + -3, -1, 0, 2, 0, + 2, 0, 2, -6, 1, + 0, 1, 2, -4, 2, + 2, 0, 0, -4, 2, + -2, 1, 2, -2, 1, + 0, -1, 2, -4, 1, + 0, 1, 0, -2, 2, + -1, 0, 0, -2, 0, + 2, 0, -2, -2, 1, + -4, 0, 2, 0, 1, + -1, -1, 0, -1, 1, + 0, 0, -2, 0, 2, + -3, 0, 0, 1, 0, + -1, 0, -2, 1, 0, + -2, 0, -2, 2, 1, + 0, 0, -4, 2, 0, + -2, -1, -2, 2, 0, + 1, 0, 2, -6, 1, + -1, 0, 2, -4, 2, + 1, 0, 0, -4, 2, + 2, 1, 2, -4, 2, + 2, 1, 2, -4, 1, + 0, 1, 4, -4, 4, + 0, 1, 4, -4, 2, + -1, -1, -2, 4, 0, + -1, -3, 0, 2, 0, + -1, 0, -2, 4, 1, + -2, -1, 0, 3, 0, + 0, 0, -2, 3, 0, + -2, 0, 0, 3, 1, + 0, -1, 0, 1, 0, + -3, 0, 2, 2, 0, + 1, 1, -2, 2, 0, + -1, 1, 0, 2, 2, + 1, -2, 2, -2, 1, + 0, 0, 1, 0, 2, + 0, 0, 1, 0, 1, + 0, 0, 1, 0, 0, + -1, 2, 0, 2, 1, + 0, 0, 2, 0, 2, + -2, 0, 2, 0, 2, + 2, 0, 0, -1, 1, + 3, 0, 0, -2, 1, + 1, 0, 2, -2, 3, + 1, 2, 0, 0, 1, + 2, 0, 2, -3, 2, + -1, 1, 4, -2, 2, + -2, -2, 0, 4, 0, + 0, -3, 0, 2, 0, + 0, 0, -2, 4, 0, + -1, -1, 0, 3, 0, + -2, 0, 0, 4, 2, + -1, 0, 0, 3, 1, + 2, -2, 0, 0, 0, + 1, -1, 0, 1, 0, + -1, 0, 0, 2, 0, + 0, -2, 2, 0, 1, + -1, 0, 1, 2, 1, + -1, 1, 0, 3, 0, + -1, -1, 2, 1, 2, + 0, -1, 2, 0, 0, + -2, 1, 2, 2, 1, + 2, -2, 2, -2, 2, + 1, 1, 0, 1, 1, + 1, 0, 1, 0, 1, + 1, 0, 1, 0, 0, + 0, 2, 0, 2, 0, + 2, -1, 2, -2, 1, + 0, -1, 4, -2, 1, + 0, 0, 4, -2, 3, + 0, 1, 4, -2, 1, + 4, 0, 2, -4, 2, + 2, 2, 2, -2, 2, + 2, 0, 4, -4, 2, + -1, -2, 0, 4, 0, + -1, -3, 2, 2, 2, + -3, 0, 2, 4, 2, + -3, 0, 2, -2, 1, + -1, -1, 0, -2, 1, + -3, 0, 0, 0, 2, + -3, 0, -2, 2, 0, + 0, 1, 0, -4, 1, + -2, 1, 0, -2, 1, + -4, 0, 0, 0, 1, + -1, 0, 0, -4, 1, + -3, 0, 0, -2, 1, + 0, 0, 0, 3, 2, + -1, 1, 0, 4, 1, + 1, -2, 2, 0, 1, + 0, 1, 0, 3, 0, + -1, 0, 2, 2, 3, + 0, 0, 2, 2, 2, + -2, 0, 2, 2, 2, + -1, 1, 2, 2, 0, + 3, 0, 0, 0, 2, + 2, 1, 0, 1, 0, + 2, -1, 2, -1, 2, + 0, 0, 2, 0, 1, + 0, 0, 3, 0, 3, + 0, 0, 3, 0, 2, + -1, 2, 2, 2, 1, + -1, 0, 4, 0, 0, + 1, 2, 2, 0, 1, + 3, 1, 2, -2, 1, + 1, 1, 4, -2, 2, + -2, -1, 0, 6, 0, + 0, -2, 0, 4, 0, + -2, 0, 0, 6, 1, + -2, -2, 2, 4, 2, + 0, -3, 2, 2, 2, + 0, 0, 0, 4, 2, + -1, -1, 2, 3, 2, + -2, 0, 2, 4, 0, + 2, -1, 0, 2, 1, + 1, 0, 0, 3, 0, + 0, 1, 0, 4, 1, + 0, 1, 0, 4, 0, + 1, -1, 2, 1, 2, + 0, 0, 2, 2, 3, + 1, 0, 2, 2, 2, + -1, 0, 2, 2, 2, + -2, 0, 4, 2, 1, + 2, 1, 0, 2, 1, + 2, 1, 0, 2, 0, + 2, -1, 2, 0, 0, + 1, 0, 2, 1, 0, + 0, 1, 2, 2, 0, + 2, 0, 2, 0, 3, + 3, 0, 2, 0, 2, + 1, 0, 2, 0, 2, + 1, 0, 3, 0, 3, + 1, 1, 2, 1, 1, + 0, 2, 2, 2, 2, + 2, 1, 2, 0, 0, + 2, 0, 4, -2, 1, + 4, 1, 2, -2, 2, + -1, -1, 0, 6, 0, + -3, -1, 2, 6, 2, + -1, 0, 0, 6, 1, + -3, 0, 2, 6, 1, + 1, -1, 0, 4, 1, + 1, -1, 0, 4, 0, + -2, 0, 2, 5, 2, + 1, -2, 2, 2, 1, + 3, -1, 0, 2, 0, + 1, -1, 2, 2, 0, + 0, 0, 2, 3, 1, + -1, 1, 2, 4, 1, + 0, 1, 2, 3, 2, + -1, 0, 4, 2, 1, + 2, 0, 2, 1, 1, + 5, 0, 0, 0, 0, + 2, 1, 2, 1, 2, + 1, 0, 4, 0, 1, + 3, 1, 2, 0, 1, + 3, 0, 4, -2, 2, + -2, -1, 2, 6, 2, + 0, 0, 0, 6, 0, + 0, -2, 2, 4, 2, + -2, 0, 2, 6, 1, + 2, 0, 0, 4, 1, + 2, 0, 0, 4, 0, + 2, -2, 2, 2, 2, + 0, 0, 2, 4, 0, + 1, 0, 2, 3, 2, + 4, 0, 0, 2, 0, + 2, 0, 2, 2, 0, + 0, 0, 4, 2, 2, + 4, -1, 2, 0, 2, + 3, 0, 2, 1, 2, + 2, 1, 2, 2, 1, + 4, 1, 2, 0, 2, + -1, -1, 2, 6, 2, + -1, 0, 2, 6, 1, + 1, -1, 2, 4, 1, + 1, 1, 2, 4, 2, + 3, 1, 2, 2, 2, + 5, 0, 2, 0, 1, + 2, -1, 2, 4, 2, + 2, 0, 2, 4, 1, + }; + + #endregion + + #region Luni-Solar nutation coefficients + + /// + /// Luni-Solar nutation coefficients, unit 1e-7 arcsec + /// longitude (sin, t*sin, cos), obliquity (cos, t*cos, sin) + /// + public static Int32[] cls = new Int32[]{ + -172064161, -174666, 33386, 92052331, 9086, 15377, + -13170906, -1675, -13696, 5730336, -3015, -4587, + -2276413, -234, 2796, 978459, -485, 1374, + 2074554, 207, -698, -897492, 470, -291, + 1475877, -3633, 11817, 73871, -184, -1924, + -516821, 1226, -524, 224386, -677, -174, + 711159, 73, -872, -6750, 0, 358, + -387298, -367, 380, 200728, 18, 318, + -301461, -36, 816, 129025, -63, 367, + 215829, -494, 111, -95929, 299, 132, + 128227, 137, 181, -68982, -9, 39, + 123457, 11, 19, -53311, 32, -4, + 156994, 10, -168, -1235, 0, 82, + 63110, 63, 27, -33228, 0, -9, + -57976, -63, -189, 31429, 0, -75, + -59641, -11, 149, 25543, -11, 66, + -51613, -42, 129, 26366, 0, 78, + 45893, 50, 31, -24236, -10, 20, + 63384, 11, -150, -1220, 0, 29, + -38571, -1, 158, 16452, -11, 68, + 32481, 0, 0, -13870, 0, 0, + -47722, 0, -18, 477, 0, -25, + -31046, -1, 131, 13238, -11, 59, + 28593, 0, -1, -12338, 10, -3, + 20441, 21, 10, -10758, 0, -3, + 29243, 0, -74, -609, 0, 13, + 25887, 0, -66, -550, 0, 11, + -14053, -25, 79, 8551, -2, -45, + 15164, 10, 11, -8001, 0, -1, + -15794, 72, -16, 6850, -42, -5, + 21783, 0, 13, -167, 0, 13, + -12873, -10, -37, 6953, 0, -14, + -12654, 11, 63, 6415, 0, 26, + -10204, 0, 25, 5222, 0, 15, + 16707, -85, -10, 168, -1, 10, + -7691, 0, 44, 3268, 0, 19, + -11024, 0, -14, 104, 0, 2, + 7566, -21, -11, -3250, 0, -5, + -6637, -11, 25, 3353, 0, 14, + -7141, 21, 8, 3070, 0, 4, + -6302, -11, 2, 3272, 0, 4, + 5800, 10, 2, -3045, 0, -1, + 6443, 0, -7, -2768, 0, -4, + -5774, -11, -15, 3041, 0, -5, + -5350, 0, 21, 2695, 0, 12, + -4752, -11, -3, 2719, 0, -3, + -4940, -11, -21, 2720, 0, -9, + 7350, 0, -8, -51, 0, 4, + 4065, 0, 6, -2206, 0, 1, + 6579, 0, -24, -199, 0, 2, + 3579, 0, 5, -1900, 0, 1, + 4725, 0, -6, -41, 0, 3, + -3075, 0, -2, 1313, 0, -1, + -2904, 0, 15, 1233, 0, 7, + 4348, 0, -10, -81, 0, 2, + -2878, 0, 8, 1232, 0, 4, + -4230, 0, 5, -20, 0, -2, + -2819, 0, 7, 1207, 0, 3, + -4056, 0, 5, 40, 0, -2, + -2647, 0, 11, 1129, 0, 5, + -2294, 0, -10, 1266, 0, -4, + 2481, 0, -7, -1062, 0, -3, + 2179, 0, -2, -1129, 0, -2, + 3276, 0, 1, -9, 0, 0, + -3389, 0, 5, 35, 0, -2, + 3339, 0, -13, -107, 0, 1, + -1987, 0, -6, 1073, 0, -2, + -1981, 0, 0, 854, 0, 0, + 4026, 0, -353, -553, 0, -139, + 1660, 0, -5, -710, 0, -2, + -1521, 0, 9, 647, 0, 4, + 1314, 0, 0, -700, 0, 0, + -1283, 0, 0, 672, 0, 0, + -1331, 0, 8, 663, 0, 4, + 1383, 0, -2, -594, 0, -2, + 1405, 0, 4, -610, 0, 2, + 1290, 0, 0, -556, 0, 0, + -1214, 0, 5, 518, 0, 2, + 1146, 0, -3, -490, 0, -1, + 1019, 0, -1, -527, 0, -1, + -1100, 0, 9, 465, 0, 4, + -970, 0, 2, 496, 0, 1, + 1575, 0, -6, -50, 0, 0, + 934, 0, -3, -399, 0, -1, + 922, 0, -1, -395, 0, -1, + 815, 0, -1, -422, 0, -1, + 834, 0, 2, -440, 0, 1, + 1248, 0, 0, -170, 0, 1, + 1338, 0, -5, -39, 0, 0, + 716, 0, -2, -389, 0, -1, + 1282, 0, -3, -23, 0, 1, + 742, 0, 1, -391, 0, 0, + 1020, 0, -25, -495, 0, -10, + 715, 0, -4, -326, 0, 2, + -666, 0, -3, 369, 0, -1, + -667, 0, 1, 346, 0, 1, + -704, 0, 0, 304, 0, 0, + -694, 0, 5, 294, 0, 2, + -1014, 0, -1, 4, 0, -1, + -585, 0, -2, 316, 0, -1, + -949, 0, 1, 8, 0, -1, + -595, 0, 0, 258, 0, 0, + 528, 0, 0, -279, 0, 0, + -590, 0, 4, 252, 0, 2, + 570, 0, -2, -244, 0, -1, + -502, 0, 3, 250, 0, 2, + -875, 0, 1, 29, 0, 0, + -492, 0, -3, 275, 0, -1, + 535, 0, -2, -228, 0, -1, + -467, 0, 1, 240, 0, 1, + 591, 0, 0, -253, 0, 0, + -453, 0, -1, 244, 0, -1, + 766, 0, 1, 9, 0, 0, + -446, 0, 2, 225, 0, 1, + -488, 0, 2, 207, 0, 1, + -468, 0, 0, 201, 0, 0, + -421, 0, 1, 216, 0, 1, + 463, 0, 0, -200, 0, 0, + -673, 0, 2, 14, 0, 0, + 658, 0, 0, -2, 0, 0, + -438, 0, 0, 188, 0, 0, + -390, 0, 0, 205, 0, 0, + 639, -11, -2, -19, 0, 0, + 412, 0, -2, -176, 0, -1, + -361, 0, 0, 189, 0, 0, + 360, 0, -1, -185, 0, -1, + 588, 0, -3, -24, 0, 0, + -578, 0, 1, 5, 0, 0, + -396, 0, 0, 171, 0, 0, + 565, 0, -1, -6, 0, 0, + -335, 0, -1, 184, 0, -1, + 357, 0, 1, -154, 0, 0, + 321, 0, 1, -174, 0, 0, + -301, 0, -1, 162, 0, 0, + -334, 0, 0, 144, 0, 0, + 493, 0, -2, -15, 0, 0, + 494, 0, -2, -19, 0, 0, + 337, 0, -1, -143, 0, -1, + 280, 0, -1, -144, 0, 0, + 309, 0, 1, -134, 0, 0, + -263, 0, 2, 131, 0, 1, + 253, 0, 1, -138, 0, 0, + 245, 0, 0, -128, 0, 0, + 416, 0, -2, -17, 0, 0, + -229, 0, 0, 128, 0, 0, + 231, 0, 0, -120, 0, 0, + -259, 0, 2, 109, 0, 1, + 375, 0, -1, -8, 0, 0, + 252, 0, 0, -108, 0, 0, + -245, 0, 1, 104, 0, 0, + 243, 0, -1, -104, 0, 0, + 208, 0, 1, -112, 0, 0, + 199, 0, 0, -102, 0, 0, + -208, 0, 1, 105, 0, 0, + 335, 0, -2, -14, 0, 0, + -325, 0, 1, 7, 0, 0, + -187, 0, 0, 96, 0, 0, + 197, 0, -1, -100, 0, 0, + -192, 0, 2, 94, 0, 1, + -188, 0, 0, 83, 0, 0, + 276, 0, 0, -2, 0, 0, + -286, 0, 1, 6, 0, 0, + 186, 0, -1, -79, 0, 0, + -219, 0, 0, 43, 0, 0, + 276, 0, 0, 2, 0, 0, + -153, 0, -1, 84, 0, 0, + -156, 0, 0, 81, 0, 0, + -154, 0, 1, 78, 0, 0, + -174, 0, 1, 75, 0, 0, + -163, 0, 2, 69, 0, 1, + -228, 0, 0, 1, 0, 0, + 91, 0, -4, -54, 0, -2, + 175, 0, 0, -75, 0, 0, + -159, 0, 0, 69, 0, 0, + 141, 0, 0, -72, 0, 0, + 147, 0, 0, -75, 0, 0, + -132, 0, 0, 69, 0, 0, + 159, 0, -28, -54, 0, 11, + 213, 0, 0, -4, 0, 0, + 123, 0, 0, -64, 0, 0, + -118, 0, -1, 66, 0, 0, + 144, 0, -1, -61, 0, 0, + -121, 0, 1, 60, 0, 0, + -134, 0, 1, 56, 0, 1, + -105, 0, 0, 57, 0, 0, + -102, 0, 0, 56, 0, 0, + 120, 0, 0, -52, 0, 0, + 101, 0, 0, -54, 0, 0, + -113, 0, 0, 59, 0, 0, + -106, 0, 0, 61, 0, 0, + -129, 0, 1, 55, 0, 0, + -114, 0, 0, 57, 0, 0, + 113, 0, -1, -49, 0, 0, + -102, 0, 0, 44, 0, 0, + -94, 0, 0, 51, 0, 0, + -100, 0, -1, 56, 0, 0, + 87, 0, 0, -47, 0, 0, + 161, 0, 0, -1, 0, 0, + 96, 0, 0, -50, 0, 0, + 151, 0, -1, -5, 0, 0, + -104, 0, 0, 44, 0, 0, + -110, 0, 0, 48, 0, 0, + -100, 0, 1, 50, 0, 0, + 92, 0, -5, 12, 0, -2, + 82, 0, 0, -45, 0, 0, + 82, 0, 0, -45, 0, 0, + -78, 0, 0, 41, 0, 0, + -77, 0, 0, 43, 0, 0, + 2, 0, 0, 54, 0, 0, + 94, 0, 0, -40, 0, 0, + -93, 0, 0, 40, 0, 0, + -83, 0, 10, 40, 0, -2, + 83, 0, 0, -36, 0, 0, + -91, 0, 0, 39, 0, 0, + 128, 0, 0, -1, 0, 0, + -79, 0, 0, 34, 0, 0, + -83, 0, 0, 47, 0, 0, + 84, 0, 0, -44, 0, 0, + 83, 0, 0, -43, 0, 0, + 91, 0, 0, -39, 0, 0, + -77, 0, 0, 39, 0, 0, + 84, 0, 0, -43, 0, 0, + -92, 0, 1, 39, 0, 0, + -92, 0, 1, 39, 0, 0, + -94, 0, 0, 0, 0, 0, + 68, 0, 0, -36, 0, 0, + -61, 0, 0, 32, 0, 0, + 71, 0, 0, -31, 0, 0, + 62, 0, 0, -34, 0, 0, + -63, 0, 0, 33, 0, 0, + -73, 0, 0, 32, 0, 0, + 115, 0, 0, -2, 0, 0, + -103, 0, 0, 2, 0, 0, + 63, 0, 0, -28, 0, 0, + 74, 0, 0, -32, 0, 0, + -103, 0, -3, 3, 0, -1, + -69, 0, 0, 30, 0, 0, + 57, 0, 0, -29, 0, 0, + 94, 0, 0, -4, 0, 0, + 64, 0, 0, -33, 0, 0, + -63, 0, 0, 26, 0, 0, + -38, 0, 0, 20, 0, 0, + -43, 0, 0, 24, 0, 0, + -45, 0, 0, 23, 0, 0, + 47, 0, 0, -24, 0, 0, + -48, 0, 0, 25, 0, 0, + 45, 0, 0, -26, 0, 0, + 56, 0, 0, -25, 0, 0, + 88, 0, 0, 2, 0, 0, + -75, 0, 0, 0, 0, 0, + 85, 0, 0, 0, 0, 0, + 49, 0, 0, -26, 0, 0, + -74, 0, -3, -1, 0, -1, + -39, 0, 0, 21, 0, 0, + 45, 0, 0, -20, 0, 0, + 51, 0, 0, -22, 0, 0, + -40, 0, 0, 21, 0, 0, + 41, 0, 0, -21, 0, 0, + -42, 0, 0, 24, 0, 0, + -51, 0, 0, 22, 0, 0, + -42, 0, 0, 22, 0, 0, + 39, 0, 0, -21, 0, 0, + 46, 0, 0, -18, 0, 0, + -53, 0, 0, 22, 0, 0, + 82, 0, 0, -4, 0, 0, + 81, 0, -1, -4, 0, 0, + 47, 0, 0, -19, 0, 0, + 53, 0, 0, -23, 0, 0, + -45, 0, 0, 22, 0, 0, + -44, 0, 0, -2, 0, 0, + -33, 0, 0, 16, 0, 0, + -61, 0, 0, 1, 0, 0, + 28, 0, 0, -15, 0, 0, + -38, 0, 0, 19, 0, 0, + -33, 0, 0, 21, 0, 0, + -60, 0, 0, 0, 0, 0, + 48, 0, 0, -10, 0, 0, + 27, 0, 0, -14, 0, 0, + 38, 0, 0, -20, 0, 0, + 31, 0, 0, -13, 0, 0, + -29, 0, 0, 15, 0, 0, + 28, 0, 0, -15, 0, 0, + -32, 0, 0, 15, 0, 0, + 45, 0, 0, -8, 0, 0, + -44, 0, 0, 19, 0, 0, + 28, 0, 0, -15, 0, 0, + -51, 0, 0, 0, 0, 0, + -36, 0, 0, 20, 0, 0, + 44, 0, 0, -19, 0, 0, + 26, 0, 0, -14, 0, 0, + -60, 0, 0, 2, 0, 0, + 35, 0, 0, -18, 0, 0, + -27, 0, 0, 11, 0, 0, + 47, 0, 0, -1, 0, 0, + 36, 0, 0, -15, 0, 0, + -36, 0, 0, 20, 0, 0, + -35, 0, 0, 19, 0, 0, + -37, 0, 0, 19, 0, 0, + 32, 0, 0, -16, 0, 0, + 35, 0, 0, -14, 0, 0, + 32, 0, 0, -13, 0, 0, + 65, 0, 0, -2, 0, 0, + 47, 0, 0, -1, 0, 0, + 32, 0, 0, -16, 0, 0, + 37, 0, 0, -16, 0, 0, + -30, 0, 0, 15, 0, 0, + -32, 0, 0, 16, 0, 0, + -31, 0, 0, 13, 0, 0, + 37, 0, 0, -16, 0, 0, + 31, 0, 0, -13, 0, 0, + 49, 0, 0, -2, 0, 0, + 32, 0, 0, -13, 0, 0, + 23, 0, 0, -12, 0, 0, + -43, 0, 0, 18, 0, 0, + 26, 0, 0, -11, 0, 0, + -32, 0, 0, 14, 0, 0, + -29, 0, 0, 14, 0, 0, + -27, 0, 0, 12, 0, 0, + 30, 0, 0, 0, 0, 0, + -11, 0, 0, 5, 0, 0, + -21, 0, 0, 10, 0, 0, + -34, 0, 0, 15, 0, 0, + -10, 0, 0, 6, 0, 0, + -36, 0, 0, 0, 0, 0, + -9, 0, 0, 4, 0, 0, + -12, 0, 0, 5, 0, 0, + -21, 0, 0, 5, 0, 0, + -29, 0, 0, -1, 0, 0, + -15, 0, 0, 3, 0, 0, + -20, 0, 0, 0, 0, 0, + 28, 0, 0, 0, 0, -2, + 17, 0, 0, 0, 0, 0, + -22, 0, 0, 12, 0, 0, + -14, 0, 0, 7, 0, 0, + 24, 0, 0, -11, 0, 0, + 11, 0, 0, -6, 0, 0, + 14, 0, 0, -6, 0, 0, + 24, 0, 0, 0, 0, 0, + 18, 0, 0, -8, 0, 0, + -38, 0, 0, 0, 0, 0, + -31, 0, 0, 0, 0, 0, + -16, 0, 0, 8, 0, 0, + 29, 0, 0, 0, 0, 0, + -18, 0, 0, 10, 0, 0, + -10, 0, 0, 5, 0, 0, + -17, 0, 0, 10, 0, 0, + 9, 0, 0, -4, 0, 0, + 16, 0, 0, -6, 0, 0, + 22, 0, 0, -12, 0, 0, + 20, 0, 0, 0, 0, 0, + -13, 0, 0, 6, 0, 0, + -17, 0, 0, 9, 0, 0, + -14, 0, 0, 8, 0, 0, + 0, 0, 0, -7, 0, 0, + 14, 0, 0, 0, 0, 0, + 19, 0, 0, -10, 0, 0, + -34, 0, 0, 0, 0, 0, + -20, 0, 0, 8, 0, 0, + 9, 0, 0, -5, 0, 0, + -18, 0, 0, 7, 0, 0, + 13, 0, 0, -6, 0, 0, + 17, 0, 0, 0, 0, 0, + -12, 0, 0, 5, 0, 0, + 15, 0, 0, -8, 0, 0, + -11, 0, 0, 3, 0, 0, + 13, 0, 0, -5, 0, 0, + -18, 0, 0, 0, 0, 0, + -35, 0, 0, 0, 0, 0, + 9, 0, 0, -4, 0, 0, + -19, 0, 0, 10, 0, 0, + -26, 0, 0, 11, 0, 0, + 8, 0, 0, -4, 0, 0, + -10, 0, 0, 4, 0, 0, + 10, 0, 0, -6, 0, 0, + -21, 0, 0, 9, 0, 0, + -15, 0, 0, 0, 0, 0, + 9, 0, 0, -5, 0, 0, + -29, 0, 0, 0, 0, 0, + -19, 0, 0, 10, 0, 0, + 12, 0, 0, -5, 0, 0, + 22, 0, 0, -9, 0, 0, + -10, 0, 0, 5, 0, 0, + -20, 0, 0, 11, 0, 0, + -20, 0, 0, 0, 0, 0, + -17, 0, 0, 7, 0, 0, + 15, 0, 0, -3, 0, 0, + 8, 0, 0, -4, 0, 0, + 14, 0, 0, 0, 0, 0, + -12, 0, 0, 6, 0, 0, + 25, 0, 0, 0, 0, 0, + -13, 0, 0, 6, 0, 0, + -14, 0, 0, 8, 0, 0, + 13, 0, 0, -5, 0, 0, + -17, 0, 0, 9, 0, 0, + -12, 0, 0, 6, 0, 0, + -10, 0, 0, 5, 0, 0, + 10, 0, 0, -6, 0, 0, + -15, 0, 0, 0, 0, 0, + -22, 0, 0, 0, 0, 0, + 28, 0, 0, -1, 0, 0, + 15, 0, 0, -7, 0, 0, + 23, 0, 0, -10, 0, 0, + 12, 0, 0, -5, 0, 0, + 29, 0, 0, -1, 0, 0, + -25, 0, 0, 1, 0, 0, + 22, 0, 0, 0, 0, 0, + -18, 0, 0, 0, 0, 0, + 15, 0, 0, 3, 0, 0, + -23, 0, 0, 0, 0, 0, + 12, 0, 0, -5, 0, 0, + -8, 0, 0, 4, 0, 0, + -19, 0, 0, 0, 0, 0, + -10, 0, 0, 4, 0, 0, + 21, 0, 0, -9, 0, 0, + 23, 0, 0, -1, 0, 0, + -16, 0, 0, 8, 0, 0, + -19, 0, 0, 9, 0, 0, + -22, 0, 0, 10, 0, 0, + 27, 0, 0, -1, 0, 0, + 16, 0, 0, -8, 0, 0, + 19, 0, 0, -8, 0, 0, + 9, 0, 0, -4, 0, 0, + -9, 0, 0, 4, 0, 0, + -9, 0, 0, 4, 0, 0, + -8, 0, 0, 4, 0, 0, + 18, 0, 0, -9, 0, 0, + 16, 0, 0, -1, 0, 0, + -10, 0, 0, 4, 0, 0, + -23, 0, 0, 9, 0, 0, + 16, 0, 0, -1, 0, 0, + -12, 0, 0, 6, 0, 0, + -8, 0, 0, 4, 0, 0, + 30, 0, 0, -2, 0, 0, + 24, 0, 0, -10, 0, 0, + 10, 0, 0, -4, 0, 0, + -16, 0, 0, 7, 0, 0, + -16, 0, 0, 7, 0, 0, + 17, 0, 0, -7, 0, 0, + -24, 0, 0, 10, 0, 0, + -12, 0, 0, 5, 0, 0, + -24, 0, 0, 11, 0, 0, + -23, 0, 0, 9, 0, 0, + -13, 0, 0, 5, 0, 0, + -15, 0, 0, 7, 0, 0, + 0, 0, -1988, 0, 0, -1679, + 0, 0, -63, 0, 0, -27, + -4, 0, 0, 0, 0, 0, + 0, 0, 5, 0, 0, 4, + 5, 0, 0, -3, 0, 0, + 0, 0, 364, 0, 0, 176, + 0, 0, -1044, 0, 0, -891, + -3, 0, 0, 1, 0, 0, + 4, 0, 0, -2, 0, 0, + 0, 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, 0, 0, 2, 0, 0, + -4, 0, 0, 2, 0, 0, + 9, 0, 0, -3, 0, 0, + -4, 0, 0, 0, 0, 0, + -4, 0, 0, 0, 0, 0, + 3, 0, 0, -2, 0, 0, + 8, 0, 0, 0, 0, 0, + 3, 0, 0, 0, 0, 0, + -3, 0, 0, 2, 0, 0, + 3, 0, 0, -1, 0, 0, + 3, 0, 0, -1, 0, 0, + -3, 0, 0, 1, 0, 0, + 6, 0, 0, -3, 0, 0, + 3, 0, 0, 0, 0, 0, + -3, 0, 0, 1, 0, 0, + -7, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, + -3, 0, 0, 2, 0, 0, + -3, 0, 0, 0, 0, 0, + -4, 0, 0, 0, 0, 0, + -5, 0, 0, 3, 0, 0, + -13, 0, 0, 0, 0, 0, + -7, 0, 0, 0, 0, 0, + 10, 0, 0, 0, 0, 0, + 3, 0, 0, -1, 0, 0, + 10, 0, 13, 6, 0, -5, + 0, 0, 30, 0, 0, 14, + 0, 0, -162, 0, 0, -138, + 0, 0, 75, 0, 0, 0, + -7, 0, 0, 4, 0, 0, + -4, 0, 0, 2, 0, 0, + 4, 0, 0, -2, 0, 0, + 5, 0, 0, -2, 0, 0, + 5, 0, 0, -3, 0, 0, + -3, 0, 0, 0, 0, 0, + -3, 0, 0, 2, 0, 0, + -4, 0, 0, 2, 0, 0, + -5, 0, 0, 2, 0, 0, + 6, 0, 0, 0, 0, 0, + 9, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + -7, 0, 0, 0, 0, 0, + -3, 0, 0, 1, 0, 0, + -4, 0, 0, 2, 0, 0, + 7, 0, 0, 0, 0, 0, + -4, 0, 0, 0, 0, 0, + 4, 0, 0, 0, 0, 0, + -6, 0, -3, 3, 0, 1, + 0, 0, -3, 0, 0, -2, + 11, 0, 0, 0, 0, 0, + 3, 0, 0, -1, 0, 0, + 11, 0, 0, 0, 0, 0, + -3, 0, 0, 2, 0, 0, + -1, 0, 3, 3, 0, -1, + 4, 0, 0, -2, 0, 0, + 0, 0, -13, 0, 0, -11, + 3, 0, 6, 0, 0, 0, + -7, 0, 0, 0, 0, 0, + 5, 0, 0, -3, 0, 0, + -3, 0, 0, 1, 0, 0, + 3, 0, 0, 0, 0, 0, + 5, 0, 0, -3, 0, 0, + -7, 0, 0, 3, 0, 0, + 8, 0, 0, -3, 0, 0, + -4, 0, 0, 2, 0, 0, + 11, 0, 0, 0, 0, 0, + -3, 0, 0, 1, 0, 0, + 3, 0, 0, -1, 0, 0, + -4, 0, 0, 2, 0, 0, + 8, 0, 0, -4, 0, 0, + 3, 0, 0, -1, 0, 0, + 11, 0, 0, 0, 0, 0, + -6, 0, 0, 3, 0, 0, + -4, 0, 0, 2, 0, 0, + -8, 0, 0, 4, 0, 0, + -7, 0, 0, 3, 0, 0, + -4, 0, 0, 2, 0, 0, + 3, 0, 0, -1, 0, 0, + 6, 0, 0, -3, 0, 0, + -6, 0, 0, 3, 0, 0, + 6, 0, 0, 0, 0, 0, + 6, 0, 0, -1, 0, 0, + 5, 0, 0, -2, 0, 0, + -5, 0, 0, 2, 0, 0, + -4, 0, 0, 0, 0, 0, + -4, 0, 0, 2, 0, 0, + 4, 0, 0, 0, 0, 0, + 6, 0, 0, -3, 0, 0, + -4, 0, 0, 2, 0, 0, + 0, 0, -26, 0, 0, -11, + 0, 0, -10, 0, 0, -5, + 5, 0, 0, -3, 0, 0, + -13, 0, 0, 0, 0, 0, + 3, 0, 0, -2, 0, 0, + 4, 0, 0, -2, 0, 0, + 7, 0, 0, -3, 0, 0, + 4, 0, 0, 0, 0, 0, + 5, 0, 0, 0, 0, 0, + -3, 0, 0, 2, 0, 0, + -6, 0, 0, 2, 0, 0, + -5, 0, 0, 2, 0, 0, + -7, 0, 0, 3, 0, 0, + 5, 0, 0, -2, 0, 0, + 13, 0, 0, 0, 0, 0, + -4, 0, 0, 2, 0, 0, + -3, 0, 0, 0, 0, 0, + 5, 0, 0, -2, 0, 0, + -11, 0, 0, 0, 0, 0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 0, + 5, 0, 0, -2, 0, 0, + -4, 0, 0, 2, 0, 0, + -4, 0, 0, 2, 0, 0, + -3, 0, 0, 2, 0, 0, + 4, 0, 0, -2, 0, 0, + 3, 0, 0, -1, 0, 0, + -3, 0, 0, 1, 0, 0, + -3, 0, 0, 1, 0, 0, + -3, 0, 0, 2, 0, 0, + }; + #endregion + + #region Planetary argument multipliers + + /// + /// Planetary argument multipliers + /// + /// + /// L L' F D Om Me Ve E Ma Ju Sa Ur Ne pre + /// + public static Int16[] npl = new Int16[] { + 0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -8, 16, -4, -5, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 8,-16, 4, 5, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 2, 2, + 0, 0, 0, 0, 0, 0, 0, -4, 8, -1, -5, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 1, + 0, 0, 1, -1, 1, 0, 0, 3, -8, 3, 0, 0, 0, 0, + -1, 0, 0, 0, 0, 0, 10, -3, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 6, -3, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 4, -8, 3, 0, 0, 0, 0, + 0, 0, 1, -1, 1, 0, 0, -5, 8, -3, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, -4, 8, -3, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 4, -8, 1, 5, 0, 0, 2, + 0, 0, 0, 0, 0, 0, -5, 6, 4, 0, 0, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 2, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -5, 0, 0, 1, + 0, 0, 1, -1, 1, 0, 0, -1, 0, 2, -5, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 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2, 2, 0, 3, -3, 0, 0, 0, 0, 0, 0, + 1, 0, 2, 0, 2, 0, 1, -1, 0, 0, 0, 0, 0, 0, + 0, 0, 2, 2, 2, 0, 0, 2, 0, -2, 0, 0, 0, 0, + }; + + #endregion + + #region Planetary nutation coefficients, unit 1e-7 arcsec + + /// + /// Planetary nutation coefficients, unit 1e-7 arcsec + /// + /// + /// longitude (sin, cos), obliquity (sin, cos) + /// + public static Int16[] icpl = new Int16[]{ + 1440, 0, 0, 0, + 56, -117, -42, -40, + 125, -43, 0, -54, + 0, 5, 0, 0, + 3, -7, -3, 0, + 3, 0, 0, -2, + -114, 0, 0, 61, + -219, 89, 0, 0, + -3, 0, 0, 0, + -462, 1604, 0, 0, + 99, 0, 0, -53, + -3, 0, 0, 2, + 0, 6, 2, 0, + 3, 0, 0, 0, + -12, 0, 0, 0, + 14, -218, 117, 8, + 31, -481, -257, -17, + -491, 128, 0, 0, + -3084, 5123, 2735, 1647, + -1444, 2409, -1286, -771, + 11, -24, -11, -9, + 26, -9, 0, 0, + 103, -60, 0, 0, + 0, -13, -7, 0, + -26, -29, -16, 14, + 9, -27, -14, -5, + 12, 0, 0, -6, + -7, 0, 0, 0, + 0, 24, 0, 0, + 284, 0, 0, -151, + 226, 101, 0, 0, + 0, -8, -2, 0, + 0, -6, -3, 0, + 5, 0, 0, -3, + -41, 175, 76, 17, + 0, 15, 6, 0, + 425, 212, -133, 269, + 1200, 598, 319, -641, + 235, 334, 0, 0, + 11, -12, -7, -6, + 5, -6, 3, 3, + -5, 0, 0, 3, + 6, 0, 0, -3, + 15, 0, 0, 0, + 13, 0, 0, -7, + -6, -9, 0, 0, + 266, -78, 0, 0, + -460, -435, -232, 246, + 0, 15, 7, 0, + -3, 0, 0, 2, + 0, 131, 0, 0, + 4, 0, 0, 0, + 0, 3, 0, 0, + 0, 4, 2, 0, + 0, 3, 0, 0, + -17, -19, -10, 9, + -9, -11, 6, -5, + -6, 0, 0, 3, + -16, 8, 0, 0, + 0, 3, 0, 0, + 11, 24, 11, -5, + -3, -4, -2, 1, + 3, 0, 0, -1, + 0, -8, -4, 0, + 0, 3, 0, 0, + 0, 5, 0, 0, + 0, 3, 2, 0, + -6, 4, 2, 3, + -3, -5, 0, 0, + -5, 0, 0, 2, + 4, 24, 13, -2, + -42, 20, 0, 0, + -10, 233, 0, 0, + -3, 0, 0, 1, + 78, -18, 0, 0, + 0, 3, 1, 0, + 0, -3, -1, 0, + 0, -4, -2, 1, + 0, -8, -4, -1, + 0, -5, 3, 0, + -7, 0, 0, 3, + -14, 8, 3, 6, + 0, 8, -4, 0, + 0, 19, 10, 0, + 45, -22, 0, 0, + -3, 0, 0, 0, + 0, -3, 0, 0, + 0, 3, 0, 0, + 3, 5, 3, -2, + 89, -16, -9, -48, + 0, 3, 0, 0, + -3, 7, 4, 2, + -349, -62, 0, 0, + -15, 22, 0, 0, + -3, 0, 0, 0, + -53, 0, 0, 0, + 5, 0, 0, -3, + 0, -8, 0, 0, + 15, -7, -4, -8, + -3, 0, 0, 1, + -21, -78, 0, 0, + 20, -70, -37, -11, + 0, 6, 3, 0, + 5, 3, 2, -2, + -17, -4, -2, 9, + 0, 6, 3, 0, + 32, 15, -8, 17, + 174, 84, 45, -93, + 11, 56, 0, 0, + -66, -12, -6, 35, + 47, 8, 4, -25, + 0, 8, 4, 0, + 10, -22, -12, -5, + -3, 0, 0, 2, + -24, 12, 0, 0, + 5, -6, 0, 0, + 3, 0, 0, -2, + 4, 3, 1, -2, + 0, 29, 15, 0, + -5, -4, -2, 2, + 8, -3, -1, -5, + 0, -3, 0, 0, + 10, 0, 0, 0, + 3, 0, 0, -2, + -5, 0, 0, 3, + 46, 66, 35, -25, + -14, 7, 0, 0, + 0, 3, 2, 0, + -5, 0, 0, 0, + -68, -34, -18, 36, + 0, 14, 7, 0, + 10, -6, -3, -5, + -5, -4, -2, 3, + -3, 5, 2, 1, + 76, 17, 9, -41, + 84, 298, 159, -45, + 3, 0, 0, -1, + -3, 0, 0, 2, + -3, 0, 0, 1, + -82, 292, 156, 44, + -73, 17, 9, 39, + -9, -16, 0, 0, + 3, 0, -1, -2, + -3, 0, 0, 0, + -9, -5, -3, 5, + -439, 0, 0, 0, + 57, -28, -15, -30, + 0, -6, -3, 0, + -4, 0, 0, 2, + -40, 57, 30, 21, + 23, 7, 3, -13, + 273, 80, 43, -146, + -449, 430, 0, 0, + -8, -47, -25, 4, + 6, 47, 25, -3, + 0, 23, 13, 0, + -3, 0, 0, 2, + 3, -4, -2, -2, + -48, -110, -59, 26, + 51, 114, 61, -27, + -133, 0, 0, 57, + 0, 4, 0, 0, + -21, -6, -3, 11, + 0, -3, -1, 0, + -11, -21, -11, 6, + -18, -436, -233, 9, + 35, -7, 0, 0, + 0, 5, 3, 0, + 11, -3, -1, -6, + -5, -3, -1, 3, + -53, -9, -5, 28, + 0, 3, 2, 1, + 4, 0, 0, -2, + 0, -4, 0, 0, + -50, 194, 103, 27, + -13, 52, 28, 7, + -91, 248, 0, 0, + 6, 49, 26, -3, + -6, -47, -25, 3, + 0, 5, 3, 0, + 52, 23, 10, -23, + -3, 0, 0, 1, + 0, 5, 3, 0, + -4, 0, 0, 0, + -4, 8, 3, 2, + 10, 0, 0, 0, + 3, 0, 0, -2, + 0, 8, 4, 0, + 0, 8, 4, 1, + -4, 0, 0, 0, + -4, 0, 0, 0, + -8, 4, 2, 4, + 8, -4, -2, -4, + 0, 15, 7, 0, + -138, 0, 0, 0, + 0, -7, -3, 0, + 0, -7, -3, 0, + 54, 0, 0, -29, + 0, 10, 4, 0, + -7, 0, 0, 3, + -37, 35, 19, 20, + 0, 4, 0, 0, + -4, 9, 0, 0, + 8, 0, 0, -4, + -9, -14, -8, 5, + -3, -9, -5, 3, + -145, 47, 0, 0, + -10, 40, 21, 5, + 11, -49, -26, -7, + -2150, 0, 0, 932, + -12, 0, 0, 5, + 85, 0, 0, -37, + 4, 0, 0, -2, + 3, 0, 0, -2, + -86, 153, 0, 0, + -6, 9, 5, 3, + 9, -13, -7, -5, + -8, 12, 6, 4, + -51, 0, 0, 22, + -11, -268, -116, 5, + 0, 12, 5, 0, + 0, 7, 3, 0, + 31, 6, 3, -17, + 140, 27, 14, -75, + 57, 11, 6, -30, + -14, -39, 0, 0, + 0, -6, -2, 0, + 4, 15, 8, -2, + 0, 4, 0, 0, + -3, 0, 0, 1, + 0, 11, 5, 0, + 9, 6, 0, 0, + -4, 10, 4, 2, + 5, 3, 0, 0, + 16, 0, 0, -9, + -3, 0, 0, 0, + 0, 3, 2, -1, + 7, 0, 0, -3, + -25, 22, 0, 0, + 42, 223, 119, -22, + -27, -143, -77, 14, + 9, 49, 26, -5, + -1166, 0, 0, 505, + -5, 0, 0, 2, + -6, 0, 0, 3, + -8, 0, 1, 4, + 0, -4, 0, 0, + 117, 0, 0, -63, + -4, 8, 4, 2, + 3, 0, 0, -2, + -5, 0, 0, 2, + 0, 31, 0, 0, + -5, 0, 1, 3, + 4, 0, 0, -2, + -4, 0, 0, 2, + -24, -13, -6, 10, + 3, 0, 0, 0, + 0, -32, -17, 0, + 8, 12, 5, -3, + 3, 0, 0, -1, + 7, 13, 0, 0, + -3, 16, 0, 0, + 50, 0, 0, -27, + 0, -5, -3, 0, + 13, 0, 0, 0, + 0, 5, 3, 1, + 24, 5, 2, -11, + 5, -11, -5, -2, + 30, -3, -2, -16, + 18, 0, 0, -9, + 8, 614, 0, 0, + 3, -3, -1, -2, + 6, 17, 9, -3, + -3, -9, -5, 2, + 0, 6, 3, -1, + -127, 21, 9, 55, + 3, 5, 0, 0, + -6, -10, -4, 3, + 5, 0, 0, 0, + 16, 9, 4, -7, + 3, 0, 0, -2, + 0, 22, 0, 0, + 0, 19, 10, 0, + 7, 0, 0, -4, + 0, -5, -2, 0, + 0, 3, 1, 0, + -9, 3, 1, 4, + 17, 0, 0, -7, + 0, -3, -2, -1, + -20, 34, 0, 0, + -10, 0, 1, 5, + -4, 0, 0, 2, + 22, -87, 0, 0, + -4, 0, 0, 2, + -3, -6, -2, 1, + -16, -3, -1, 7, + 0, -3, -2, 0, + 4, 0, 0, 0, + -68, 39, 0, 0, + 27, 0, 0, -14, + 0, -4, 0, 0, + -25, 0, 0, 0, + -12, -3, -2, 6, + 3, 0, 0, -1, + 3, 66, 29, -1, + 490, 0, 0, -213, + -22, 93, 49, 12, + -7, 28, 15, 4, + -3, 13, 7, 2, + -46, 14, 0, 0, + -5, 0, 0, 0, + 2, 1, 0, 0, + 0, -3, 0, 0, + -28, 0, 0, 15, + 5, 0, 0, -2, + 0, 3, 0, 0, + -11, 0, 0, 5, + 0, 3, 1, 0, + -3, 0, 0, 1, + 25, 106, 57, -13, + 5, 21, 11, -3, + 1485, 0, 0, 0, + -7, -32, -17, 4, + 0, 5, 3, 0, + -6, -3, -2, 3, + 30, -6, -2, -13, + -4, 4, 0, 0, + -19, 0, 0, 10, + 0, 4, 2, -1, + 0, 3, 0, 0, + 4, 0, 0, -2, + 0, -3, -1, 0, + -3, 0, 0, 0, + 5, 3, 1, -2, + 0, 11, 0, 0, + 118, 0, 0, -52, + 0, -5, -3, 0, + -28, 36, 0, 0, + 5, -5, 0, 0, + 14, -59, -31, -8, + 0, 9, 5, 1, + -458, 0, 0, 198, + 0, -45, -20, 0, + 9, 0, 0, -5, + 0, -3, 0, 0, + 0, -4, -2, -1, + 11, 0, 0, -6, + 6, 0, 0, -2, + -16, 23, 0, 0, + 0, -4, -2, 0, + -5, 0, 0, 2, + -166, 269, 0, 0, + 15, 0, 0, -8, + 10, 0, 0, -4, + -78, 45, 0, 0, + 0, -5, -2, 0, + 7, 0, 0, -4, + -5, 328, 0, 0, + 3, 0, 0, -2, + 5, 0, 0, -2, + 0, 3, 1, 0, + -3, 0, 0, 0, + -3, 0, 0, 0, + 0, -4, -2, 0, + -1223, -26, 0, 0, + 0, 7, 3, 0, + 3, 0, 0, 0, + 0, 3, 2, 0, + -6, 20, 0, 0, + -368, 0, 0, 0, + -75, 0, 0, 0, + 11, 0, 0, -6, + 3, 0, 0, -2, + -3, 0, 0, 1, + -13, -30, 0, 0, + 21, 3, 0, 0, + -3, 0, 0, 1, + -4, 0, 0, 2, + 8, -27, 0, 0, + -19, -11, 0, 0, + -4, 0, 0, 2, + 0, 5, 2, 0, + -6, 0, 0, 2, + -8, 0, 0, 0, + -1, 0, 0, 0, + -14, 0, 0, 6, + 6, 0, 0, 0, + -74, 0, 0, 32, + 0, -3, -1, 0, + 4, 0, 0, -2, + 8, 11, 0, 0, + 0, 3, 2, 0, + -262, 0, 0, 114, + 0, -4, 0, 0, + -7, 0, 0, 4, + 0, -27, -12, 0, + -19, -8, -4, 8, + 202, 0, 0, -87, + -8, 35, 19, 5, + 0, 4, 2, 0, + 16, -5, 0, 0, + 5, 0, 0, -3, + 0, -3, 0, 0, + 1, 0, 0, 0, + -35, -48, -21, 15, + -3, -5, -2, 1, + 6, 0, 0, -3, + 3, 0, 0, -1, + 0, -5, 0, 0, + 12, 55, 29, -6, + 0, 5, 3, 0, + -598, 0, 0, 0, + -3, -13, -7, 1, + -5, -7, -3, 2, + 3, 0, 0, -1, + 5, -7, 0, 0, + 4, 0, 0, -2, + 16, -6, 0, 0, + 8, -3, 0, 0, + 8, -31, -16, -4, + 0, 3, 1, 0, + 113, 0, 0, -49, + 0, -24, -10, 0, + 4, 0, 0, -2, + 27, 0, 0, 0, + -3, 0, 0, 1, + 0, -4, -2, 0, + 5, 0, 0, -2, + 0, -3, 0, 0, + -13, 0, 0, 6, + 5, 0, 0, -2, + -18, -10, -4, 8, + -4, -28, 0, 0, + -5, 6, 3, 2, + -3, 0, 0, 1, + -5, -9, -4, 2, + 17, 0, 0, -7, + 11, 4, 0, 0, + 0, -6, -2, 0, + 83, 15, 0, 0, + -4, 0, 0, 2, + 0, -114, -49, 0, + 117, 0, 0, -51, + -5, 19, 10, 2, + -3, 0, 0, 0, + -3, 0, 0, 2, + 0, -3, -1, 0, + 3, 0, 0, 0, + 0, -6, -2, 0, + 393, 3, 0, 0, + -4, 21, 11, 2, + -6, 0, -1, 3, + -3, 8, 4, 1, + 8, 0, 0, 0, + 18, -29, -13, -8, + 8, 34, 18, -4, + 89, 0, 0, 0, + 3, 12, 6, -1, + 54, -15, -7, -24, + 0, 3, 0, 0, + 3, 0, 0, -1, + 0, 35, 0, 0, + -154, -30, -13, 67, + 15, 0, 0, 0, + 0, 4, 2, 0, + 0, 9, 0, 0, + 80, -71, -31, -35, + 0, -20, -9, 0, + 11, 5, 2, -5, + 61, -96, -42, -27, + 14, 9, 4, -6, + -11, -6, -3, 5, + 0, -3, -1, 0, + 123, -415, -180, -53, + 0, 0, 0, -35, + -5, 0, 0, 0, + 7, -32, -17, -4, + 0, -9, -5, 0, + 0, -4, 2, 0, + -89, 0, 0, 38, + 0, -86, -19, -6, + 0, 0, -19, 6, + -123, -416, -180, 53, + 0, -3, -1, 0, + 12, -6, -3, -5, + -13, 9, 4, 6, + 0, -15, -7, 0, + 3, 0, 0, -1, + -62, -97, -42, 27, + -11, 5, 2, 5, + 0, -19, -8, 0, + -3, 0, 0, 1, + 0, 4, 2, 0, + 0, 3, 0, 0, + 0, 4, 2, 0, + -85, -70, -31, 37, + 163, -12, -5, -72, + -63, -16, -7, 28, + -21, -32, -14, 9, + 0, -3, -1, 0, + 3, 0, 0, -2, + 0, 8, 0, 0, + 3, 10, 4, -1, + 3, 0, 0, -1, + 0, -7, -3, 0, + 0, -4, -2, 0, + 6, 19, 0, 0, + 5, -173, -75, -2, + 0, -7, -3, 0, + 7, -12, -5, -3, + -3, 0, 0, 2, + 3, -4, -2, -1, + 74, 0, 0, -32, + -3, 12, 6, 2, + 26, -14, -6, -11, + 19, 0, 0, -8, + 6, 24, 13, -3, + 83, 0, 0, 0, + 0, -10, -5, 0, + 11, -3, -1, -5, + 3, 0, 1, -1, + 3, 0, 0, -1, + -4, 0, 0, 0, + 5, -23, -12, -3, + -339, 0, 0, 147, + 0, -10, -5, 0, + 5, 0, 0, 0, + 3, 0, 0, -1, + 0, -4, -2, 0, + 18, -3, 0, 0, + 9, -11, -5, -4, + -8, 0, 0, 4, + 3, 0, 0, -1, + 0, 9, 0, 0, + 6, -9, -4, -2, + -4, -12, 0, 0, + 67, -91, -39, -29, + 30, -18, -8, -13, + 0, 0, 0, 0, + 0, -114, -50, 0, + 0, 0, 0, 23, + 517, 16, 7, -224, + 0, -7, -3, 0, + 143, -3, -1, -62, + 29, 0, 0, -13, + -4, 0, 0, 2, + -6, 0, 0, 3, + 5, 12, 5, -2, + -25, 0, 0, 11, + -3, 0, 0, 1, + 0, 4, 2, 0, + -22, 12, 5, 10, + 50, 0, 0, -22, + 0, 7, 4, 0, + 0, 3, 1, 0, + -4, 4, 2, 2, + -5, -11, -5, 2, + 0, 4, 2, 0, + 4, 17, 9, -2, + 59, 0, 0, 0, + 0, -4, -2, 0, + -8, 0, 0, 4, + -3, 0, 0, 0, + 4, -15, -8, -2, + 370, -8, 0, -160, + 0, 0, -3, 0, + 0, 3, 1, 0, + -6, 3, 1, 3, + 0, 6, 0, 0, + -10, 0, 0, 4, + 0, 9, 4, 0, + 4, 17, 7, -2, + 34, 0, 0, -15, + 0, 5, 3, 0, + -5, 0, 0, 2, + -37, -7, -3, 16, + 3, 13, 7, -2, + 40, 0, 0, 0, + 0, -3, -2, 0, + -184, -3, -1, 80, + -3, 0, 0, 1, + -3, 0, 0, 0, + 0, -10, -6, -1, + 31, -6, 0, -13, + -3, -32, -14, 1, + -7, 0, 0, 3, + 0, -8, -4, 0, + 3, -4, 0, 0, + 0, 4, 0, 0, + 0, 3, 1, 0, + 19, -23, -10, 2, + 0, 0, 0, -10, + 0, 3, 2, 0, + 0, 9, 5, -1, + 28, 0, 0, 0, + 0, -7, -4, 0, + 8, -4, 0, -4, + 0, 0, -2, 0, + 0, 3, 0, 0, + -3, 0, 0, 1, + -9, 0, 1, 4, + 3, 12, 5, -1, + 17, -3, -1, 0, + 0, 7, 4, 0, + 19, 0, 0, 0, + 0, -5, -3, 0, + 14, -3, 0, -1, + 0, 0, -1, 0, + 0, 0, 0, -5, + 0, 5, 3, 0, + 13, 0, 0, 0, + 0, -3, -2, 0, + 2, 9, 4, 3, + 0, 0, 0, -4, + 8, 0, 0, 0, + 0, 4, 2, 0, + 6, 0, 0, -3, + 6, 0, 0, 0, + 0, 3, 1, 0, + 5, 0, 0, -2, + 3, 0, 0, -1, + -3, 0, 0, 0, + 6, 0, 0, 0, + 7, 0, 0, 0, + -4, 0, 0, 0, + 4, 0, 0, 0, + 6, 0, 0, 0, + 0, -4, 0, 0, + 0, -4, 0, 0, + 5, 0, 0, 0, + -3, 0, 0, 0, + 4, 0, 0, 0, + -5, 0, 0, 0, + 4, 0, 0, 0, + 0, 3, 0, 0, + 13, 0, 0, 0, + 21, 11, 0, 0, + 0, -5, 0, 0, + 0, -5, -2, 0, + 0, 5, 3, 0, + 0, -5, 0, 0, + -3, 0, 0, 2, + 20, 10, 0, 0, + -34, 0, 0, 0, + -19, 0, 0, 0, + 3, 0, 0, -2, + -3, 0, 0, 1, + -6, 0, 0, 3, + -4, 0, 0, 0, + 3, 0, 0, 0, + 3, 0, 0, 0, + 4, 0, 0, 0, + 3, 0, 0, -1, + 6, 0, 0, -3, + -8, 0, 0, 3, + 0, 3, 1, 0, + -3, 0, 0, 0, + 0, -3, -2, 0, + 126, -63, -27, -55, + -5, 0, 1, 2, + -3, 28, 15, 2, + 5, 0, 1, -2, + 0, 9, 4, 1, + 0, 9, 4, -1, + -126, -63, -27, 55, + 3, 0, 0, -1, + 21, -11, -6, -11, + 0, -4, 0, 0, + -21, -11, -6, 11, + -3, 0, 0, 1, + 0, 3, 1, 0, + 8, 0, 0, -4, + -6, 0, 0, 3, + -3, 0, 0, 1, + 3, 0, 0, -1, + -3, 0, 0, 1, + -5, 0, 0, 2, + 24, -12, -5, -11, + 0, 3, 1, 0, + 0, 3, 1, 0, + 0, 3, 2, 0, + -24, -12, -5, 10, + 4, 0, -1, -2, + 13, 0, 0, -6, + 7, 0, 0, -3, + 3, 0, 0, -1, + 3, 0, 0, -1, + }; + + + #endregion + + } + +} diff --git a/SwephNet/SwephNet/SweLib.cs b/SwephNet/SwephNet/SweLib.cs deleted file mode 100644 index 128f350..0000000 --- a/SwephNet/SwephNet/SweLib.cs +++ /dev/null @@ -1,429 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace SwephNet -{ - /// - /// Library - /// - public class SweLib - { - #region Embedded types - - /// - /// Precession coefficients for remote past and future. - /// - public enum PrecessionCoefficients - { - Vondrak2011, - Williams1994, - Simon1994, - Laskar1986, - Bretagnon2003, - } - - /// - /// IAU precession 1976 or 2003 for recent centuries. - /// - public enum PrecessionIAU - { - None, - IAU_1976, - IAU_2000, - /// - /// precession model P03 - /// - IAU_2006 - } - - #endregion - - #region Constants - - /// - /// Value to convert Degrees to Radian - /// - public const double DEGTORAD = 0.0174532925199433; - - /// - /// Value to convert Radian to Degrees - /// - public const double RADTODEG = 57.2957795130823; - - /// - /// J2000 +/- two centuries - /// - const double PrecessionIAU_1976_Centuries = 2.0; - /// - /// J2000 +/- two centuries - /// - const double PrecessionIAU_2000_Centuries = 2.0; - /// - /// J2000 +/- 75 centuries - /// - /// - /// we use P03 for whole ephemeris - /// - const double PrecessionIAU_2006_Centuries = 75.0; - - #endregion - - /// - /// Reduce x modulo 360 degrees - /// - public static double DegNorm(double x) - { - double y; - y = (x % 360.0); - if (Math.Abs(y) < 1e-13) y = 0; // Alois fix 11-dec-1999 - if (y < 0.0) y += 360.0; - return (y); - } - - /// - /// Convert a degrees value to radians - /// - public static double DegToRad(double x) - { - return x * DEGTORAD; - } - - #region Precession and ecliptic obliquity - - const double AS2R = (DEGTORAD / 3600.0); - const double D2PI = Math.PI * 2.0; - const double EPS0 = (84381.406 * AS2R); - const int NPOL_PEPS = 4; - const int NPER_PEPS = 10; - const int NPOL_PECL = 4; - const int NPER_PECL = 8; - const int NPOL_PEQU = 4; - const int NPER_PEQU = 14; - - /// - /// for pre_peps(): polynomials - /// - static double[,] pepol = new double[,]{ - {+8134.017132, +84028.206305}, - {+5043.0520035, +0.3624445}, - {-0.00710733, -0.00004039}, - {+0.000000271, -0.000000110} - }; - - /// - /// for pre_peps(): periodics - /// - static double[,] peper = new double[,]{ - {+409.90, +396.15, +537.22, +402.90, +417.15, +288.92, +4043.00, +306.00, +277.00, +203.00}, - {-6908.287473, -3198.706291, +1453.674527, -857.748557, +1173.231614, -156.981465, +371.836550, -216.619040, +193.691479, +11.891524}, - {+753.872780, -247.805823, +379.471484, -53.880558, -90.109153, -353.600190, -63.115353, -28.248187, +17.703387, +38.911307}, - {-2845.175469, +449.844989, -1255.915323, +886.736783, +418.887514, +997.912441, -240.979710, +76.541307, -36.788069, -170.964086}, - {-1704.720302, -862.308358, +447.832178, -889.571909, +190.402846, -56.564991, -296.222622, -75.859952, +67.473503, +3.014055} - }; - - /// - /// for pre_pecl(): polynomials - /// - static double[,] pqpol = new double[,]{ - {+5851.607687, -1600.886300}, - {-0.1189000, +1.1689818}, - {-0.00028913, -0.00000020}, - {+0.000000101, -0.000000437} - }; - - /// - /// for pre_pecl(): periodics - /// - static double[,] pqper = new double[,]{ - {708.15, 2309, 1620, 492.2, 1183, 622, 882, 547}, - {-5486.751211, -17.127623, -617.517403, 413.44294, 78.614193, -180.732815, -87.676083, 46.140315}, - {-684.66156, 2446.28388, 399.671049, -356.652376, -186.387003, -316.80007, 198.296701, 101.135679}, /* typo in publication fixed */ - {667.66673, -2354.886252, -428.152441, 376.202861, 184.778874, 335.321713, -185.138669, -120.97283}, - {-5523.863691, -549.74745, -310.998056, 421.535876, -36.776172, -145.278396, -34.74445, 22.885731} - }; - - /// - /// for pre_pequ(): polynomials - /// - static double[,] xypol = new double[,]{ - {+5453.282155, -73750.930350}, - {+0.4252841, -0.7675452}, - {-0.00037173, -0.00018725}, - {-0.000000152, +0.000000231} - }; - - /// - /// for pre_pequ(): periodics - /// - static double[,] xyper = new double[,]{ - {256.75, 708.15, 274.2, 241.45, 2309, 492.2, 396.1, 288.9, 231.1, 1610, 620, 157.87, 220.3, 1200}, - {-819.940624, -8444.676815, 2600.009459, 2755.17563, -167.659835, 871.855056, 44.769698, -512.313065, -819.415595, -538.071099, -189.793622, -402.922932, 179.516345, -9.814756}, - {75004.344875, 624.033993, 1251.136893, -1102.212834, -2660.66498, 699.291817, 153.16722, -950.865637, 499.754645, -145.18821, 558.116553, -23.923029, -165.405086, 9.344131}, - {81491.287984, 787.163481, 1251.296102, -1257.950837, -2966.79973, 639.744522, 131.600209, -445.040117, 584.522874, -89.756563, 524.42963, -13.549067, -210.157124, -44.919798}, - {1558.515853, 7774.939698, -2219.534038, -2523.969396, 247.850422, -846.485643, -1393.124055, 368.526116, 749.045012, 444.704518, 235.934465, 374.049623, -171.33018, -22.899655} - }; - - /// - /// return dpre, deps - /// - internal static Tuple LdpPeps(double tjd) - { - int i; - double w, a, s, c; - int npol = NPOL_PEPS; - int nper = NPER_PEPS; - double t = (tjd - SweDate.J2000) / 36525.0; - double p = 0; - double q = 0; - // periodic terms - for (i = 0; i < nper; i++) - { - w = D2PI * t; - a = w / peper[0, i]; - s = Math.Sin(a); - c = Math.Cos(a); - p += c * peper[1, i] + s * peper[3, i]; - q += c * peper[2, i] + s * peper[4, i]; - } - // polynomial terms - w = 1; - for (i = 0; i < npol; i++) - { - p += pepol[i, 0] * w; - q += pepol[i, 1] * w; - w *= t; - } - // both to radians - p *= AS2R; - q *= AS2R; - // return - return new Tuple(p, q); - } - - const double OFFSET_EPS_JPLHORIZONS = (35.95); - const double DCOR_EPS_JPL_TJD0 = 2437846.5; - const int NDCOR_EPS_JPL = 51; - static double[] dcor_eps_jpl = new double[]{ - 36.726, 36.627, 36.595, 36.578, 36.640, 36.659, 36.731, 36.765, - 36.662, 36.555, 36.335, 36.321, 36.354, 36.227, 36.289, 36.348, 36.257, 36.163, - 35.979, 35.896, 35.842, 35.825, 35.912, 35.950, 36.093, 36.191, 36.009, 35.943, - 35.875, 35.771, 35.788, 35.753, 35.822, 35.866, 35.771, 35.732, 35.543, 35.498, - 35.449, 35.409, 35.497, 35.556, 35.672, 35.760, 35.596, 35.565, 35.510, 35.394, - 35.385, 35.375, 35.415, - }; - - /// - /// Obliquity of the ecliptic at Julian date jd - /// - /// - /// IAU Coefficients are from: - /// J. H. Lieske, T. Lederle, W. Fricke, and B. Morando, - /// "Expressions for the Precession Quantities Based upon the IAU - /// (1976) System of Astronomical Constants," Astronomy and Astrophysics - /// 58, 1-16 (1977). - /// - /// Before or after 200 years from J2000, the formula used is from: - /// J. Laskar, "Secular terms of classical planetary theories - /// using the results of general theory," Astronomy and Astrophysics - /// 157, 59070 (1986). - /// - /// Bretagnon, P. et al.: 2003, "Expressions for Precession Consistent with - /// the IAU 2000A Model". A&A 400,785 - /// B03 84381.4088 -46.836051*t -1667*10-7*t2 +199911*10-8*t3 -523*10-9*t4 -248*10-10*t5 -3*10-11*t6 - /// C03 84381.406 -46.836769*t -1831*10-7*t2 +20034*10-7*t3 -576*10-9*t4 -434*10-10*t5 - /// - /// See precess and page B18 of the Astronomical Almanac. - /// - internal static double Epsiln(double jd, JPL.JplHorizonMode horizons) - { - double eps = 0; - double T = (jd - 2451545.0) / 36525.0; - if ((horizons & JPL.JplHorizonMode.JplHorizons) != 0 && IncludeCodeForDpsiDepsIAU1980) - { - eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448) * DEGTORAD / 3600; - } - else if ((horizons & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) - { - eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448) * DEGTORAD / 3600; - } - else if (UsePrecessionIAU == PrecessionIAU.IAU_1976 && Math.Abs(T) <= PrecessionIAU_1976_Centuries) - { - eps = (((1.813e-3 * T - 5.9e-4) * T - 46.8150) * T + 84381.448) * DEGTORAD / 3600; - } - else if (UsePrecessionIAU == PrecessionIAU.IAU_2000 && Math.Abs(T) <= PrecessionIAU_2000_Centuries) - { - eps = (((1.813e-3 * T - 5.9e-4) * T - 46.84024) * T + 84381.406) * DEGTORAD / 3600; - } - else if (UsePrecessionIAU == PrecessionIAU.IAU_2006 && Math.Abs(T) <= PrecessionIAU_2006_Centuries) - { - eps = (((((-4.34e-8 * T - 5.76e-7) * T + 2.0034e-3) * T - 1.831e-4) * T - 46.836769) * T + 84381.406) * DEGTORAD / 3600.0; - } - else if (UsePrecessionCoefficient == PrecessionCoefficients.Bretagnon2003) - { - eps = ((((((-3e-11 * T - 2.48e-8) * T - 5.23e-7) * T + 1.99911e-3) * T - 1.667e-4) * T - 46.836051) * T + 84381.40880) * DEGTORAD / 3600.0; - } - else if (UsePrecessionCoefficient == PrecessionCoefficients.Simon1994) - { - eps = (((((2.5e-8 * T - 5.1e-7) * T + 1.9989e-3) * T - 1.52e-4) * T - 46.80927) * T + 84381.412) * DEGTORAD / 3600.0; - } - else if (UsePrecessionCoefficient == PrecessionCoefficients.Williams1994) - { - eps = ((((-1.0e-6 * T + 2.0e-3) * T - 1.74e-4) * T - 46.833960) * T + 84381.409) * DEGTORAD / 3600.0;/* */ - } - else if (UsePrecessionCoefficient == PrecessionCoefficients.Laskar1986) - { - T /= 10.0; - eps = (((((((((2.45e-10 * T + 5.79e-9) * T + 2.787e-7) * T - + 7.12e-7) * T - 3.905e-5) * T - 2.4967e-3) * T - - 5.138e-3) * T + 1.99925) * T - 0.0155) * T - 468.093) * T - + 84381.448; - eps *= DEGTORAD / 3600.0; - } - else - { - // Vondrak2011 - var tup = LdpPeps(jd); - eps = tup.Item2; - if ((horizons & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) - { - double tofs = (jd - DCOR_EPS_JPL_TJD0) / 365.25; - double dofs = OFFSET_EPS_JPLHORIZONS; - if (tofs < 0) - { - tofs = 0; - dofs = dcor_eps_jpl[0]; - } - else if (tofs >= NDCOR_EPS_JPL - 1) - { - tofs = NDCOR_EPS_JPL; - dofs = dcor_eps_jpl[NDCOR_EPS_JPL - 1]; - } - else - { - double t0 = (int)tofs; - double t1 = t0 + 1; - dofs = dcor_eps_jpl[(int)t0]; - dofs = (tofs - t0) * (dcor_eps_jpl[(int)t0] - dcor_eps_jpl[(int)t1]) + dcor_eps_jpl[(int)t0]; - } - dofs /= (1000.0 * 3600.0); - eps += dofs * DEGTORAD; - } - } - return eps; - } - - #endregion - - #region Nutation in longitude and obliquity - - internal static double[] Nutation(double J, JPL.JplHorizonMode jplMode) - { - throw new NotImplementedException("SweLib.Nutation()"); - // double[] result; - // if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0 && IncludeCodeForDpsiDepsIAU1980) - // { - // result = NutationIAU1980(J); - // } - // else if (NUT_IAU_1980) - // { - // result = NutationIAU1980(J); - // } - // else if (NUT_IAU_2000A || NUT_IAU_2000B) - // { - // result = NutationIAU2000ab(J); - // /*if ((iflag & SEFLG_JPLHOR_APPROX) && FRAME_BIAS_APPROX_HORIZONS) {*/ - // if ((jplMode & JPL.JplHorizonMode.JplApproximate) != 0 && !ApproximateHorizonsAstrodienst) - // { - // result[0] += -41.7750 / 3600.0 / 1000.0 * DEGTORAD; - // result[1] += -6.8192 / 3600.0 / 1000.0 * DEGTORAD; - // } - // } - // if (IncludeCodeForDpsiDepsIAU1980) - // { - // if ((jplMode & JPL.JplHorizonMode.JplHorizons) != 0) - // { - // double n = (int)(swed.eop_tjd_end - swed.eop_tjd_beg + 0.000001); - // double J2 = J; - // if (J < swed.eop_tjd_beg_horizons) - // J2 = swed.eop_tjd_beg_horizons; - // double dpsi = bessel(swed.dpsi, n + 1, J2 - swed.eop_tjd_beg); - // double deps = bessel(swed.deps, n + 1, J2 - swed.eop_tjd_beg); - // result[0] += dpsi / 3600.0 * DEGTORAD; - // result[1] += deps / 3600.0 * DEGTORAD; - // } - // } - // return result; - } - - #endregion - - #region Parameters - - /// - /// Precession coefficients for remote past and future - /// - public static PrecessionCoefficients UsePrecessionCoefficient = PrecessionCoefficients.Vondrak2011; - - /// - /// IAU precession 1976 or 2003 for recent centuries. - /// - public static PrecessionIAU UsePrecessionIAU = PrecessionIAU.None; - - /// - /// You can set the latter false if you do not want to compile the - /// code required to reproduce JPL Horizons. - /// Keep it TRUE in order to reproduce JPL Horizons following - /// IERS Conventions 1996 (1992), p. 22. Call swe_calc_ut() with - /// iflag|SEFLG_JPLHOR. This options runs only, if the files - /// DPSI_DEPS_IAU1980_FILE_EOPC04 and DPSI_DEPS_IAU1980_FILE_FINALS - /// are in the ephemeris path. - /// - public static bool IncludeCodeForDpsiDepsIAU1980 = true; - - /// - /// If the above define INCLUDE_CODE_FOR_DPSI_DEPS_IAU1980 is FALSE or - /// the software does not find the earth orientation files (see above) - /// in the ephemeris path, then SEFLG_JPLHOR will run as - /// SEFLG_JPLHOR_APPROX. - /// The following define APPROXIMATE_HORIZONS_ASTRODIENST defines - /// the handling of SEFLG_JPLHOR_APPROX. - /// With this flag, planetary positions are always calculated - /// using a recent precession/nutation model. - /// If APPROXIMATE_HORIZONS_ASTRODIENST is FALSE, then the - /// frame bias as recommended by IERS Conventions 2003 and 2010 - /// is *not* applied. Instead, dpsi_bias and deps_bias are added to - /// nutation. This procedure is found in some older astronomical software. - /// Equatorial apparent positions will be close to JPL Horizons - /// (within a few mas) beetween 1962 and current years. Ecl. longitude - /// will be good, latitude bad. - /// If APPROXIMATE_HORIZONS_ASTRODIENST is TRUE, the approximation of - /// JPL Horizons is even better. Frame bias matrix is applied with - /// some correction to RA and another correction is added to epsilon. - /// - public static bool ApproximateHorizonsAstrodienst = true; - - /// - /// The latter, if combined with SEFLG_JPLHOR provides good agreement - /// with JPL Horizons for 1800 - today. However, Horizons uses correct - /// dpsi and deps only after 20-jan-1962. For all dates before that - /// it uses dpsi and deps of 20-jan-1962, which provides a continuous - /// ephemeris, but does not make sense otherwise. - /// Before 1800, even this option does not provide agreement with Horizons, - /// because Horizons uses a different precession model (Owen 1986) - /// before 1800, which is not included in the Swiss Ephemeris. - /// If this macro is FALSE then the program defaults to SEFLG_JPLHOR_APPROX - /// outside the time range of correction data dpsi and deps. - /// Note that this will result in a non-continuous ephemeris near - /// 20-jan-1962 and current years. - /// - /// - /// Horizons method before 20-jan-1962 - /// - public static bool UseHorizonsMethodBefore1980 = true; - - #endregion - - } -} diff --git a/SwephNet/SwephNet/Sweph.cs b/SwephNet/SwephNet/Sweph.cs index ca0b60e..28c21a6 100644 --- a/SwephNet/SwephNet/Sweph.cs +++ b/SwephNet/SwephNet/Sweph.cs @@ -12,7 +12,8 @@ namespace SwephNet public class Sweph : IDisposable, IStreamProvider, - ITracer + ITracer, + ISwephData { private IDependencyContainer _Dependencies; @@ -23,6 +24,7 @@ public class Sweph : /// public Sweph() { + InitSwephData(); } /// @@ -82,11 +84,13 @@ protected virtual void BuildDependencies(IDependencyContainer container) container.RegisterInstance(this); container.RegisterInstance(this); container.RegisterInstance(this); + container.RegisterInstance(this); container.RegisterInstance(container); // Register engines types container.Register(); container.Register(); container.Register(); + container.Register(); } #endregion @@ -178,6 +182,33 @@ public EphemerisTime EphemerisTime(JulianDay day) #endregion + #region ISwephData + + void InitSwephData() + { + EopTjdBeg = 0; + EopTjdBeg_horizons = 0; + EopTjdEnd = 0; + EopTjdEnd_add = 0; + EopDpsiLoaded = false; + Dpsi = new double[0]; + Deps = new double[0]; + } + + public double EopTjdBeg { get; private set; } + public double EopTjdBeg_horizons { get; private set; } + public double EopTjdEnd { get; private set; } + public double EopTjdEnd_add { get; private set; } + public bool EopDpsiLoaded { get; private set; } + + /// + /// works for 100 years after 1962 + /// + public double[] Dpsi { get; private set; } + public double[] Deps { get; private set; } + + #endregion + #region Properties /// @@ -209,6 +240,14 @@ public SweHouse House get { return Dependencies.Resolve(); } } + /// + /// Library + /// + public SweLib Lib + { + get { return Dependencies.Resolve(); } + } + #endregion #region Events diff --git a/SwephNet/SwephNet/SwephNet.csproj b/SwephNet/SwephNet/SwephNet.csproj index e61f00b..eda2391 100644 --- a/SwephNet/SwephNet/SwephNet.csproj +++ b/SwephNet/SwephNet/SwephNet.csproj @@ -67,7 +67,9 @@ + + True True @@ -84,7 +86,7 @@ - + From 4cbbfcf57c014d1cfe64b1d7bd0a74b969e194f7 Mon Sep 17 00:00:00 2001 From: Yanos Date: Sat, 7 Jun 2014 12:06:16 +0200 Subject: [PATCH 3/3] Start sideral time implementation. --- SwephNet/SwephNet/Date/SweDate.cs | 200 ++++++++++++++++++++++++++- SwephNet/SwephNet/Houses/SweHouse.cs | 21 +-- SwephNet/SwephNet/Sweph.Constants.cs | 64 +++++++++ SwephNet/SwephNet/Sweph.cs | 2 +- SwephNet/SwephNet/SwephNet.csproj | 3 + 5 files changed, 268 insertions(+), 22 deletions(-) create mode 100644 SwephNet/SwephNet/Sweph.Constants.cs diff --git a/SwephNet/SwephNet/Date/SweDate.cs b/SwephNet/SwephNet/Date/SweDate.cs index 095abc1..94001df 100644 --- a/SwephNet/SwephNet/Date/SweDate.cs +++ b/SwephNet/SwephNet/Date/SweDate.cs @@ -81,6 +81,14 @@ public class SweDate #region Ctor & Dest. + /// + /// Static constructor + /// + static SweDate() + { + UseSidLongTerm = true; + } + /// /// Create a new SweDate /// @@ -549,7 +557,7 @@ protected double DeltatEspenakMeeus1620(double tjd) u = (Ygreg - 1000) / 100.0; ans = (((((0.0083572073 * u - 0.005050998) * u - 0.8503463) * u + 0.319781) * u + 71.23472) * u - 556.01) * u + 1574.2; } - // TODO Verify dead code + // TODO Verify dead code else if (Ygreg < 1700) { u = Ygreg - 1600; @@ -728,7 +736,7 @@ public double DeltaT(double jd) return DeltatAA(jd); } } - + #endregion #region Tidal acceleration @@ -753,6 +761,189 @@ public double AdjustForTidacc(double ans, double Y) return ans; } + #endregion + + #region Sideral time + + /// + /// The time range of DE431 requires a new calculation of sidereal time that + /// gives sensible results for the remote past and future. + /// The algorithm is based on the formula of the mean earth by Simon & alii, + /// "Precession formulae and mean elements for the Moon and the Planets", + /// A&A 282 (1994), p. 675/678. + /// The longitude of the mean earth relative to the mean equinox J2000 + /// is calculated and then precessed to the equinox of date, using the + /// default precession model of the Swiss Ephmeris. Afte that, + /// sidereal time is derived. + /// The algoritm provides exact agreement for epoch 1 Jan. 2003 with the + /// definition of sidereal time as given in the IERS Convention 2010. + /// + double SidtimeLongTerm(double tjd_ut, double eps, double nut) + { + throw new NotImplementedException("SweDate.SidtimeLongTerm"); + //double tsid = 0, tjd_et; + double dlt = Sweph.AUNIT / Sweph.CLIGHT / 86400.0; + double[] xs = new double[6], xobl = new double[6]; + double tjd_et = tjd_ut + DeltaT(tjd_ut); + double t = (tjd_et - J2000) / 365250.0; + double t2 = t * t; + double t3 = t * t2; + double t4 = t * t3; + double t5 = t * t4; + double t6 = t * t5; + + // mean longitude of earth J2000 + double dlon = 100.46645683 + (1295977422.83429 * t - 2.04411 * t2 - 0.00523 * t3) / 3600.0; + + // light time sun-earth + dlon = SweLib.DegNorm(dlon - dlt * 360.0 / 365.2425); + xs[0] = dlon * SweLib.DEGTORAD; xs[1] = 0; xs[2] = 1; + + // to mean equator J2000, cartesian + //SE.swe_calc_ut(Sweph.J2000, SwissEph.SE_ECL_NUT, 0, xobl, ref sdummy); /* fehler behandeln */ + //swi_polcart(xs, xs); + //swi_coortrf(xs, xs, -xobl[1] * SwissEph.DEGTORAD); + + ///* precess to mean equinox of date */ + //swi_precess(xs, tjd_et, 0, -1); + ///* to mean equinox of date */ + //SE.swe_calc_ut(tjd_ut, SwissEph.SE_ECL_NUT, 0, xobl, ref sdummy); /* fehler behandeln */ + //swi_coortrf(xs, xs, xobl[1] * SwissEph.DEGTORAD); + //swi_cartpol(xs, xs); + //xs[0] *= SwissEph.RADTODEG; + //dhour = (tjd_ut - 0.5 % 1.0) * 360; + ///* mean to true, if nut != 0 */ + //if (eps == 0) + // xs[0] += xobl[2] * Math.Cos(xobl[0] * SwissEph.DEGTORAD); + //else + // xs[0] += nut * Math.Cos(eps * SwissEph.DEGTORAD); + ///* add hour */ + //xs[0] = swe_degnorm(xs[0] + nut * Math.Cos(eps * SwissEph.DEGTORAD) + dhour); + //tsid = xs[0] / 15; + //return tsid; + } + + const double SIDT_LTERM_T0 = 2396758.5; /* 1 Jan 1850 */ + const double SIDT_LTERM_T1 = 2469807.5; /* 1 Jan 2050 */ + const double SIDT_LTERM_OFS0 = (0.09081674334 / 3600); + const double SIDT_LTERM_OFS1 = (0.337962821868 / 3600); + + /// + /// Apparent Sidereal Time at Greenwich with equation of the equinoxes + /// + /// + /// ERA-based expression for for Greenwich Sidereal Time (GST) based + /// on the IAU 2006 precession and IAU 2000A_R06 nutation + /// ftp://maia.usno.navy.mil/conv2010/chapter5/tab5.2e.txt + /// + /// + /// + /// + /// Returns sidereal time in hours. + public SideralTime SidTime0(JulianDay tjd, double eps, double nut) + { + throw new NotImplementedException("Swedate.SidTime0"); + + // Julian day at midnight Universal Time + double jd0; + //Time of day, UT seconds since UT midnight + double secs; + // double eqeq, tt, msday, jdrel; + double gmst, dadd; + if (UseSidLongTerm) + { + if (tjd <= SIDT_LTERM_T0 || tjd >= SIDT_LTERM_T1) + { + gmst = SidtimeLongTerm(tjd, eps, nut); + if (tjd <= SIDT_LTERM_T0) + gmst -= SIDT_LTERM_OFS0; + else if (tjd >= SIDT_LTERM_T1) + gmst -= SIDT_LTERM_OFS1; + if (gmst >= 24) gmst -= 24; + if (gmst < 0) gmst += 24; + return new SideralTime(gmst); + } + } + + // Julian day at given UT + double jd = tjd; + jd0 = Math.Floor(jd); + secs = tjd - jd0; + if (secs < 0.5) + { + jd0 -= 0.5; + secs += 0.5; + } + else + { + jd0 += 0.5; + secs -= 0.5; + } + secs *= 86400.0; + double tu = (jd0 - J2000) / 36525.0; // UT1 in centuries after J2000 + // if (SIDT_IERS_CONV_2010) + // { + // /* ERA-based expression for for Greenwich Sidereal Time (GST) based + // * on the IAU 2006 precession */ + // jdrel = tjd - Sweph.J2000; + // tt = (tjd + swe_deltat(tjd) - Sweph.J2000) / 36525.0; + // gmst = swe_degnorm((0.7790572732640 + 1.00273781191135448 * jdrel) * 360); + // gmst += (0.014506 + tt * (4612.156534 + tt * (1.3915817 + tt * (-0.00000044 + tt * (-0.000029956 + tt * -0.0000000368))))) / 3600.0; + // dadd = sidtime_non_polynomial_part(tt); + // gmst = swe_degnorm(gmst + dadd); + // /*printf("gmst iers=%f \n", gmst);*/ + // gmst = gmst / 15.0 * 3600.0; + // } + // else if (USE_PREC_IAU_2006) + // { + // tt = (jd0 + swe_deltat(jd0) - Sweph.J2000) / 36525.0; /* TT in centuries after J2000 */ + // gmst = (((-0.000000002454 * tt - 0.00000199708) * tt - 0.0000002926) * tt + 0.092772110) * tt * tt + 307.4771013 * (tt - tu) + 8640184.79447825 * tu + 24110.5493771; + // /* mean solar days per sidereal day at date tu; + // * for the derivative of gmst, we can assume UT1 =~ TT */ + // msday = 1 + ((((-0.000000012270 * tt - 0.00000798832) * tt - 0.0000008778) * tt + 0.185544220) * tt + 8640184.79447825) / (86400.0 * 36525.0); + // gmst += msday * secs; + // } + // else + // { /* IAU 1976 formula */ + // /* Greenwich Mean Sidereal Time at 0h UT of date */ + // gmst = ((-6.2e-6 * tu + 9.3104e-2) * tu + 8640184.812866) * tu + 24110.54841; + // /* mean solar days per sidereal day at date tu, = 1.00273790934 in 1986 */ + // msday = 1.0 + ((-1.86e-5 * tu + 0.186208) * tu + 8640184.812866) / (86400.0 * 36525.0); + // gmst += msday * secs; + // } + // /* Local apparent sidereal time at given UT at Greenwich */ + // eqeq = 240.0 * nut * Math.Cos(eps * SwissEph.DEGTORAD); + // gmst = gmst + eqeq /* + 240.0*tlong */; + // /* Sidereal seconds modulo 1 sidereal day */ + // gmst = gmst - 86400.0 * Math.Floor(gmst / 86400.0); + // /* return in hours */ + // gmst /= 3600; + // goto sidtime_done; + // sidtime_done: + //#if TRACE + // //swi_open_trace(NULL); + // //if (swi_trace_count < TRACE_COUNT_MAX) { + // // if (swi_fp_trace_c != NULL) { + // // fputs("\n/*SWE_SIDTIME0*/\n", swi_fp_trace_c); + // // fprintf(swi_fp_trace_c, " tjd = %.9f;", tjd); + // // fprintf(swi_fp_trace_c, " eps = %.9f;", eps); + // // fprintf(swi_fp_trace_c, " nut = %.9f;\n", nut); + // // fprintf(swi_fp_trace_c, " t = swe_sidtime0(tjd, eps, nut);\n"); + // // fputs(" printf(\"swe_sidtime0: %f\\tsidt = %f\\teps = %f\\tnut = %f\\t\\n\", ", swi_fp_trace_c); + // // fputs("tjd, t, eps, nut);\n", swi_fp_trace_c); + // // fflush(swi_fp_trace_c); + // // } + // // if (swi_fp_trace_out != NULL) { + // // fprintf(swi_fp_trace_out, "swe_sidtime0: %f\tsidt = %f\teps = %f\tnut = %f\t\n", tjd, gmst, eps, nut); + // trace("swe_sidtime0: %f\tsidt = %f\teps = %f\tnut = %f\t\n", tjd, gmst, eps, nut); + // // fflush(swi_fp_trace_out); + // // } + // //} + //#endif + // return gmst; + } + + #endregion #region Properties @@ -767,6 +958,11 @@ public double AdjustForTidacc(double ans, double Y) /// public double TidalAcceleration { get; private set; } + /// + /// Use sideral long term + /// + public static bool UseSidLongTerm { get; set; } + #endregion } diff --git a/SwephNet/SwephNet/Houses/SweHouse.cs b/SwephNet/SwephNet/Houses/SweHouse.cs index 59ddecc..f2d116e 100644 --- a/SwephNet/SwephNet/Houses/SweHouse.cs +++ b/SwephNet/SwephNet/Houses/SweHouse.cs @@ -113,7 +113,7 @@ public SweHouse(Sweph sweph) /// public Houses.HouseResult Houses(JulianDay day, GeoPosition position, HouseSystem hsys) { - throw new NotImplementedException(); + throw new NotImplementedException("SweHouse.Houses"); // int i, retc = 0; // double armc, eps; double[] nutlo = new double[2]; var jde = _Sweph.EphemerisTime(day); @@ -121,24 +121,7 @@ public Houses.HouseResult Houses(JulianDay day, GeoPosition position, HouseSyste var nutlo = _Sweph.Lib.Nutation(jde, JPL.JplHorizonMode.None); for (int i = 0; i < 2; i++) nutlo[i] *= SweLib.RADTODEG; - //armc = SE.swe_degnorm(SE.swe_sidtime0(tjd_ut, eps + nutlo[1], nutlo[0]) * 15 + geolon); - //#if TRACE - // //swi_open_trace(NULL); - // //if (swi_trace_count <= TRACE_COUNT_MAX) { - // // if (swi_fp_trace_c != NULL) { - // // fputs("\n/*SWE_HOUSES*/\n", swi_fp_trace_c); - // // fprintf(swi_fp_trace_c, "#if 0\n"); - // // fprintf(swi_fp_trace_c, " tjd = %.9f;", tjd_ut); - // // fprintf(swi_fp_trace_c, " geolon = %.9f;", geolon); - // // fprintf(swi_fp_trace_c, " geolat = %.9f;", geolat); - // // fprintf(swi_fp_trace_c, " hsys = %d;\n", hsys); - // // fprintf(swi_fp_trace_c, " retc = swe_houses(tjd, geolat, geolon, hsys, cusp, ascmc);\n"); - // // fprintf(swi_fp_trace_c, " /* swe_houses calls swe_houses_armc as follows: */\n"); - // // fprintf(swi_fp_trace_c, "#endif\n"); - // // fflush(swi_fp_trace_c); - // // } - // //} - //#endif + double armc = SweLib.DegNorm(_Sweph.Date.SidTime0(day, eps + nutlo[1], nutlo[0]).Value * 15 + position.Longitude); // retc = swe_houses_armc(armc, geolat, eps + nutlo[1], hsys, cusp, ascmc); // return retc; // } diff --git a/SwephNet/SwephNet/Sweph.Constants.cs b/SwephNet/SwephNet/Sweph.Constants.cs new file mode 100644 index 0000000..71ab22e --- /dev/null +++ b/SwephNet/SwephNet/Sweph.Constants.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace SwephNet +{ + partial class Sweph + { + + ///* we always use Astronomical Almanac constants, if available */ + //public const double MOON_MEAN_DIST = 384400000.0; /* in m, AA 1996, F2 */ + //public const double MOON_MEAN_INCL = 5.1453964; /* AA 1996, D2 */ + //public const double MOON_MEAN_ECC = 0.054900489; /* AA 1996, F2 */ + ///* #define SUN_EARTH_MRAT= 328900.561400; Su/(Ea+Mo) AA 2006 K7 */ + //public const double SUN_EARTH_MRAT = 332946.050895; /* Su / (Ea only) AA 2006 K7 */ + //public const double EARTH_MOON_MRAT = (1 / 0.0123000383); /* AA 2006, K7 */ + ////#if 0 + ////#define EARTH_MOON_MRAT =81.30056 /* de406 */ + ////#endif + + /// + /// au in meters, AA 2006 K6 + /// + public const double AUNIT = 1.49597870691e+11; + /// + /// m/s, AA 1996 K6 + /// + public const double CLIGHT = 2.99792458e+8; + + ////#if 0 + ////#define HELGRAVCONST = 1.32712438e+20; /* G * M(sun), m^3/sec^2, AA 1996 K6 */ + ////#endif + //public const double HELGRAVCONST = 1.32712440017987e+20; /* G * M(sun), m^3/sec^2, AA 2006 K6 */ + //public const double GEOGCONST = 3.98600448e+14; /* G * M(earth) m^3/sec^2, AA 1996 K6 */ + //public const double KGAUSS = 0.01720209895; /* Gaussian gravitational constant K6 */ + //public const double SUN_RADIUS = (959.63 / 3600 * SwissEph.DEGTORAD); /* Meeus germ. p 391 */ + //public const double EARTH_RADIUS = 6378136.6; /* AA 2006 K6 */ + ///*#define EARTH_OBLATENESS= (1.0/ 298.257223563) * AA 1998 K13 */ + //public const double EARTH_OBLATENESS = (1.0 / 298.25642); /* AA 2006 K6 */ + //public const double EARTH_ROT_SPEED = (7.2921151467e-5 * 86400); /* in rad/day, expl. suppl., p 162 */ + + //public const double LIGHTTIME_AUNIT = (499.0047838061 / 3600 / 24); /* 8.3167 minutes (days), AA 2006 K6 */ + + ///* node of ecliptic measured on ecliptic 2000 */ + //public const double SSY_PLANE_NODE_E2000 = (107.582569 * SwissEph.DEGTORAD); + ///* node of ecliptic measured on solar system rotation plane */ + //public const double SSY_PLANE_NODE = (107.58883388 * SwissEph.DEGTORAD); + ///* inclination of ecliptic against solar system rotation plane */ + //public const double SSY_PLANE_INCL = (1.578701 * SwissEph.DEGTORAD); + + //public const double KM_S_TO_AU_CTY = 21.095; /* km/s to AU/century */ + //public const double MOON_SPEED_INTV = 0.00005; /* 4.32 seconds (in days) */ + //public const double PLAN_SPEED_INTV = 0.0001; /* 8.64 seconds (in days) */ + //public const double MEAN_NODE_SPEED_INTV = 0.001; + //public const double NODE_CALC_INTV = 0.0001; + //public const double NODE_CALC_INTV_MOSH = 0.1; + //public const double NUT_SPEED_INTV = 0.0001; + //public const double DEFL_SPEED_INTV = 0.0000005; + + //public const double SE_LAPSE_RATE = 0.0065; /* deg K / m, for refraction */ + + } +} diff --git a/SwephNet/SwephNet/Sweph.cs b/SwephNet/SwephNet/Sweph.cs index 28c21a6..3a37577 100644 --- a/SwephNet/SwephNet/Sweph.cs +++ b/SwephNet/SwephNet/Sweph.cs @@ -9,7 +9,7 @@ namespace SwephNet /// /// Swiss Ephmeris context /// - public class Sweph : + public partial class Sweph : IDisposable, IStreamProvider, ITracer, diff --git a/SwephNet/SwephNet/SwephNet.csproj b/SwephNet/SwephNet/SwephNet.csproj index eda2391..7f7dd38 100644 --- a/SwephNet/SwephNet/SwephNet.csproj +++ b/SwephNet/SwephNet/SwephNet.csproj @@ -93,6 +93,9 @@ + + +