SpatioTemporal / pystare

The Python interface for the SpatioTemporal Adaptive Resolution Encoding (STARE), a unified indexing for geolocated data.
https://pystare.readthedocs.io/en/latest/
12 stars 2 forks source link

from_julian_date() throws SpatialException for dates >= "2022-12-31 00:00" #120

Closed NiklasPhabian closed 1 year ago

NiklasPhabian commented 1 year ago
import astropy.time, pystare, datetime

dt = datetime.datetime(2023,1,3)
dt_astro = astropy.time.Time(dt, scale='utc', format='datetime')

# This works fine:
pystare.tiv_from_datetime(dt) 

# This fails:
pystare.from_julian_date(dt_astro.jd1, dt_astro.jd2, scale='utc', forward_res=48, reverse_res=48)
terminate called after throwing an instance of 'SpatialException'
  what():  In TemporalIndex::fromJulianUTC, eraUtctai(...) failure.
Aborted (core dumped)
NiklasPhabian commented 1 year ago

All is fine up to 2022-12-30 23:59

NiklasPhabian commented 1 year ago
NiklasPhabian commented 1 year ago

a little more isolated:

import astropy.time, pystare, datetime, numpy

dt = datetime.datetime(2023,1,3)
dt_astro = astropy.time.Time(dt, scale='utc', format='datetime')

pystare._core._from_JulianUTC(numpy.array([dt_astro.jd1]), numpy.array([dt_astro.jd2]), 48, 48)
michaelleerilee commented 1 year ago

This is corrected in STARE Release 1.2.7.

For pystare: update STARE and the existing pystare should work. Though in situations where the installation is statically linked, a re-linking may need to occur.