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

PET calculation fixed 365-day calendar #483

Open
chrisbanze opened this issue Dec 12, 2022 · 2 comments
Open

PET calculation fixed 365-day calendar #483

chrisbanze opened this issue Dec 12, 2022 · 2 comments

Comments

@chrisbanze
Copy link

Calculating PET after thornthwaite works great except for one important detail. Having a dataset that uses a fixed 365-day calendar, there is currently no option to do the correct calculation defining all years as no-leap years.

Adding an argument for PET calculation to set the calendar to "gregorian" or in my case "365-days" would be ideal.

I have changed the code in eto.py to not check for leap years and that works, but it would be greatly appreciated if implemented into the package, so that it can be easily shared.

@monocongo
Copy link
Owner

Thanks, @chrisbanze

If you want to submit a PR of your code with this option enabled then I'll certainly consider it for inclusion in the main branch. I assume you're thinking of a new CLI argument such as --use_gregorian which would only be applicable/relevant if we're computing daily values? A corresponding function argument should be added across all the functions that compute daily values, for consistency (i.e. it should work the same for all the indices and not just PET).

@WeatherGod
Copy link
Contributor

Personally, I'd first auto-detect it from the attributes of the time dimension, since xarray has all sorts of utilities for knowing what calendar is being used.

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

No branches or pull requests

3 participants