From 6c3655c1c6c28bdc526a32968d83a8a2bdc83669 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Mon, 4 May 2020 21:30:36 -0400 Subject: [PATCH] Corrected the B1875 epoch for determining constellation boundaries. It turns out I was off by nearly 18 hours in the B1875 epoch. This has a tiny effect on the orientation of the Earth's axis. Instead of: ut = 1875-01-01T12:00:00.000Z the correct epoch is: ut = 1874-12-31T18:12.21.950Z See the comments in the Constellation functions in each of the source files for more info. --- generate/template/astronomy.c | 15 ++++++++++++++- generate/template/astronomy.cs | 13 ++++++++++++- generate/template/astronomy.js | 13 ++++++++++++- generate/template/astronomy.py | 13 ++++++++++++- source/c/astronomy.c | 15 ++++++++++++++- source/csharp/astronomy.cs | 13 ++++++++++++- source/js/astronomy.js | 13 ++++++++++++- source/js/astronomy.min.js | 4 ++-- source/python/astronomy.py | 13 ++++++++++++- 9 files changed, 102 insertions(+), 10 deletions(-) diff --git a/generate/template/astronomy.c b/generate/template/astronomy.c index a04ad3c1..dd0333e5 100644 --- a/generate/template/astronomy.c +++ b/generate/template/astronomy.c @@ -5292,7 +5292,20 @@ astro_constellation_t Astronomy_Constellation(double ra, double dec) /* Lazy-initialize the rotation matrix for converting J2000 to B1875. */ if (rot.status != ASTRO_SUCCESS) { - astro_time_t time = Astronomy_MakeTime(1875, 1, 1, 12, 0, 0.0); /* Not sure about exact date/time of 1875. */ + /* + Need to calculate the B1875 epoch. Based on this: + https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + B = 1900 + (JD - 2415020.31352) / 365.242198781 + I'm interested in using TT instead of JD, giving: + B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + B = 1900 + (TT + 36524.68648) / 365.242198781 + TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + But Astronomy_TimeFromDays() wants UT, not TT. + Near that date, I get a historical correction of ut-tt = 3.2 seconds. + That gives UT = -45655.74141261017 for the B1875 epoch, + or 1874-12-31T18:12:21.950Z. + */ + astro_time_t time = Astronomy_TimeFromDays(-45655.74141261017); rot = Astronomy_Rotation_EQJ_EQD(time); if (rot.status != ASTRO_SUCCESS) return ConstelErr(rot.status); diff --git a/generate/template/astronomy.cs b/generate/template/astronomy.cs index 4ae50ac1..f57022da 100644 --- a/generate/template/astronomy.cs +++ b/generate/template/astronomy.cs @@ -5045,7 +5045,18 @@ $ASTRO_CSHARP_CHEBYSHEV(8); if (ConstelRot.rot == null) { // Lazy-initialize the rotation matrix for converting J2000 to B1875. - var time = new AstroTime(1875, 1, 1, 12, 0, 0); + // Need to calculate the B1875 epoch. Based on this: + // https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + // B = 1900 + (JD - 2415020.31352) / 365.242198781 + // I'm interested in using TT instead of JD, giving: + // B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + // B = 1900 + (TT + 36524.68648) / 365.242198781 + // TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + // But the AstroTime constructor wants UT, not TT. + // Near that date, I get a historical correction of ut-tt = 3.2 seconds. + // That gives UT = -45655.74141261017 for the B1875 epoch, + // or 1874-12-31T18:12:21.950Z. + var time = new AstroTime(-45655.74141261017); ConstelRot = Rotation_EQJ_EQD(time); Epoch2000 = new AstroTime(0.0); } diff --git a/generate/template/astronomy.js b/generate/template/astronomy.js index 4912a090..f7385a0d 100644 --- a/generate/template/astronomy.js +++ b/generate/template/astronomy.js @@ -4209,7 +4209,18 @@ Astronomy.Constellation = function(ra, dec) { // Lazy-initialize rotation matrix. if (!ConstelRot) { - ConstelRot = Astronomy.Rotation_EQJ_EQD(new AstroTime(new Date(Date.UTC(1875, 0, 1, 12)))); + // Need to calculate the B1875 epoch. Based on this: + // https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + // B = 1900 + (JD - 2415020.31352) / 365.242198781 + // I'm interested in using TT instead of JD, giving: + // B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + // B = 1900 + (TT + 36524.68648) / 365.242198781 + // TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + // But the AstroTime constructor wants UT, not TT. + // Near that date, I get a historical correction of ut-tt = 3.2 seconds. + // That gives UT = -45655.74141261017 for the B1875 epoch, + // or 1874-12-31T18:12:21.950Z. + ConstelRot = Astronomy.Rotation_EQJ_EQD(new AstroTime(-45655.74141261017)); Epoch2000 = new AstroTime(0); } diff --git a/generate/template/astronomy.py b/generate/template/astronomy.py index cda4779d..9414833a 100644 --- a/generate/template/astronomy.py +++ b/generate/template/astronomy.py @@ -3976,7 +3976,18 @@ def Constellation(ra, dec): # Lazy-initialize rotation matrix. if _ConstelRot is None: - _ConstelRot = Rotation_EQJ_EQD(Time.Make(1875, 1, 1, 12, 0, 0)) + # Need to calculate the B1875 epoch. Based on this: + # https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + # B = 1900 + (JD - 2415020.31352) / 365.242198781 + # I'm interested in using TT instead of JD, giving: + # B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + # B = 1900 + (TT + 36524.68648) / 365.242198781 + # TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + # But the Time constructor wants UT, not TT. + # Near that date, I get a historical correction of ut-tt = 3.2 seconds. + # That gives UT = -45655.74141261017 for the B1875 epoch, + # or 1874-12-31T18:12:21.950Z. + _ConstelRot = Rotation_EQJ_EQD(Time(-45655.74141261017)) _Epoch2000 = Time(0.0) # Convert coordinates from J2000 to B1875. diff --git a/source/c/astronomy.c b/source/c/astronomy.c index 466de5f9..c6c39541 100644 --- a/source/c/astronomy.c +++ b/source/c/astronomy.c @@ -7038,7 +7038,20 @@ astro_constellation_t Astronomy_Constellation(double ra, double dec) /* Lazy-initialize the rotation matrix for converting J2000 to B1875. */ if (rot.status != ASTRO_SUCCESS) { - astro_time_t time = Astronomy_MakeTime(1875, 1, 1, 12, 0, 0.0); /* Not sure about exact date/time of 1875. */ + /* + Need to calculate the B1875 epoch. Based on this: + https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + B = 1900 + (JD - 2415020.31352) / 365.242198781 + I'm interested in using TT instead of JD, giving: + B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + B = 1900 + (TT + 36524.68648) / 365.242198781 + TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + But Astronomy_TimeFromDays() wants UT, not TT. + Near that date, I get a historical correction of ut-tt = 3.2 seconds. + That gives UT = -45655.74141261017 for the B1875 epoch, + or 1874-12-31T18:12:21.950Z. + */ + astro_time_t time = Astronomy_TimeFromDays(-45655.74141261017); rot = Astronomy_Rotation_EQJ_EQD(time); if (rot.status != ASTRO_SUCCESS) return ConstelErr(rot.status); diff --git a/source/csharp/astronomy.cs b/source/csharp/astronomy.cs index ffac88a4..66b78403 100644 --- a/source/csharp/astronomy.cs +++ b/source/csharp/astronomy.cs @@ -6341,7 +6341,18 @@ namespace CosineKitty if (ConstelRot.rot == null) { // Lazy-initialize the rotation matrix for converting J2000 to B1875. - var time = new AstroTime(1875, 1, 1, 12, 0, 0); + // Need to calculate the B1875 epoch. Based on this: + // https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + // B = 1900 + (JD - 2415020.31352) / 365.242198781 + // I'm interested in using TT instead of JD, giving: + // B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + // B = 1900 + (TT + 36524.68648) / 365.242198781 + // TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + // But the AstroTime constructor wants UT, not TT. + // Near that date, I get a historical correction of ut-tt = 3.2 seconds. + // That gives UT = -45655.74141261017 for the B1875 epoch, + // or 1874-12-31T18:12:21.950Z. + var time = new AstroTime(-45655.74141261017); ConstelRot = Rotation_EQJ_EQD(time); Epoch2000 = new AstroTime(0.0); } diff --git a/source/js/astronomy.js b/source/js/astronomy.js index c8ecb9f6..bf35cac4 100644 --- a/source/js/astronomy.js +++ b/source/js/astronomy.js @@ -5730,7 +5730,18 @@ Astronomy.Constellation = function(ra, dec) { // Lazy-initialize rotation matrix. if (!ConstelRot) { - ConstelRot = Astronomy.Rotation_EQJ_EQD(new AstroTime(new Date(Date.UTC(1875, 0, 1, 12)))); + // Need to calculate the B1875 epoch. Based on this: + // https://en.wikipedia.org/wiki/Epoch_(astronomy)#Besselian_years + // B = 1900 + (JD - 2415020.31352) / 365.242198781 + // I'm interested in using TT instead of JD, giving: + // B = 1900 + ((TT+2451545) - 2415020.31352) / 365.242198781 + // B = 1900 + (TT + 36524.68648) / 365.242198781 + // TT = 365.242198781*(B - 1900) - 36524.68648 = -45655.741449525 + // But the AstroTime constructor wants UT, not TT. + // Near that date, I get a historical correction of ut-tt = 3.2 seconds. + // That gives UT = -45655.74141261017 for the B1875 epoch, + // or 1874-12-31T18:12:21.950Z. + ConstelRot = Astronomy.Rotation_EQJ_EQD(new AstroTime(-45655.74141261017)); Epoch2000 = new AstroTime(0); } diff --git a/source/js/astronomy.min.js b/source/js/astronomy.min.js index afb45c4f..562d6e24 100644 --- a/source/js/astronomy.min.js +++ b/source/js/astronomy.min.js @@ -173,5 +173,5 @@ function(a){a=d.Rotation_EQD_ECL(a);return d.InverseRotation(a)};d.Rotation_ECL_ [49,5640,5760,-1008],[71,5760,5911.5,-1008],[9,1740,1800,-1032],[22,1800,2370,-1032],[67,2880,3012,-1032],[35,1230,1392,-1056],[71,5911.5,6420,-1092],[24,6420,6900,-1092],[76,6900,7320,-1092],[53,7320,7680,-1092],[35,1080,1230,-1104],[9,1620,1740,-1116],[49,5520,5640,-1152],[63,0,840,-1156],[35,960,1080,-1176],[40,1470,1536,-1176],[9,1536,1620,-1176],[38,7680,7920,-1200],[67,2160,2880,-1218],[84,2880,2940,-1218],[35,870,960,-1224],[40,1380,1470,-1224],[63,0,660,-1236],[12,2160,2220,-1260],[84,2940, 3042,-1272],[40,1260,1380,-1276],[32,1380,1440,-1276],[63,0,570,-1284],[35,780,870,-1296],[64,1620,1800,-1296],[49,5418,5520,-1296],[84,3042,3180,-1308],[12,2220,2340,-1320],[14,4260,4620,-1320],[49,5100,5418,-1320],[56,5418,5520,-1320],[32,1440,1560,-1356],[84,3180,3960,-1356],[14,3960,4050,-1356],[5,6300,6480,-1368],[78,6480,7320,-1368],[38,7920,8400,-1368],[40,1152,1260,-1380],[64,1800,1980,-1380],[12,2340,2460,-1392],[63,0,480,-1404],[35,480,780,-1404],[63,8400,8640,-1404],[32,1560,1650,-1416], [56,5520,5911.5,-1440],[43,7320,7680,-1440],[64,1980,2160,-1464],[18,5460,5520,-1464],[5,5911.5,5970,-1464],[18,5370,5460,-1526],[5,5970,6030,-1526],[64,2160,2460,-1536],[12,2460,3252,-1536],[14,4050,4260,-1536],[27,4260,4620,-1536],[14,4620,5232,-1536],[18,4860,4920,-1560],[5,6030,6060,-1560],[40,780,1152,-1620],[69,1152,1650,-1620],[18,5310,5370,-1620],[5,6060,6300,-1620],[60,6300,6480,-1620],[81,7920,8400,-1620],[32,1650,2370,-1680],[18,4920,5310,-1680],[79,5310,6120,-1680],[81,0,480,-1800],[42, -1260,1650,-1800],[86,2370,3252,-1800],[12,3252,4050,-1800],[55,4050,4920,-1800],[60,6480,7680,-1800],[43,7680,8400,-1800],[81,8400,8640,-1800],[81,270,480,-1824],[42,0,1260,-1980],[17,2760,4920,-1980],[2,4920,6480,-1980],[52,1260,2760,-2040],[57,0,8640,-2160]],da,na,Da=function(a,b,c,d){this.symbol=a;this.name=b;this.ra1875=c;this.dec1875=d};d.Constellation=function(a,b){if(-90>b||90a&&(a+=24);da||(da=d.Rotation_EQJ_EQD(new D(new Date(Date.UTC(1875, -0,1,12)))),na=new D(0));a=new ba(a,b,1);a=d.VectorFromEquator(a,na);a=d.RotateVector(da,a);a=d.EquatorFromVector(a);b=10/240;for(var c=b/15,e=$jscomp.makeIterator(Ca),g=e.next();!g.done;g=e.next()){g=g.value;var k=g[1]*c,h=g[2]*c;if(g[3]*b<=a.dec&&k<=a.ra&&a.rab||90a&&(a+=24);da||(da=d.Rotation_EQJ_EQD(new D(-45655.74141261017)), +na=new D(0));a=new ba(a,b,1);a=d.VectorFromEquator(a,na);a=d.RotateVector(da,a);a=d.EquatorFromVector(a);b=10/240;for(var c=b/15,e=$jscomp.makeIterator(Ca),g=e.next();!g.done;g=e.next()){g=g.value;var k=g[1]*c,h=g[2]*c;if(g[3]*b<=a.dec&&k<=a.ra&&a.ra