[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sts_to_tplot uses datetime objects with timezones #844

Open
jameswilburlewis opened this issue Apr 26, 2024 · 0 comments
Open

sts_to_tplot uses datetime objects with timezones #844

jameswilburlewis opened this issue Apr 26, 2024 · 0 comments
Labels
deprecated enhancement New feature or request pytplot Issues involving the pytplot package refactoring

Comments

@jameswilburlewis
Copy link
Contributor

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.

@jameswilburlewis jameswilburlewis added enhancement New feature or request pytplot Issues involving the pytplot package refactoring deprecated labels Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecated enhancement New feature or request pytplot Issues involving the pytplot package refactoring
Projects
None yet
Development

No branches or pull requests

1 participant