diff --git a/docs/source/whatsnew.rst b/docs/source/whatsnew.rst index 16ce46c..d2c7eeb 100644 --- a/docs/source/whatsnew.rst +++ b/docs/source/whatsnew.rst @@ -14,6 +14,8 @@ Changed ^^^^^^^ * matplotlib is now an optional ``doc`` dependency instead of a required dependency. (:pull:`146`) +* Add support for correctly handling sub-second timestamp resolution in + :py:func:`solposx.solarposition.usno`. (:issue:`156`, :pull:`157`) Added ^^^^^ diff --git a/src/solposx/solarposition/usno.py b/src/solposx/solarposition/usno.py index c730ed3..3628da5 100644 --- a/src/solposx/solarposition/usno.py +++ b/src/solposx/solarposition/usno.py @@ -85,9 +85,7 @@ def usno(times, latitude, longitude, *, delta_t=67.0, gmst_option=1): d = asind(sind(e) * sind(L)) # JD_0 is the Julian date of the previous midnight (0h) UT1 - midnight = pd.DatetimeIndex( - [t.replace(hour=0, minute=0, second=0) for t in times_utc] - ) + midnight = times_utc.normalize() # Convert times_utc to midnight JD_0 = midnight.to_julian_date()