From 66b0efda5a74c8b85d6b045a643639d1532217e9 Mon Sep 17 00:00:00 2001 From: Don Cross Date: Sat, 22 Jun 2019 21:24:56 -0400 Subject: [PATCH] Python: CurrentTime() working. --- generate/template/astronomy.py | 3 ++- source/python/astronomy.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/generate/template/astronomy.py b/generate/template/astronomy.py index 4559784f..2ad565c5 100644 --- a/generate/template/astronomy.py +++ b/generate/template/astronomy.py @@ -5,6 +5,7 @@ import datetime _T0 = 2451545.0 _MJD_BASIS = 2400000.5 +_Y2000_IN_MJD = _T0 - _MJD_BASIS _DEG2RAD = 0.017453292519943296 _RAD2DEG = 57.295779513082321 _ASEC360 = 1296000.0 @@ -152,7 +153,7 @@ def _DeltaT(mjd): return _DT[c].dt + frac*(_DT[c+1].dt - _DT[c].dt) def _TerrestrialTime(ut): - return ut + _DeltaT(ut + Y2000_IN_MJD) / 86400.0 + return ut + _DeltaT(ut + _Y2000_IN_MJD) / 86400.0 class astro_time_t: def __init__(self, ut): diff --git a/source/python/astronomy.py b/source/python/astronomy.py index 1397276f..2c92bee6 100644 --- a/source/python/astronomy.py +++ b/source/python/astronomy.py @@ -5,6 +5,7 @@ import datetime _T0 = 2451545.0 _MJD_BASIS = 2400000.5 +_Y2000_IN_MJD = _T0 - _MJD_BASIS _DEG2RAD = 0.017453292519943296 _RAD2DEG = 57.295779513082321 _ASEC360 = 1296000.0 @@ -243,7 +244,7 @@ def _DeltaT(mjd): return _DT[c].dt + frac*(_DT[c+1].dt - _DT[c].dt) def _TerrestrialTime(ut): - return ut + _DeltaT(ut + Y2000_IN_MJD) / 86400.0 + return ut + _DeltaT(ut + _Y2000_IN_MJD) / 86400.0 class astro_time_t: def __init__(self, ut):