From 6b3411e1f1453376ebcc10282534e7021fa3d141 Mon Sep 17 00:00:00 2001 From: "Michael J. Roberts" Date: Wed, 24 Apr 2024 17:05:25 +0100 Subject: [PATCH] fix: amend get_greenwhich_sidereal_time() to correctly round microseconds in @observerly/celerity. fix: amend get_greenwhich_sidereal_time() to correctly round microseconds in @observerly/celerity. --- src/celerity/temporal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/celerity/temporal.py b/src/celerity/temporal.py index bd9a01c..2d7f54f 100644 --- a/src/celerity/temporal.py +++ b/src/celerity/temporal.py @@ -75,7 +75,12 @@ def get_greenwhich_sidereal_time(date: datetime) -> float: T_0 += 24 # Convert the UTC time to a decimal fraction of hours: - UTC = (date.microsecond / 1e6) + date.second / 60 + date.minute / 60 + date.hour + UTC = ( + (date.microsecond / 3.6e9) + + (date.second / 3600) + + (date.minute / 60) + + date.hour + ) A = UTC * 1.002737909