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

[FEATURE]: Make xwrf fall back to XTIME if Times is not included in WRF file #169

Closed
lpilz opened this issue Apr 25, 2024 · 1 comment · Fixed by #170
Closed

[FEATURE]: Make xwrf fall back to XTIME if Times is not included in WRF file #169

lpilz opened this issue Apr 25, 2024 · 1 comment · Fixed by #170
Labels
enhancement New feature or request

Comments

@lpilz
Copy link
Collaborator

lpilz commented Apr 25, 2024

Description

For now, the processing of WRF files which don't include the Times variable is not possible even though the data should also be available in the XTIME coordinate. I would propose that we fall back on the XTIME variable if the Times variable is not available.

Implementation

Add this to postprocess.py:_decode_times. Check if XTIME already is a datetime variable and if not, call the default xarray cf decoder.

Tests

Drop the Times variable from the raw dataset before .xwrf.postprocess() and compare both Time coordinates.

Questions

Is there anything we have to make transparent to the users? Like could there be floating-point inaccuracies which warrant a warning?

@lpilz
Copy link
Collaborator Author

lpilz commented Apr 25, 2024

I decided to just error if the XTIME is not a datetime dtype as it seemed unnecessarily complicated to implement the default xarray decoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant