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

Calculation of datetime to be unified in the future #33

Closed
pwolfram opened this issue Oct 25, 2016 · 5 comments
Closed

Calculation of datetime to be unified in the future #33

pwolfram opened this issue Oct 25, 2016 · 5 comments
Labels

Comments

@pwolfram
Copy link
Contributor

Eventually, the timeSeriesStats AM for both ocean and ice will have xtime_start and xtime_end in their output files. For now, this is only true for MPAS-O, which is the reason why there is logical branching via https://github.com/pwolfram/mpas_xarray/blob/master/mpas_xarray/mpas_xarray.py#L105 to modify daysSinceStartOfSim.

cc @milenaveneziani

@pwolfram pwolfram changed the title mpas_xarray: Calculation of datetime to be unified in the future Calculation of datetime to be unified in the future Oct 25, 2016
@pwolfram pwolfram added the bug label Oct 25, 2016
@xylar
Copy link
Collaborator

xylar commented Nov 25, 2016

I have a solution to this issue in the following branch:
https://github.com/xylar/MPAS-Analysis/tree/fix_time_series_subset

I would like to also address #45 (allowing time-series analysis over a subset of the data) in this branch before making a PR unless there are objections. As @pwolfram pointed out, the two issues are related, which is why I ended up needing to solve this issue before I could get to #45.

@xylar
Copy link
Collaborator

xylar commented Nov 25, 2016

By the way, I think the default start date used to compute dates using some variant on daysSinceStartOfSim is incorrect:
https://github.com/MPAS-Dev/MPAS-Analysis/blob/develop/mpas_analysis/shared/mpas_xarray/mpas_xarray.py#L123
If you start from 12/31/1849 and add daysSinceStartOfSim, you only end up at 01/01/1850 (which should be the start date) after one day of simulation (daysSinceStartOfSim = 1):
https://github.com/MPAS-Dev/MPAS-Analysis/blob/develop/mpas_analysis/shared/mpas_xarray/mpas_xarray.py#L165

I think this is a bug and I have fixed it in the branch above by using 01/01/1850 as the reference date.

@xylar
Copy link
Collaborator

xylar commented Nov 25, 2016

I changed my mind and did a PR (#46) specifically for the bug mentioned above since it's a non-bit-for-bit change. I'll probably also submit a separate fix for this issue and for #45 because that, too, will be cleaner.

@pwolfram
Copy link
Contributor Author

pwolfram commented Dec 9, 2016

@xylar, is there anything outstanding on this issue? Otherwise, I think we can close it.

@xylar
Copy link
Collaborator

xylar commented Dec 9, 2016

Addressed by #47.

@xylar xylar closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants