65 const double EarthOrientation::JulianEpoch = 51544.5;
66 const int EarthOrientation::intJulianEpoch = 51544;
69 const double EarthOrientation::TWOPI = 6.283185307179586476925287;
71 const double EarthOrientation::HALFPI = (TWOPI / 4.);
80 const double EarthOrientation::ARCSEC_TO_RAD = 4.848136811095359935899141e-6;
83 const double EarthOrientation::ARCSEC_PER_CIRCLE = 1296000.0;
88 os <<
" " << fixed << setw(10) << setprecision(6) << eo.
xp <<
" "
89 << setw(10) << setprecision(6) << eo.
yp <<
" " << setw(11)
122 double& dld,
double& dom);
132 double& dUT,
double& dld,
158 void EarthOrientation::interpolateEOP(
const EphTime& t,
159 const vector<double>&
time,
160 const vector<double>& X,
161 const vector<double>& Y,
166 double dxp, dyp, dUT, dlod, domega;
170 convention = in_conv;
175 double mjdUTC(ttag.
dMJD());
180 double T = (
mjd - 51544.5) / 36525.0;
192 for (i = 0; i <
time.size(); i++)
197 double Ttemp = (ttag.
dMJD() - 51544.5) / 36525.0;
199 if (convention == IERSConvention::IERS2010)
242 if (convention == IERSConvention::IERS2010)
286 ::fmod(67310.54841 + T * (3155760000.0 + 8640184.812866 +
287 T * T * (0.093104 + T * (-6.2e-6))),
291 GMST *= 15.0 * EarthOrientation::ARCSEC_TO_RAD;
299 args[1] = EarthOrientation::L(T);
305 args[2] = EarthOrientation::Lp(T);
310 args[3] = EarthOrientation::F(T);
315 args[4] = EarthOrientation::D(T);
320 args[5] = EarthOrientation::Omega2003(T);
335 static const double fact[][2] = {{0.0298, 0.0200}, {0.1408, 0.0905},
336 {0.0805, 0.0638}, {0.6002, 0.3476},
337 {0.3025, 0.1645}, {0.1517, 0.0923}};
346 double hs, phase, freq;
348 static const Coeff C[] = {{2, 1, -1.94, 9.0899831, 5.18688050},
349 {2, 1, -1.25, 8.8234208, 5.38346657},
350 {2, 1, -6.64, 12.1189598, 5.38439079},
351 {2, 1, -1.51, 1.4425700, 5.41398343},
352 {2, 1, -8.02, 4.7381090, 5.41490765},
353 {2, 1, -9.47, 4.4715466, 5.61149372},
354 {2, 1, -50.20, 7.7670857, 5.61241794},
355 {2, 1, -1.80, -2.9093042, 5.64201057},
356 {2, 1, -9.54, 0.3862349, 5.64293479},
357 {2, 1, 1.52, -3.1758666, 5.83859664},
358 {2, 1, -49.45, 0.1196725, 5.83952086},
359 {2, 1, -262.21, 3.4152116, 5.84044508},
360 {2, 1, 1.70, 12.8946194, 5.84433381},
361 {2, 1, 3.43, 5.5137686, 5.87485066},
362 {2, 1, 1.94, 6.4441883, 6.03795537},
363 {2, 1, 1.37, -4.2322016, 6.06754801},
364 {2, 1, 7.41, -0.9366625, 6.06847223},
365 {2, 1, 20.62, 8.5427453, 6.07236095},
366 {2, 1, 4.14, 11.8382843, 6.07328517},
367 {2, 1, 3.94, 1.1618945, 6.10287781},
368 {2, 1, -7.14, 5.9693878, 6.24878055},
369 {2, 1, 1.37, -1.2032249, 6.26505830},
370 {2, 1, -122.03, 2.0923141, 6.26598252},
371 {2, 1, 1.02, -1.7847596, 6.28318449},
372 {2, 1, 2.89, 8.0679449, 6.28318613},
373 {2, 1, -7.30, 0.8953321, 6.29946388},
374 {2, 1, 368.78, 4.1908712, 6.30038810},
375 {2, 1, 50.01, 7.4864102, 6.30131232},
376 {2, 1, -1.08, 10.7819493, 6.30223654},
377 {2, 1, 2.93, 0.3137975, 6.31759007},
378 {2, 1, 5.25, 6.2894282, 6.33479368},
379 {2, 1, 3.95, 7.2198478, 6.49789839},
380 {2, 1, 20.62, -0.1610030, 6.52841524},
381 {2, 1, 4.09, 3.1345361, 6.52933946},
382 {2, 1, 3.42, 2.8679737, 6.72592553},
383 {2, 1, 1.69, -4.5128771, 6.75644239},
384 {2, 1, 11.29, 4.9665307, 6.76033111},
385 {2, 1, 7.23, 8.2620698, 6.76125533},
386 {2, 1, 1.51, 11.5576089, 6.76217955},
387 {2, 1, 2.16, 0.6146566, 6.98835826},
388 {2, 1, 1.38, 3.9101957, 6.98928248},
389 {2, 2, 1.80, 20.6617051, 11.45675174},
390 {2, 2, 4.67, 13.2808543, 11.48726860},
391 {2, 2, 16.01, 16.3098310, 11.68477889},
392 {2, 2, 19.32, 8.9289802, 11.71529575},
393 {2, 2, 1.30, 5.0519065, 11.73249771},
394 {2, 2, -1.02, 15.8350306, 11.89560406},
395 {2, 2, -4.51, 8.6624178, 11.91188181},
396 {2, 2, 120.99, 11.9579569, 11.91280603},
397 {2, 2, 1.13, 8.0808832, 11.93000800},
398 {2, 2, 22.98, 4.5771061, 11.94332289},
399 {2, 2, 1.06, 0.7000324, 11.96052486},
400 {2, 2, -1.90, 14.9869335, 12.11031632},
401 {2, 2, -2.18, 11.4831564, 12.12363121},
402 {2, 2, -23.58, 4.3105437, 12.13990896},
403 {2, 2, 631.92, 7.6060827, 12.14083318},
404 {2, 2, 1.92, 3.7290090, 12.15803515},
405 {2, 2, -4.66, 10.6350594, 12.33834347},
406 {2, 2, -17.86, 3.2542086, 12.36886033},
407 {2, 2, 4.47, 12.7336164, 12.37274905},
408 {2, 2, 1.97, 16.0291555, 12.37367327},
409 {2, 2, 17.20, 10.1602590, 12.54916865},
410 {2, 2, 294.00, 6.2831853, 12.56637061},
411 {2, 2, -2.46, 2.4061116, 12.58357258},
412 {2, 2, -1.02, 5.0862033, 12.59985198},
413 {2, 2, 79.96, 8.3817423, 12.60077620},
414 {2, 2, 23.83, 11.6772814, 12.60170041},
415 {2, 2, 2.59, 14.9728205, 12.60262463},
416 {2, 2, 4.47, 4.0298682, 12.82880334},
417 {2, 2, 1.95, 7.3254073, 12.82972756},
418 {2, 2, 1.17, 9.1574019, 13.06071921}};
420 static const double dt(2.0);
421 static const double TWOPI(6.283185307179586476925287);
423 double a[2][3], b[2][3], dt60, pinm, alpha;
426 for (k = 0; k < 3; ++k)
428 dt60 = (
mjd - (k - 1) * dt) - 37076.5;
429 a[0][k] = a[1][k] = 0.0;
430 b[0][k] = b[1][k] = 0.0;
431 for (j = 0; j < 71; ++j)
435 pinm = double((n + m) % 2) * TWOPI / 4.0;
436 alpha = ::fmod(C[j].phase - pinm, TWOPI) +
437 ::fmod(C[j].freq * dt60, TWOPI);
438 a[m - 1][k] += C[j].hs *
::cos(alpha);
439 b[m - 1][k] -= C[j].hs *
::sin(alpha);
444 double ap, am, bp, bm, p[3][2], q[3][2];
445 for (m = 0; m < 2; ++m)
447 ap = a[m][2] + a[m][0];
448 am = a[m][2] - a[m][0];
449 bp = b[m][2] + b[m][0];
450 bm = b[m][2] - b[m][0];
451 p[0][m] = fact[0][m] * a[m][1];
452 p[1][m] = fact[1][m] * a[m][1] - fact[2][m] * ap;
453 p[2][m] = fact[3][m] * a[m][1] - fact[4][m] * ap + fact[5][m] * bm;
454 q[0][m] = fact[0][m] * b[m][1];
455 q[1][m] = fact[1][m] * b[m][1] - fact[2][m] * bp;
456 q[2][m] = fact[3][m] * b[m][1] - fact[4][m] * bp - fact[5][m] * am;
467 for (j = 0, m = 0; m < 2; ++m)
469 for (k = 0; k < 3; ++k)
480 static const double orthowts[][3] = {
481 {-6.77832, 14.86283, -1.76335}, {-14.86323, -6.77846, 1.03364},
482 {0.47884, 1.45234, -0.27553}, {-1.45303, 0.47888, 0.34569},
483 {0.16406, -0.42056, -0.12343}, {0.42030, 0.16469, -0.10146},
484 {0.09398, 15.30276, -0.47119}, {25.73054, -4.30615, 1.28997},
485 {-4.77974, 0.07564, -0.19336}, {0.28080, 2.28321, 0.02724},
486 {1.94539, -0.45717, 0.08955}, {-0.73089, -1.62010, 0.04726}};
494 for (k = 0; k < 3; ++k)
497 for (j = 0; j < 12; ++j)
499 eop[k] += h[j] * orthowts[j][k];
504 dxp = eop[0] * 1.e-6;
505 dyp = eop[1] * 1.e-6;
506 dUT = eop[2] * 1.e-6;
517 double& dld,
double& dom)
520 static const double TWOPI(6.283185307179586476925287);
527 double dutsin, dutcos, dldcos, dldsin, domcos,
531 static const Coeff C[] = {
532 {{1, 0, 2, 2, 2}, -0.0235, 0.0000, 0.2617, 0.0000, -0.2209, 0.0000},
533 {{2, 0, 2, 0, 1}, -0.0404, 0.0000, 0.3706, 0.0000, -0.3128, 0.0000},
534 {{2, 0, 2, 0, 2}, -0.0987, 0.0000, 0.9041, 0.0000, -0.7630, 0.0000},
535 {{0, 0, 2, 2, 1}, -0.0508, 0.0000, 0.4499, 0.0000, -0.3797, 0.0000},
536 {{0, 0, 2, 2, 2}, -0.1231, 0.0000, 1.0904, 0.0000, -0.9203, 0.0000},
537 {{1, 0, 2, 0, 0}, -0.0385, 0.0000, 0.2659, 0.0000, -0.2244, 0.0000},
538 {{1, 0, 2, 0, 1}, -0.4108, 0.0000, 2.8298, 0.0000, -2.3884, 0.0000},
539 {{1, 0, 2, 0, 2}, -0.9926, 0.0000, 6.8291, 0.0000, -5.7637, 0.0000},
540 {{3, 0, 0, 0, 0}, -0.0179, 0.0000, 0.1222, 0.0000, -0.1031, 0.0000},
541 {{-1, 0, 2, 2, 1}, -0.0818, 0.0000, 0.5384, 0.0000, -0.4544, 0.0000},
542 {{-1, 0, 2, 2, 2}, -0.1974, 0.0000, 1.2978, 0.0000, -1.0953, 0.0000},
543 {{1, 0, 0, 2, 0}, -0.0761, 0.0000, 0.4976, 0.0000, -0.4200, 0.0000},
544 {{2, 0, 2, -2, 2}, 0.0216, 0.0000, -0.1060, 0.0000, 0.0895, 0.0000},
545 {{0, 1, 2, 0, 2}, 0.0254, 0.0000, -0.1211, 0.0000, 0.1022, 0.0000},
546 {{0, 0, 2, 0, 0}, -0.2989, 0.0000, 1.3804, 0.0000, -1.1650, 0.0000},
547 {{0, 0, 2, 0, 1}, -3.1873, 0.2010, 14.6890, 0.9266, -12.3974, -0.7820},
548 {{0, 0, 2, 0, 2}, -7.8468, 0.5320, 36.0910, 2.4469, -30.4606, -2.0652},
549 {{2, 0, 0, 0, -1}, 0.0216, 0.0000, -0.0988, 0.0000, 0.0834, 0.0000},
550 {{2, 0, 0, 0, 0}, -0.3384, 0.0000, 1.5433, 0.0000, -1.3025, 0.0000},
551 {{2, 0, 0, 0, 1}, 0.0179, 0.0000, -0.0813, 0.0000, 0.0686, 0.0000},
552 {{0, -1, 2, 0, 2}, -0.0244, 0.0000, 0.1082, 0.0000, -0.0913, 0.0000},
553 {{0, 0, 0, 2, -1}, 0.0470, 0.0000, -0.2004, 0.0000, 0.1692, 0.0000},
554 {{0, 0, 0, 2, 0}, -0.7341, 0.0000, 3.1240, 0.0000, -2.6367, 0.0000},
555 {{0, 0, 0, 2, 1}, -0.0526, 0.0000, 0.2235, 0.0000, -0.1886, 0.0000},
556 {{0, -1, 0, 2, 0}, -0.0508, 0.0000, 0.2073, 0.0000, -0.1749, 0.0000},
557 {{1, 0, 2, -2, 1}, 0.0498, 0.0000, -0.1312, 0.0000, 0.1107, 0.0000},
558 {{1, 0, 2, -2, 2}, 0.1006, 0.0000, -0.2640, 0.0000, 0.2228, 0.0000},
559 {{1, 1, 0, 0, 0}, 0.0395, 0.0000, -0.0968, 0.0000, 0.0817, 0.0000},
560 {{-1, 0, 2, 0, 0}, 0.0470, 0.0000, -0.1099, 0.0000, 0.0927, 0.0000},
561 {{-1, 0, 2, 0, 1}, 0.1767, 0.0000, -0.4115, 0.0000, 0.3473, 0.0000},
562 {{-1, 0, 2, 0, 2}, 0.4352, 0.0000, -1.0093, 0.0000, 0.8519, 0.0000},
563 {{1, 0, 0, 0, -1}, 0.5339, 0.0000, -1.2224, 0.0000, 1.0317, 0.0000},
564 {{1, 0, 0, 0, 0}, -8.4046, 0.2500, 19.1647, 0.5701, -16.1749, -0.4811},
565 {{1, 0, 0, 0, 1}, 0.5443, 0.0000, -1.2360, 0.0000, 1.0432, 0.0000},
566 {{0, 0, 0, 1, 0}, 0.0470, 0.0000, -0.1000, 0.0000, 0.0844, 0.0000},
567 {{1, -1, 0, 0, 0}, -0.0555, 0.0000, 0.1169, 0.0000, -0.0987, 0.0000},
568 {{-1, 0, 0, 2, -1}, 0.1175, 0.0000, -0.2332, 0.0000, 0.1968, 0.0000},
569 {{-1, 0, 0, 2, 0}, -1.8236, 0.0000, 3.6018, 0.0000, -3.0399, 0.0000},
570 {{-1, 0, 0, 2, 1}, 0.1316, 0.0000, -0.2587, 0.0000, 0.2183, 0.0000},
571 {{1, 0, -2, 2, -1}, 0.0179, 0.0000, -0.0344, 0.0000, 0.0290, 0.0000},
572 {{-1, -1, 0, 2, 0}, -0.0855, 0.0000, 0.1542, 0.0000, -0.1302, 0.0000},
573 {{0, 2, 2, -2, 2}, -0.0573, 0.0000, 0.0395, 0.0000, -0.0333, 0.0000},
574 {{0, 1, 2, -2, 1}, 0.0329, 0.0000, -0.0173, 0.0000, 0.0146, 0.0000},
575 {{0, 1, 2, -2, 2}, -1.8847, 0.0000, 0.9726, 0.0000, -0.8209, 0.0000},
576 {{0, 0, 2, -2, 0}, 0.2510, 0.0000, -0.0910, 0.0000, 0.0768, 0.0000},
577 {{0, 0, 2, -2, 1}, 1.1703, 0.0000, -0.4135, 0.0000, 0.3490, 0.0000},
578 {{0, 0, 2, -2, 2}, -49.7174, 0.4330, 17.1056, 0.1490, -14.4370, -0.1257},
579 {{0, 2, 0, 0, 0}, -0.1936, 0.0000, 0.0666, 0.0000, -0.0562, 0.0000},
580 {{2, 0, 0, -2, -1}, 0.0489, 0.0000, -0.0154, 0.0000, 0.0130, 0.0000},
581 {{2, 0, 0, -2, 0}, -0.5471, 0.0000, 0.1670, 0.0000, -0.1409, 0.0000},
582 {{2, 0, 0, -2, 1}, 0.0367, 0.0000, -0.0108, 0.0000, 0.0092, 0.0000},
583 {{0, -1, 2, -2, 1}, -0.0451, 0.0000, 0.0082, 0.0000, -0.0069, 0.0000},
584 {{0, 1, 0, 0, -1}, 0.0921, 0.0000, -0.0167, 0.0000, 0.0141, 0.0000},
585 {{0, -1, 2, -2, 2}, 0.8281, 0.0000, -0.1425, 0.0000, 0.1202, 0.0000},
586 {{0, 1, 0, 0, 0}, -15.8887, 0.1530, 2.7332, 0.0267, -2.3068, -0.0222},
587 {{0, 1, 0, 0, 1}, -0.1382, 0.0000, 0.0225, 0.0000, -0.0190, 0.0000},
588 {{1, 0, 0, -1, 0}, 0.0348, 0.0000, -0.0053, 0.0000, 0.0045, 0.0000},
589 {{2, 0, -2, 0, 0}, -0.1372, 0.0000, -0.0079, 0.0000, 0.0066, 0.0000},
590 {{-2, 0, 2, 0, 1}, 0.4211, 0.0000, -0.0203, 0.0000, 0.0171, 0.0000},
591 {{-1, 1, 0, 1, 0}, -0.0404, 0.0000, 0.0008, 0.0000, -0.0007, 0.0000},
592 {{0, 0, 0, 0, 2}, 7.8998, 0.0000, 0.1460, 0.0000, -0.1232, 0.0000},
593 {{0, 0, 0, 0, 1}, -1617.2681, 0.0000, -14.9471, 0.0000, 12.6153, 0.0000}};
596 static const int N = int(
sizeof(C) /
sizeof(Coeff));
598 dUT = dld = dom = 0.0;
599 for (
int i = 0; i < N; i++)
602 for (
int j = 0; j < 5; j++)
604 arg += double(C[i].nargs[j]) *
args[j + 1];
610 dUT += C[i].dutsin * sarg + C[i].dutcos * carg;
611 dld += C[i].dldsin * sarg + C[i].dldcos * carg;
612 dom += C[i].domsin * sarg + C[i].domcos * carg;
630 double& dld,
double& dom)
633 static const double TWOPI(6.283185307179586476925287);
640 double dutsin, dutcos, dldcos, dldsin, domcos,
644 static const Coeff C[] = {
645 {{1, 0, 2, 2, 2}, -0.02, 0.00, 0.26, 0.00, -0.22, 0.00},
646 {{2, 0, 2, 0, 1}, -0.04, 0.00, 0.38, 0.00, -0.32, 0.00},
647 {{2, 0, 2, 0, 2}, -0.10, 0.00, 0.91, 0.00, -0.76, 0.00},
648 {{0, 0, 2, 2, 1}, -0.05, 0.00, 0.45, 0.00, -0.38, 0.00},
649 {{0, 0, 2, 2, 2}, -0.12, 0.00, 1.09, 0.01, -0.92, -0.01},
650 {{1, 0, 2, 0, 0}, -0.04, 0.00, 0.27, 0.00, -0.22, 0.00},
651 {{1, 0, 2, 0, 1}, -0.41, 0.00, 2.84, 0.02, -2.40, -0.01},
652 {{1, 0, 2, 0, 2}, -1.00, 0.01, 6.85, 0.04, -5.78, -0.03},
653 {{3, 0, 0, 0, 0}, -0.02, 0.00, 0.12, 0.00, -0.11, 0.00},
654 {{-1, 0, 2, 2, 1}, -0.08, 0.00, 0.54, 0.00, -0.46, 0.00},
655 {{-1, 0, 2, 2, 2}, -0.20, 0.00, 1.30, 0.01, -1.10, -0.01},
656 {{1, 0, 0, 2, 0}, -0.08, 0.00, 0.50, 0.00, -0.42, 0.00},
657 {{2, 0, 2, -2, 2}, 0.02, 0.00, -0.11, 0.00, 0.09, 0.00},
658 {{0, 1, 2, 0, 2}, 0.03, 0.00, -0.12, 0.00, 0.10, 0.00},
659 {{0, 0, 2, 0, 0}, -0.30, 0.00, 1.39, 0.01, -1.17, -0.01},
660 {{0, 0, 2, 0, 1}, -3.22, 0.02, 14.86, 0.09, -12.54, -0.08},
661 {{0, 0, 2, 0, 2}, -7.79, 0.05, 35.84, 0.22, -30.25, -0.18},
662 {{2, 0, 0, 0, -1}, 0.02, 0.00, -0.10, 0.00, 0.08, 0.00},
663 {{2, 0, 0, 0, 0}, -0.34, 0.00, 1.55, 0.01, -1.31, -0.01},
664 {{2, 0, 0, 0, 1}, 0.02, 0.00, -0.08, 0.00, 0.07, 0.00},
665 {{0, -1, 2, 0, 2}, -0.02, 0.00, 0.11, 0.00, -0.09, 0.00},
666 {{0, 0, 0, 2, -1}, 0.05, 0.00, -0.20, 0.00, 0.17, 0.00},
667 {{0, 0, 0, 2, 0}, -0.74, 0.00, 3.14, 0.02, -2.65, -0.02},
668 {{0, 0, 0, 2, 1}, -0.05, 0.00, 0.22, 0.00, -0.19, 0.00},
669 {{0, -1, 0, 2, 0}, -0.05, 0.00, 0.21, 0.00, -0.17, 0.00},
670 {{1, 0, 2, -2, 1}, 0.05, 0.00, -0.13, 0.00, 0.11, 0.00},
671 {{1, 0, 2, -2, 2}, 0.10, 0.00, -0.26, 0.00, 0.22, 0.00},
672 {{1, 1, 0, 0, 0}, 0.04, 0.00, -0.10, 0.00, 0.08, 0.00},
673 {{-1, 0, 2, 0, 0}, 0.05, 0.00, -0.11, 0.00, 0.09, 0.00},
674 {{-1, 0, 2, 0, 1}, 0.18, 0.00, -0.41, 0.00, 0.35, 0.00},
675 {{-1, 0, 2, 0, 2}, 0.44, 0.00, -1.02, -0.01, 0.86, 0.01},
676 {{1, 0, 0, 0, -1}, 0.54, 0.00, -1.23, -0.01, 1.04, 0.01},
677 {{1, 0, 0, 0, 0}, -8.33, 0.06, 18.99, 0.13, -16.03, -0.11},
678 {{1, 0, 0, 0, 1}, 0.55, 0.00, -1.25, -0.01, 1.05, 0.01},
679 {{0, 0, 0, 1, 0}, 0.05, 0.00, -0.11, 0.00, 0.09, 0.00},
680 {{1, -1, 0, 0, 0}, -0.06, 0.00, 0.12, 0.00, -0.10, 0.00},
681 {{-1, 0, 0, 2, -1}, 0.12, 0.00, -0.24, 0.00, 0.20, 0.00},
682 {{-1, 0, 0, 2, 0}, -1.84, 0.01, 3.63, 0.02, -3.07, -0.02},
683 {{-1, 0, 0, 2, 1}, 0.13, 0.00, -0.26, 0.00, 0.22, 0.00},
684 {{1, 0, -2, 2, -1}, 0.02, 0.00, -0.04, 0.00, 0.03, 0.00},
685 {{-1, -1, 0, 2, 0}, -0.09, 0.00, 0.16, 0.00, -0.13, 0.00},
686 {{0, 2, 2, -2, 2}, -0.06, 0.00, 0.04, 0.00, -0.03, 0.00},
687 {{0, 1, 2, -2, 1}, 0.03, 0.00, -0.02, 0.00, 0.01, 0.00},
688 {{0, 1, 2, -2, 2}, -1.91, 0.02, 0.98, 0.01, -0.83, -0.01},
689 {{0, 0, 2, -2, 0}, 0.26, 0.00, -0.09, 0.00, 0.08, 0.00},
690 {{0, 0, 2, -2, 1}, 1.18, -0.01, -0.42, 0.00, 0.35, 0.00},
691 {{0, 0, 2, -2, 2}, -49.06, 0.43, 16.88, 0.15, -14.25, -0.13},
692 {{0, 2, 0, 0, 0}, -0.20, 0.00, 0.07, 0.00, -0.06, 0.00},
693 {{2, 0, 0, -2, -1}, 0.05, 0.00, -0.02, 0.00, 0.01, 0.00},
694 {{2, 0, 0, -2, 0}, -0.56, 0.01, 0.17, 0.00, -0.14, 0.00},
695 {{2, 0, 0, -2, 1}, 0.04, 0.00, -0.01, 0.00, 0.01, 0.00},
696 {{0, -1, 2, -2, 1}, -0.05, 0.00, 0.01, 0.00, -0.01, 0.00},
697 {{0, 1, 0, 0, -1}, 0.09, 0.00, -0.02, 0.00, 0.01, 0.00},
698 {{0, -1, 2, -2, 2}, 0.82, -0.01, -0.14, 0.00, 0.12, 0.00},
699 {{0, 1, 0, 0, 0}, -15.65, 0.15, 2.69, 0.03, -2.27, -0.02},
700 {{0, 1, 0, 0, 1}, -0.14, 0.00, 0.02, 0.00, -0.02, 0.00},
701 {{1, 0, 0, -1, 0}, 0.03, 0.00, 0.00, 0.00, 0.00, 0.00},
702 {{2, 0, -2, 0, 0}, -0.14, 0.00, -0.02, 0.00, 0.02, 0.00},
703 {{-2, 0, 2, 0, 1}, 0.43, -0.01, -0.02, 0.00, 0.02, 0.00},
704 {{-1, 1, 0, 1, 0}, -0.04, 0.00, 0.00, 0.00, 0.00, 0.00},
705 {{0, 0, 0, 0, 2}, 8.20, 0.11, 0.15, 0.00, -0.13, 0.00},
706 {{0, 0, 0, 0, 1}, -1689.54, -25.04, -15.62, 0.23, 13.18, -0.20}};
709 static const int N = int(
sizeof(C) /
sizeof(Coeff));
711 dUT = dld = dom = 0.0;
712 for (
int i = 0; i < N; i++)
715 for (
int j = 0; j < 5; j++)
717 arg += double(C[i].nargs[j]) *
args[j + 1];
724 dUT += C[i].dutsin * sarg + C[i].dutcos * carg;
725 dld += C[i].dldsin * sarg + C[i].dldcos * carg;
726 dom += C[i].domsin * sarg + C[i].domcos * carg;
754 double period, dutsin, dutcos, dldsin, dldcos;
757 static const Coeff C[] = {
758 {{2, -2, 0, -2, 0, -2}, 0.5377239, 0.05, -0.03, -0.3, -0.6},
759 {{2, 0, 0, -2, -2, -2}, 0.5363232, 0.06, -0.03, -0.4, -0.7},
760 {{2, -1, 0, -2, 0, -2}, 0.5274312, 0.35, -0.20, -2.4, -4.1},
761 {{2, 1, 0, -2, -2, -2}, 0.5260835, 0.07, -0.04, -0.5, -0.8},
762 {{2, 0, 0, -2, 0, -1}, 0.5175645, -0.07, 0.04, 0.5, 0.8},
763 {{2, 0, 0, -2, 0, -2}, 0.5175251, 1.75, -1.01, -12.2, -21.3},
764 {{2, 1, 0, -2, 0, -2}, 0.5079842, -0.05, 0.03, 0.3, 0.6},
765 {{2, 0, -1, -2, 2, -2}, 0.5006854, 0.04, -0.03, -0.3, -0.6},
766 {{2, 0, 0, -2, 2, -2}, 0.5000000, 0.76, -0.44, -5.5, -9.6},
767 {{2, 0, 0, 0, 0, 0}, 0.4986348, 0.21, -0.12, -1.5, -2.6},
768 {{2, 0, 0, 0, 0, -1}, 0.4985982, 0.06, -0.04, -0.4, -0.8}};
771 static const int N = int(
sizeof(C) /
sizeof(Coeff));
774 for (
int i = 0; i < N; ++i)
777 for (
int j = 0; j < 6; ++j)
779 arg += C[i].nargs[j] *
args[j];
781 arg = ::fmod(
arg, EarthOrientation::TWOPI);
785 dUT += C[i].dutsin * sarg + C[i].dutcos * carg;
786 dld += C[i].dldsin * sarg + C[i].dldcos * carg;
805 double EarthOrientation::coordTransTime(
EphTime ttag)
814 int in = int(t.
dMJD() - 0.5) - intJulianEpoch;
815 double frac = 0.5 + t.
secOfDay() / 86400.0;
820 return (
double(in) / 36525.0 + frac / 36525.0);
832 double EarthOrientation::Omega(
double T)
837 + T * (7.4722 + T * (0.007702 + T * (-0.00005939)))),
846 double EarthOrientation::Omega2003(
double T)
851 + T * (7.4722 + T * (0.007702 + T * (-0.00005939)))),
860 double EarthOrientation::F(
double T)
864 + T * (1739527262.8478 +
865 T * (-12.7512 + T * (-0.001037 + T * (0.00000417)))),
874 double EarthOrientation::D(
double T)
876 return ::fmod(1072260.703692
878 T * (1602961601.2090 +
879 T * (-6.3706 + T * (0.006593 + T * (-0.00003169)))),
888 double EarthOrientation::L(
double T)
890 return ::fmod(485868.249036
892 T * (1717915923.2178 +
893 T * (31.8792 + T * (0.051635 + T * (-0.00024470)))),
901 double EarthOrientation::Lp(
double T)
903 return ::fmod(1287104.793048
905 T * (129596581.0481 +
906 T * (-0.5532 + T * (0.000136
908 + T * (-0.00001149)))),
917 double EarthOrientation::LMe(
double T)
919 double lme(::fmod(4.402608842 + 2608.7903141574 * T, TWOPI));
927 double EarthOrientation::LV(
double T)
929 double lv(::fmod(3.176146697 + 1021.3285546211 * T, TWOPI));
937 double EarthOrientation::LE(
double T)
939 double le(::fmod(1.753470314 + 628.3075849991 * T, TWOPI));
947 double EarthOrientation::LMa(
double T)
949 double lma(::fmod(6.203480913 + 334.0612426700 * T, TWOPI));
958 double EarthOrientation::LJ(
double T)
960 double lj(::fmod(0.599546497 + 52.9690962641 * T, TWOPI));
969 double EarthOrientation::LS(
double T)
971 double ls(::fmod(0.874016757 + 21.3299104960 * T, TWOPI));
980 double EarthOrientation::LU(
double T)
982 double lu(::fmod(5.481293872 + 7.4781598567 * T, TWOPI));
991 double EarthOrientation::LN(
double T)
993 double ln(::fmod(5.311886287 + 3.8133035638 * T, TWOPI));
1003 double EarthOrientation::Pa(
double T)
1005 double pa((0.024381750 + 0.00000538691 * T) * T);
1013 double EarthOrientation::obliquity(
double T)
1015 if (convention == IERSConvention::IERS1996)
1017 return obliquity1996(T);
1019 else if (convention == IERSConvention::IERS2003)
1021 return obliquity1996(T);
1023 else if (convention == IERSConvention::IERS2010)
1025 return obliquity2010(T);
1029 Exception e(
"IERS convention is not defined");
1046 if (convention == IERSConvention::IERS1996)
1048 return GMST1996(t, UT1mUTC, reduced);
1050 else if (convention == IERSConvention::IERS2003)
1052 return GMST2003(t, UT1mUTC);
1054 else if (convention == IERSConvention::IERS2010)
1056 return GMST2010(t, UT1mUTC);
1060 Exception e(
"IERS convention is not defined");
1078 double EarthOrientation::GAST(
const EphTime& t,
bool reduced)
1082 if (convention == IERSConvention::IERS1996)
1084 return GAST1996(t, UT1mUTC, reduced);
1086 else if (convention == IERSConvention::IERS2003)
1088 return GAST2003(t, UT1mUTC);
1090 else if (convention == IERSConvention::IERS2010)
1092 return GAST2010(t, UT1mUTC);
1096 Exception e(
"IERS convention is not defined");
1113 if (convention == IERSConvention::IERS1996)
1115 return polarMotionMatrix1996(xp, yp);
1117 else if (convention == IERSConvention::IERS2003)
1119 return polarMotionMatrix2003(t, xp, yp);
1121 else if (convention == IERSConvention::IERS2010)
1123 return polarMotionMatrix2003(t, xp, yp);
1127 Exception e(
"IERS convention is not defined");
1138 double T = coordTransTime(t);
1139 if (convention == IERSConvention::IERS1996)
1141 return precessionMatrix1996(T);
1143 else if (convention == IERSConvention::IERS2003)
1145 return precessionMatrix2003(T);
1147 else if (convention == IERSConvention::IERS2010)
1149 return precessionMatrix2010(T);
1153 Exception e(
"IERS convention is not defined");
1188 double T = coordTransTime(t);
1189 if (convention == IERSConvention::IERS1996)
1191 return nutationMatrix1996(T);
1193 else if (convention == IERSConvention::IERS2003)
1195 return nutationMatrix2003(T);
1197 else if (convention == IERSConvention::IERS2010)
1199 return nutationMatrix2010(T);
1203 Exception e(
"IERS convention is not defined");
1222 if (convention == IERSConvention::IERS1996)
1226 else if (convention == IERSConvention::IERS2003)
1228 return preciseEarthRotation2003(coordTransTime(t));
1230 else if (convention == IERSConvention::IERS2010)
1232 return preciseEarthRotation2010(coordTransTime(t));
1236 Exception e(
"IERS convention is not defined");
1252 if (convention == IERSConvention::IERS1996)
1254 return ECEFtoInertial1996(t, xp, yp, UT1mUTC, reduced);
1256 else if (convention == IERSConvention::IERS2003)
1258 return ECEFtoInertial2003(t, xp, yp, UT1mUTC);
1260 else if (convention == IERSConvention::IERS2010)
1262 return ECEFtoInertial2010(t, xp, yp, UT1mUTC);
1266 Exception e(
"IERS convention is not defined");
1327 double EarthOrientation::S(
double T,
double& X,
double& Y,
1331 double s, st[6],
arg;
1340 if (which == IERSConvention::IERS2010)
1342 farg[4] = Omega2003(T);
1356 static const double polycoeff[6] = {94.00e-6, 3808.35e-6, -119.94e-6,
1357 -72574.09e-6, 27.70e-6, 15.61e-6};
1359 static const double polycoeff2010[6] = {
1360 94.00e-6, 3808.65e-6, -122.68e-6, -72574.11e-6, 27.98e-6, 15.62e-6};
1365 double sincoeff, coscoeff;
1369 static const Coeffs C0[] = {
1371 {{0, 0, 0, 0, 1, 0, 0, 0}, -2640.73e-6, 0.39e-6},
1372 {{0, 0, 0, 0, 2, 0, 0, 0}, -63.53e-6, 0.02e-6},
1373 {{0, 0, 2, -2, 3, 0, 0, 0}, -11.75e-6, -0.01e-6},
1374 {{0, 0, 2, -2, 1, 0, 0, 0}, -11.21e-6, -0.01e-6},
1375 {{0, 0, 2, -2, 2, 0, 0, 0}, 4.57e-6, 0.00e-6},
1376 {{0, 0, 2, 0, 3, 0, 0, 0}, -2.02e-6, 0.00e-6},
1377 {{0, 0, 2, 0, 1, 0, 0, 0}, -1.98e-6, 0.00e-6},
1378 {{0, 0, 0, 0, 3, 0, 0, 0}, 1.72e-6, 0.00e-6},
1379 {{0, 1, 0, 0, 1, 0, 0, 0}, 1.41e-6, 0.01e-6},
1380 {{0, 1, 0, 0, -1, 0, 0, 0}, 1.26e-6, 0.01e-6},
1382 {{1, 0, 0, 0, -1, 0, 0, 0}, 0.63e-6, 0.00e-6},
1383 {{1, 0, 0, 0, 1, 0, 0, 0}, 0.63e-6, 0.00e-6},
1384 {{0, 1, 2, -2, 3, 0, 0, 0}, -0.46e-6, 0.00e-6},
1385 {{0, 1, 2, -2, 1, 0, 0, 0}, -0.45e-6, 0.00e-6},
1386 {{0, 0, 4, -4, 4, 0, 0, 0}, -0.36e-6, 0.00e-6},
1387 {{0, 0, 1, -1, 1, -8, 12, 0}, 0.24e-6, 0.12e-6},
1388 {{0, 0, 2, 0, 0, 0, 0, 0}, -0.32e-6, 0.00e-6},
1389 {{0, 0, 2, 0, 2, 0, 0, 0}, -0.28e-6, 0.00e-6},
1390 {{1, 0, 2, 0, 3, 0, 0, 0}, -0.27e-6, 0.00e-6},
1391 {{1, 0, 2, 0, 1, 0, 0, 0}, -0.26e-6, 0.00e-6},
1393 {{0, 0, 2, -2, 0, 0, 0, 0}, 0.21e-6, 0.00e-6},
1394 {{0, 1, -2, 2, -3, 0, 0, 0}, -0.19e-6, 0.00e-6},
1395 {{0, 1, -2, 2, -1, 0, 0, 0}, -0.18e-6, 0.00e-6},
1396 {{0, 0, 0, 0, 0, 8, -13, -1}, 0.10e-6, -0.05e-6},
1397 {{0, 0, 0, 2, 0, 0, 0, 0}, -0.15e-6, 0.00e-6},
1398 {{2, 0, -2, 0, -1, 0, 0, 0}, 0.14e-6, 0.00e-6},
1399 {{0, 1, 2, -2, 2, 0, 0, 0}, 0.14e-6, 0.00e-6},
1400 {{1, 0, 0, -2, 1, 0, 0, 0}, -0.14e-6, 0.00e-6},
1401 {{1, 0, 0, -2, -1, 0, 0, 0}, -0.14e-6, 0.00e-6},
1402 {{0, 0, 4, -2, 4, 0, 0, 0}, -0.13e-6, 0.00e-6},
1404 {{0, 0, 2, -2, 4, 0, 0, 0}, 0.11e-6, 0.00e-6},
1405 {{1, 0, -2, 0, -3, 0, 0, 0}, -0.11e-6, 0.00e-6},
1406 {{1, 0, -2, 0, -1, 0, 0, 0}, -0.11e-6, 0.00e-6}};
1410 static const double C1_1_sincoeff2010 = 1.73e-6;
1411 static const Coeffs C1[] = {
1412 {{0, 0, 0, 0, 2, 0, 0, 0}, -0.07e-6, 3.57e-6},
1413 {{0, 0, 0, 0, 1, 0, 0, 0}, 1.71e-6, -0.03e-6},
1414 {{0, 0, 2, -2, 3, 0, 0, 0}, 0.00e-6, 0.48e-6}};
1418 static const double C2_0_sincoeff = 743.52e-6;
1419 static const Coeffs C2[] = {
1421 {{0, 0, 0, 0, 1, 0, 0, 0}, 743.53e-6, -0.17e-6},
1422 {{0, 0, 2, -2, 2, 0, 0, 0}, 56.91e-6, 0.06e-6},
1423 {{0, 0, 2, 0, 2, 0, 0, 0}, 9.84e-6, -0.01e-6},
1424 {{0, 0, 0, 0, 2, 0, 0, 0}, -8.85e-6, 0.01e-6},
1425 {{0, 1, 0, 0, 0, 0, 0, 0}, -6.38e-6, -0.05e-6},
1426 {{1, 0, 0, 0, 0, 0, 0, 0}, -3.07e-6, 0.00e-6},
1427 {{0, 1, 2, -2, 2, 0, 0, 0}, 2.23e-6, 0.00e-6},
1428 {{0, 0, 2, 0, 1, 0, 0, 0}, 1.67e-6, 0.00e-6},
1429 {{1, 0, 2, 0, 2, 0, 0, 0}, 1.30e-6, 0.00e-6},
1430 {{0, 1, -2, 2, -2, 0, 0, 0}, 0.93e-6, 0.00e-6},
1432 {{1, 0, 0, -2, 0, 0, 0, 0}, 0.68e-6, 0.00e-6},
1433 {{0, 0, 2, -2, 1, 0, 0, 0}, -0.55e-6, 0.00e-6},
1434 {{1, 0, -2, 0, -2, 0, 0, 0}, 0.53e-6, 0.00e-6},
1435 {{0, 0, 0, 2, 0, 0, 0, 0}, -0.27e-6, 0.00e-6},
1436 {{1, 0, 0, 0, 1, 0, 0, 0}, -0.27e-6, 0.00e-6},
1437 {{1, 0, -2, -2, -2, 0, 0, 0}, -0.26e-6, 0.00e-6},
1438 {{1, 0, 0, 0, -1, 0, 0, 0}, -0.25e-6, 0.00e-6},
1439 {{1, 0, 2, 0, 1, 0, 0, 0}, 0.22e-6, 0.00e-6},
1440 {{2, 0, 0, -2, 0, 0, 0, 0}, -0.21e-6, 0.00e-6},
1441 {{2, 0, -2, 0, -1, 0, 0, 0}, 0.20e-6, 0.00e-6},
1443 {{0, 0, 2, 2, 2, 0, 0, 0}, 0.17e-6, 0.00e-6},
1444 {{2, 0, 2, 0, 2, 0, 0, 0}, 0.13e-6, 0.00e-6},
1445 {{2, 0, 0, 0, 0, 0, 0, 0}, -0.13e-6, 0.00e-6},
1446 {{1, 0, 2, -2, 2, 0, 0, 0}, -0.12e-6, 0.00e-6},
1447 {{0, 0, 2, 0, 0, 0, 0, 0}, -0.11e-6, 0.00e-6}};
1450 static const Coeffs C3[] = {
1451 {{0, 0, 0, 0, 1, 0, 0, 0}, 0.30e-6, -23.51e-6},
1452 {{0, 0, 2, -2, 2, 0, 0, 0}, -0.03e-6, -1.39e-6},
1453 {{0, 0, 2, 0, 2, 0, 0, 0}, -0.01e-6, -0.24e-6},
1454 {{0, 0, 0, 0, 2, 0, 0, 0}, 0.00e-6, 0.22e-6}};
1455 static const Coeffs C32010[] = {
1456 {{0, 0, 0, 0, 1, 0, 0, 0}, 0.30e-6, -23.42e-6},
1457 {{0, 0, 2, -2, 2, 0, 0, 0}, -0.03e-6, -1.46e-6},
1458 {{0, 0, 2, 0, 2, 0, 0, 0}, -0.01e-6, -0.25e-6},
1459 {{0, 0, 0, 0, 2, 0, 0, 0}, 0.00e-6, 0.23e-6}};
1462 static const Coeffs C4[] = {
1463 {{0, 0, 0, 0, 1, 0, 0, 0}, -0.26e-6, -0.01e-6}};
1466 const int n0 = int(
sizeof C0 /
sizeof(Coeffs));
1467 const int n1 = int(
sizeof C1 /
sizeof(Coeffs));
1468 const int n2 = int(
sizeof C2 /
sizeof(Coeffs));
1469 const int n3 = int(
sizeof C3 /
sizeof(Coeffs));
1470 const int n4 = int(
sizeof C4 /
sizeof(Coeffs));
1473 if (which != IERSConvention::IERS2010)
1475 for (i = 0; i < 6; ++i)
1477 st[i] = polycoeff[i];
1482 for (i = 0; i < 6; ++i)
1484 st[i] = polycoeff2010[i];
1489 for (i = n0 - 1; i >= 0; --i)
1492 for (j = 0; j < 8; ++j)
1494 arg += C0[i].coeff[j] * farg[j];
1499 for (i = n1 - 1; i >= 0; --i)
1502 for (j = 0; j < 8; ++j)
1504 arg += C1[i].coeff[j] * farg[j];
1506 if (which == IERSConvention::IERS2010 && i == 1)
1517 for (i = n2 - 1; i >= 0; --i)
1520 for (j = 0; j < 8; ++j)
1522 arg += C2[i].coeff[j] * farg[j];
1524 if (which == IERSConvention::IERS2010 && i == 0)
1535 if (which != IERSConvention::IERS2010)
1537 for (i = n3 - 1; i >= 0; --i)
1540 for (j = 0; j < 8; ++j)
1542 arg += C3[i].coeff[j] * farg[j];
1549 for (i = n3 - 1; i >= 0; --i)
1552 for (j = 0; j < 8; ++j)
1554 arg += C32010[i].coeff[j] * farg[j];
1556 st[3] += C32010[i].sincoeff *
::sin(
arg) +
1561 for (i = n4 - 1; i >= 0; --i)
1564 for (j = 0; j < 8; ++j)
1566 arg += C4[i].coeff[j] * farg[j];
1573 (st[1] + (st[2] + (st[3] + (st[4] + st[5] * T) * T) * T) * T) * T;
1587 double EarthOrientation::Sprime(
double T)
1589 double sp = -47.0e-6 * T * ARCSEC_TO_RAD;
1601 void EarthOrientation::XYCIO(
double& T,
double& X,
double& Y)
1610 double powsT[
MAXPT + 1];
1612 for (i = 0; i <=
MAXPT; i++)
1624 fa[4] = Omega2003(T);
1636 double xypoly[2] = {0.0, 0.0}, xylunarsolar[2] = {0.0, 0.0},
1637 xyplanet[2] = {0.0, 0.0};
1640 for (i = 0; i < 2; i++)
1642 for (j =
MAXPT; j >= 0; j--)
1644 xypoly[i] +=
XYcoeff[i][j] * powsT[j];
1649 int ilast(
NAmp), jlast;
1651 for (
int ifreq =
NFAP - 1; ifreq >= 0; ifreq--)
1655 for (i = 0; i < 14; i++)
1669 for (i = ilast; i >= jlast; i--)
1680 for (
int ifreq =
NFALS - 1; ifreq >= 0; ifreq--)
1684 for (i = 0; i < 5; i++)
1697 jlast =
iamp[ifreq];
1698 for (i = ilast; i >= jlast; i--)
1706 X = xypoly[0] + (xylunarsolar[0] + xyplanet[0]) * 1.e-6;
1708 Y = xypoly[1] + (xylunarsolar[1] + xyplanet[1]) * 1.e-6;
1719 double EarthOrientation::EarthRotationAngle(
const EphTime& t,
1730 int idays(
int(tUT1.
dMJD() - 0.5) -
1740 double term1 = frac + 0.7790572732640 + 0.00273781191135448 * frac;
1745 double term2 = ::fmod(0.00273781191135448 *
double(idays), 1.0);
1746 double term = ::fmod(term1 + term2, 1.0);
1748 double era = TWOPI * term;
1770 double EarthOrientation::equationOfEquinoxes2003(
EphTime t)
1784 double sincoeff, coscoeff;
1788 static const Coeffs Czero[] = {
1791 {{0, 0, 0, 0, 1, 0, 0, 0}, 2640.96e-6, -0.39e-6},
1792 {{0, 0, 0, 0, 2, 0, 0, 0}, 63.52e-6, -0.02e-6},
1793 {{0, 0, 2, -2, 3, 0, 0, 0}, 11.75e-6, 0.01e-6},
1794 {{0, 0, 2, -2, 1, 0, 0, 0}, 11.21e-6, 0.01e-6},
1795 {{0, 0, 2, -2, 2, 0, 0, 0}, -4.55e-6, 0.00e-6},
1796 {{0, 0, 2, 0, 3, 0, 0, 0}, 2.02e-6, 0.00e-6},
1797 {{0, 0, 2, 0, 1, 0, 0, 0}, 1.98e-6, 0.00e-6},
1798 {{0, 0, 0, 0, 3, 0, 0, 0}, -1.72e-6, 0.00e-6},
1799 {{0, 1, 0, 0, 1, 0, 0, 0}, -1.41e-6, -0.01e-6},
1800 {{0, 1, 0, 0, -1, 0, 0, 0}, -1.26e-6, -0.01e-6},
1802 {{1, 0, 0, 0, -1, 0, 0, 0}, -0.63e-6, 0.00e-6},
1803 {{1, 0, 0, 0, 1, 0, 0, 0}, -0.63e-6, 0.00e-6},
1804 {{0, 1, 2, -2, 3, 0, 0, 0}, 0.46e-6, 0.00e-6},
1805 {{0, 1, 2, -2, 1, 0, 0, 0}, 0.45e-6, 0.00e-6},
1806 {{0, 0, 4, -4, 4, 0, 0, 0}, 0.36e-6, 0.00e-6},
1807 {{0, 0, 1, -1, 1, -8, 12, 0}, -0.24e-6, -0.12e-6},
1808 {{0, 0, 2, 0, 0, 0, 0, 0}, 0.32e-6, 0.00e-6},
1809 {{0, 0, 2, 0, 2, 0, 0, 0}, 0.28e-6, 0.00e-6},
1810 {{1, 0, 2, 0, 3, 0, 0, 0}, 0.27e-6, 0.00e-6},
1811 {{1, 0, 2, 0, 1, 0, 0, 0}, 0.26e-6, 0.00e-6},
1813 {{0, 0, 2, -2, 0, 0, 0, 0}, -0.21e-6, 0.00e-6},
1814 {{0, 1, -2, 2, -3, 0, 0, 0}, 0.19e-6, 0.00e-6},
1815 {{0, 1, -2, 2, -1, 0, 0, 0}, 0.18e-6, 0.00e-6},
1816 {{0, 0, 0, 0, 0, 8, -13, -1}, -0.10e-6, 0.05e-6},
1817 {{0, 0, 0, 2, 0, 0, 0, 0}, 0.15e-6, 0.00e-6},
1818 {{2, 0, -2, 0, -1, 0, 0, 0}, -0.14e-6, 0.00e-6},
1819 {{1, 0, 0, -2, 1, 0, 0, 0}, 0.14e-6, 0.00e-6},
1820 {{0, 1, 2, -2, 2, 0, 0, 0}, -0.14e-6, 0.00e-6},
1821 {{1, 0, 0, -2, -1, 0, 0, 0}, 0.14e-6, 0.00e-6},
1822 {{0, 0, 4, -2, 4, 0, 0, 0}, 0.13e-6, 0.00e-6},
1824 {{0, 0, 2, -2, 4, 0, 0, 0}, -0.11e-6, 0.00e-6},
1825 {{1, 0, -2, 0, -3, 0, 0, 0}, 0.11e-6, 0.00e-6},
1826 {{1, 0, -2, 0, -1, 0, 0, 0}, 0.11e-6, 0.00e-6}};
1834 const int n0 = int(
sizeof Czero /
sizeof(Coeffs));
1840 double T(coordTransTime(t));
1844 LOG(
DEBUG7) <<
"\nT = " << fixed << setprecision(15) << T;
1846 LOG(
DEBUG7) <<
"L(T) = " << fixed << setprecision(15) << farg[0];
1848 LOG(
DEBUG7) <<
"Lp(T) = " << fixed << setprecision(15) << farg[1];
1850 LOG(
DEBUG7) <<
"F(T) = " << fixed << setprecision(15) << farg[2];
1852 LOG(
DEBUG7) <<
"D(T) = " << fixed << setprecision(15) << farg[3];
1853 farg[4] = Omega2003(T);
1854 LOG(
DEBUG7) <<
"Omega2003(T) = " << fixed << setprecision(15)
1857 LOG(
DEBUG7) <<
"LV(T) = " << fixed << setprecision(15) << farg[5];
1859 LOG(
DEBUG7) <<
"LE(T) = " << fixed << setprecision(15) << farg[6];
1861 LOG(
DEBUG7) <<
"Pa(T) = " << fixed << setprecision(15) << farg[7];
1865 for (
int i = n0 - 1; i >= 0; --i)
1868 for (
int j = 0; j < N; ++j)
1870 if (Czero[i].
coeff[j])
1872 arg += Czero[i].coeff[j] * farg[j];
1875 ee += Czero[i].sincoeff *
::sin(
arg);
1876 if (Czero[i].coscoeff)
1878 ee += Czero[i].coscoeff *
::cos(
arg);
1883 ee += -0.87e-6 *
::sin(farg[4]) * T;
1886 ee *= ARCSEC_TO_RAD;
1903 void EarthOrientation::UT1mUTCTidalCorrections(
double T,
double&
UT1mUT1R,
1923 double EarthOrientation::obliquity1996(
double T)
1931 return (84381.448 + T * (-46.8150 + T * (-0.00059 + T * (0.001813)))) *
1938 double EarthOrientation::obliquity2010(
double T)
1949 T * (-0.000000576 + T * (-0.0000000434)))))) *
1960 double EarthOrientation::GMST1996(
EphTime t,
double UT1mUTC,
bool reduced)
1979 double T((t.
dMJD() - JulianEpoch) / 36525.0);
1982 double G = -19089.45159
1983 + T * (8640184.812866 + T * (0.093104 - T * 6.2e-6));
1996 double frac(0.5 + t.
secOfDay() / 86400);
2005 G = ::fmod(G, TWOPI);
2025 double EarthOrientation::GMST2003(
EphTime t,
double UT1mUTC)
2030 double T(coordTransTime(t)), G;
2031 double era = EarthRotationAngle(t, UT1mUTC);
2035 (1.39667721 + (-0.00009344 + 0.00001882 * T) * T) * T) *
2054 double EarthOrientation::GMST2010(
EphTime t,
double UT1mUTC)
2058 double era = EarthRotationAngle(t, UT1mUTC);
2061 double T = coordTransTime(t);
2071 T * (-0.00000044 + T * (-0.000029956 +
2072 T * (-0.0000000368)))))) *
2089 double EarthOrientation::gast1996(
EphTime t,
double om,
double eps,
2090 double dpsi,
double UT1mUTC)
2094 double G = GMST1996(t, UT1mUTC,
false);
2099 (0.00264 *
::sin(om) + 0.000063 *
::sin(2.0 * om)) * ARCSEC_TO_RAD;
2101 LOG(
DEBUG7) <<
"\nequequinox = " << fixed << setprecision(15)
2102 << showpos << 1.e3 * ee *
RAD_TO_DEG <<
" / 1.e3";
2103 LOG(
DEBUG7) <<
"\nGMST = " << fixed << setprecision(15) << showpos
2142 double EarthOrientation::GAST1996(
EphTime t,
double UT1mUTC,
bool reduced)
2146 double T(coordTransTime(t));
2147 double omega, deps, dpsi, G;
2148 double eps(obliquity1996(T)), epsa;
2150 nutationAngles1996(T, deps, dpsi, omega);
2157 G = gast1996(t, omega, eps, dpsi,
UT1mUT1R - UT1mUTC);
2161 G = gast1996(t, omega, eps, dpsi, UT1mUTC);
2178 double EarthOrientation::GAST2003(
EphTime t,
double UT1mUTC)
2182 double omega, deps, dpsi, G;
2183 double T(coordTransTime(t));
2186 double dpsipr, depspr;
2187 precessionRateCorrections2003(T, dpsipr, depspr);
2190 double eps(obliquity1996(T));
2192 double epsa(eps + depspr);
2194 nutationAngles2003(T, deps, dpsi);
2197 double ee = equationOfEquinoxes2003(t);
2198 LOG(
DEBUG7) <<
"\nee = " << fixed << setprecision(15) << showpos
2200 ee = dpsi *
::cos(epsa) + ee;
2202 G = GMST2003(t, UT1mUTC) + ee;
2218 double EarthOrientation::GAST2010(
EphTime t,
double UT1mUTC)
2223 preciseEarthRotation2010(coordTransTime(t));
2227 double X(NutPreBias(2, 0)),
Y(NutPreBias(2, 1));
2230 double T(coordTransTime(t));
2231 double s(S(T, X,
Y, IERSConvention::IERS2010));
2234 double era = EarthRotationAngle(t, UT1mUTC);
2237 double eo, ax, xs, ys, zs, p, q;
2238 ax = X / (1.0 + NutPreBias(2, 2));
2242 p = NutPreBias(0, 0) * xs + NutPreBias(0, 1) * ys +
2243 NutPreBias(0, 2) * zs;
2244 q = NutPreBias(1, 0) * xs + NutPreBias(1, 1) * ys +
2245 NutPreBias(1, 2) * zs;
2246 eo = ((p != 0) || (q != 0)) ? s - ::atan2(q, p) : s;
2251 return ::fmod(era - eo, TWOPI);
2269 xp *= ARCSEC_TO_RAD;
2270 yp *= ARCSEC_TO_RAD;
2289 double sp(Sprime(t));
2290 LOG(
DEBUG7) <<
"\nsp = " << fixed << setprecision(15) << setw(18) <<
sp
2291 <<
" with T = " << coordTransTime(t);
2292 xp *= ARCSEC_TO_RAD;
2293 yp *= ARCSEC_TO_RAD;
2298 return (R1 * R2 * R3);
2305 void EarthOrientation::FukushimaWilliams(
double T,
double& gamb,
2306 double& phib,
double& psib,
2313 (-0.00031238 + (-0.000002788 + 0.0000000260 * T) * T) * T) *
2317 phib = (84381.412819 +
2320 (0.00053289 + (-0.000000440 - 0.0000000176 * T) * T) * T) *
2327 (-0.00018522 + (-0.000026452 - 0.0000000148 * T) * T) * T) *
2333 eps = obliquity2010(T);
2372 void EarthOrientation::nutationAngles1996(
double T,
double& deps,
2373 double& dpsi,
double& om)
2381 ::fmod((485866.733 + (715922.633 + (31.310 + 0.064 * T) * T) * T) *
2383 ::fmod(1325.0 * T, 1.0) * TWOPI,
2388 ::fmod((1287099.804 + (1292581.224 + (-0.577 - 0.012 * T) * T) * T) *
2390 ::fmod(99.0 * T, 1.0) * TWOPI,
2395 ::fmod((335778.877 + (295263.137 + (-13.257 + 0.011 * T) * T) * T) *
2397 ::fmod(1342.0 * T, 1.0) * TWOPI,
2402 ::fmod((1072261.307 + (1105601.328 + (-6.891 + 0.019 * T) * T) * T) *
2404 ::fmod(1236.0 * T, 1.0) * TWOPI,
2409 om = ::fmod((450160.280 + (-482890.539 + (7.455 + 0.008 * T) * T) * T) *
2411 ::fmod(-5.0 * T, 1.0) * TWOPI,
2415 double arg, scoeff, ccoeff;
2417 for (
int i =
Ncoeff - 1; i >= 0; i--)
2437 deps *= ARCSEC_TO_RAD * 1.e-4;
2438 dpsi *= ARCSEC_TO_RAD * 1.e-4;
2447 void EarthOrientation::nutationAngles2003(
double T,
double& deps,
2451 const double COEFF_TO_RAD(ARCSEC_TO_RAD * 1.0e-7);
2463 ::fmod(1287104.79305
2464 + T * (129596581.0481 +
2465 T * (-0.5532 + T * (0.000136 + T * (-0.00001149)))),
2466 ARCSEC_PER_CIRCLE) *
2470 ::fmod(335779.526232
2471 + T * (1739527262.8478 +
2472 T * (-12.7512 + T * (-0.001037 + T * (0.00000417)))),
2473 ARCSEC_PER_CIRCLE) *
2477 ::fmod(1072260.70369
2478 + T * (1602961601.2090 +
2479 T * (-6.3706 + T * (0.006593 + T * (-0.00003169)))),
2480 ARCSEC_PER_CIRCLE) *
2483 double Om(Omega2003(T));
2488 double arg, sina, cosa;
2491 for (i =
NLS - 1; i >= 0; --i)
2513 l = ::fmod(2.35555598 + 8328.6914269554 * T, TWOPI);
2515 f = ::fmod(1.627905234 + 8433.466158131 * T, TWOPI);
2517 d = ::fmod(5.198466741 + 7771.3771468121 * T, TWOPI);
2519 Om = ::fmod(2.18243920 - 33.757045 * T, TWOPI);
2536 double lne(::fmod(5.321159000 + 3.8127774000 * T, TWOPI));
2541 for (i =
NP - 1; i >= 0; --i)
2559 deps *= COEFF_TO_RAD;
2560 dpsi *= COEFF_TO_RAD;
2572 void EarthOrientation::nutationAngles2010(
double T,
double& deps,
2575 nutationAngles2003(T, deps, dpsi);
2576 double fj2(-2.7774e-6 * T);
2577 dpsi *= (1.0 + 0.4697e-6 + fj2);
2578 deps *= (1.0 + fj2);
2592 return (R3 * R2 * R1);
2601 double eps(obliquity1996(T)), deps, dpsi, om;
2603 nutationAngles1996(T, deps, dpsi, om);
2604 return nutationMatrix(eps, dpsi, deps);
2614 double eps(obliquity1996(T)), deps, dpsi;
2615 nutationAngles2003(T, deps, dpsi);
2619 double depspr = -0.02524 * ARCSEC_TO_RAD * T;
2622 return nutationMatrix(eps, dpsi, deps);
2632 double deps, dpsi, eps;
2651 nutationAngles2010(T, deps, dpsi);
2652 return nutationMatrix(obliquity2010(T), dpsi, deps);
2663 double TAR(T * ARCSEC_TO_RAD);
2664 double zeta = TAR * (2306.2181 + T * (0.30188 + T * 0.017998));
2665 double theta = TAR * (2004.3109 - T * (0.42665 + T * 0.041833));
2666 double z = TAR * (2306.2181 + T * (1.09468 + T * 0.018203));
2684 static const double eps0(84381.448 * ARCSEC_TO_RAD);
2685 LOG(
DEBUG7) <<
"\nobliquity at J2000 eps0 = " << fixed << setprecision(15)
2689 static const double psibias = -0.041775 * ARCSEC_TO_RAD;
2690 static const double epsbias = -0.0068192 * ARCSEC_TO_RAD;
2692 static const double raeps0 = -0.0146 * ARCSEC_TO_RAD;
2693 LOG(
DEBUG7) <<
"frame bias psi = " << fixed << setprecision(15) << showpos
2695 LOG(
DEBUG7) <<
"frame bias eps = " << fixed << setprecision(15) << showpos
2697 LOG(
DEBUG7) <<
"frame bias dra = " << fixed << setprecision(15) << showpos
2701 double psia((5038.7784 + (-1.07259 + (-0.001147) * T) * T) * T *
2703 double epsa(eps0 + ((0.05127 + (-0.007726) * T) * T) * T * ARCSEC_TO_RAD);
2704 double chia((10.5526 + (-2.38064 + (-0.001125) * T) * T) * T *
2706 LOG(
DEBUG7) <<
"\nprecession angle psi = " << fixed << setprecision(15)
2708 LOG(
DEBUG7) <<
"precession angle eps = " << fixed << setprecision(15)
2710 LOG(
DEBUG7) <<
"precession angle chi = " << fixed << setprecision(15)
2715 double dpsipr, depspr;
2716 precessionRateCorrections2003(T, dpsipr, depspr);
2719 LOG(
DEBUG7) <<
"precession rate = " << fixed << setprecision(15)
2720 << showpos << dpsipr <<
" " << depspr;
2730 << fixed << setprecision(15) << showpos << FrameBias;
2739 << fixed << setprecision(15) << showpos << Precess;
2741 LOG(
DEBUG7) <<
"\nprecession*framebias matrix:\n"
2742 << fixed << setprecision(15) << showpos
2743 << (Precess * FrameBias);
2745 return (Precess * FrameBias);
2752 void EarthOrientation::precessionRateCorrections2003(
double T,
double& dpsi,
2757 dpsi = -0.29965 * ARCSEC_TO_RAD * T;
2758 deps = -0.02524 * ARCSEC_TO_RAD * T;
2767 double gamb, phib, psib, epsa;
2768 FukushimaWilliams(0.0, gamb, phib, psib, epsa);
2771 return FukushimaWilliams(gamb, phib, psib, epsa);
2782 double gamb, phib, psib, epsa;
2788 FukushimaWilliams(T, gamb, phib, psib, epsa);
2830 double deps, dpsi, epsa;
2833 double gamb, phib, psib;
2834 FukushimaWilliams(T, gamb, phib, psib, epsa);
2837 nutationAngles2010(T, deps, dpsi);
2840 return FukushimaWilliams(gamb, phib, psib + dpsi, epsa + deps);
2863 double T = coordTransTime(t);
2866 P = precessionMatrix1996(T);
2868 << fixed << setprecision(15) << setw(18) << showpos <<
P;
2871 double eps, deps, dpsi, om;
2873 eps = obliquity1996(T);
2874 LOG(
DEBUG7) <<
"\nmean obliquity " << fixed << setprecision(15)
2877 nutationAngles1996(T, deps, dpsi, om);
2878 LOG(
DEBUG7) <<
"\nnutation angles psi eps " << fixed
2879 << setprecision(15) << showpos << dpsi <<
" " << deps;
2881 N = nutationMatrix(eps, dpsi, deps);
2883 << fixed << setprecision(15) << setw(18) << showpos << N;
2886 << fixed << setprecision(15) << setw(18) << showpos
2897 double g = gast1996(t, om, eps, dpsi, UT1mUTC);
2898 LOG(
DEBUG7) <<
"\nGAST = " << fixed << setprecision(15) << showpos
2902 LOG(
DEBUG7) <<
"\ncelestial-to-terrestrial matrix (no polar motion):\n"
2903 << fixed << setprecision(15) << setw(18) << showpos
2907 W = polarMotionMatrix1996(xp, yp);
2908 LOG(
DEBUG7) <<
"\npolar motion matrix:\n"
2909 << fixed << setprecision(15) << setw(18) << showpos << W;
2933 double T(coordTransTime(t));
2937 double gmst = GMST2003(t, UT1mUTC);
2938 LOG(
DEBUG7) <<
"\nGMST = " << fixed << setprecision(15) << showpos
2941 double gast = GAST2003(t, UT1mUTC);
2942 LOG(
DEBUG7) <<
"\nGAST = " << fixed << setprecision(15) << showpos
2947 double deps, dpsi, dpsipr, depspr;
2948 nutationAngles2003(T, deps, dpsi);
2949 LOG(
DEBUG7) <<
"\nnutation angles psi eps " << fixed
2950 << setprecision(15) << showpos << dpsi <<
" " << deps;
2954 precessionRateCorrections2003(T, dpsipr, depspr);
2955 LOG(
DEBUG7) <<
"\nprecession-rate " << fixed << setprecision(15)
2956 << showpos << dpsipr <<
" " << depspr;
2958 double eps(obliquity1996(T));
2959 LOG(
DEBUG7) <<
"\nmean obliquity " << fixed << setprecision(15)
2963 N = nutationMatrix(eps, dpsi, deps);
2965 << fixed << setprecision(15) << setw(18) << showpos << N;
2968 P = precessionMatrix2003(T);
2972 << fixed << setprecision(15) << setw(18) << showpos << NPB;
2975 double era(EarthRotationAngle(t, UT1mUTC));
2976 LOG(
DEBUG7) <<
"\nERA = " << fixed << setprecision(15) << showpos
2984 W = polarMotionMatrix2003(t, xp, yp);
2985 LOG(
DEBUG7) <<
"\npolar motion matrix:\n"
2986 << fixed << setprecision(15) << setw(18) << showpos << W;
3008 double T(coordTransTime(t));
3015 s = S(T, X,
Y, IERSConvention::IERS2010);
3016 LOG(
DEBUG7) <<
"X = " << fixed << setprecision(15) << showpos << X;
3017 LOG(
DEBUG7) <<
"Y = " << fixed << setprecision(15) << showpos <<
Y;
3018 LOG(
DEBUG7) <<
"s\" = " << fixed << setprecision(15)
3019 << s / ARCSEC_TO_RAD;
3023 double r2(X * X +
Y *
Y);
3024 double e(r2 != 0.0 ? ::atan2(
Y, X) : 0.0);
3025 double d(::atan(::sqrt(r2 / (1.0 - r2))));
3029 << fixed << setprecision(15) << setw(18) << showpos
3035 double era = EarthRotationAngle(t, UT1mUTC);
3036 LOG(
DEBUG7) <<
"\nERA = " << fixed << setprecision(15) << showpos
3043 LOG(
DEBUG7) <<
"\ncelestial-to-terrestrial matrix (no polar motion):\n"
3044 << fixed << setprecision(15) << setw(18) << showpos
3045 << CIRStoTIRS * GCRStoCIRS;
3050 polarMotionMatrix2003(t, xp, yp));
3051 LOG(
DEBUG7) <<
"\npolar motion matrix:\n"
3052 << fixed << setprecision(15) << setw(18) << showpos
3057 GCRStoITRS = polarMotion * CIRStoTIRS * GCRStoCIRS;