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

Restore original datetime metadata upon saving output #94

Closed
spencerkclark opened this issue Oct 13, 2016 · 5 comments
Closed

Restore original datetime metadata upon saving output #94

spencerkclark opened this issue Oct 13, 2016 · 5 comments

Comments

@spencerkclark
Copy link
Collaborator

Currently, if we encounter time dimensions referenced to a date prior to 1678-01-01, we automatically offset things internally such that the dates aospy sees all begin at 1900-01-01 (this is to account for restrictions in pandas). When we save computational results to netCDF files, however, we do not currently restore datetime metadata to match the way things were in the initial run (so output netCDF files look as though things started in 1900 as well). This may amount to simply saving the initial units attribute of the time variable when reading in the file, and resetting it to the initial value when we save data.

In addressing this issue I think we should also consider changing the offset reference date to 1678-01-01 to allow the maximum available pandas / np.datetime64 compatible time range.

@spencerahill
Copy link
Owner

In addressing this issue I think we should also consider changing the offset reference date to 1678-01-01 to allow the maximum available pandas / np.datetime64 compatible time range.

This is addressed in #97.

But otherwise yes this would be good to implement and I doubt too difficult. Although since it's not urgent, maybe it's better to do as part of the Calc refactor, whenever we get to that portion of Calc.

@spencerahill
Copy link
Owner

@spencerkclark is this in place yet or no? Please close if yes.

@spencerahill
Copy link
Owner

@spencerkclark where do we currently stand on this? (I'm in the process of culling obsolete Issues as part of #206)

@spencerkclark
Copy link
Collaborator Author

@spencerahill it has not been resolved; it's something that would be nice to do, given our current workaround for dates pre-1678, but not necessarily super high priority. (It might be a low-hanging fruit though).

@spencerahill
Copy link
Owner

Cool, thanks. subset_ and raw_data_{start,end}_date are written to output netCDF files currently, but these alone can't be used to infer the original dates. Still I agree, should be relatively straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants