sts_to_tplot uses datetime objects with timezones #844
Labels
deprecated
enhancement
New feature or request
pytplot
Issues involving the pytplot package
refactoring
When loading data from CDFs or NetCDFs, timestamps are eventually converted to np.datetime64 objects with nanosecond precision. sts_to_tplot uses timezone-aware Python datetime objects to represent timestamps, and I believe store_data takes them as-is, rather than converting to np.datetime64 objects (as would happen if you just passed floating-point Unix times).
This is likely to cause warnings if these tplot variables are passed to the pytplot interpolation routines that operate directly on the data_quants xarray objects -- first, because xarray interpolation of timezone-aware datetimes is deprecated, and also because the datetimes have microsecond rather than nanosecond precision.
It would be better to use np.datetime64 objects here, as we do for CDFs and NetCDFs.
MAVEN looks like the only mission that would be affected.
The text was updated successfully, but these errors were encountered: