-
Notifications
You must be signed in to change notification settings - Fork 8
Add a new function to compute monthly averages #94
Conversation
remove duplicate call to _get_weights_and_dims
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alperaltuntas, @matt-long, as a preliminary review comment, I was wondering if it would be worth exploring the usage of resample with cftime index as it's been implemented in pydata/xarray#2593?
I will add more comments for the rest of the PR tomorrow morning.
@alperaltuntas, have you looked into @andersy005's suggestion? I think the new resample capability on CFTimeIndex could greatly simplify this type of application. |
@matt-long, @andersy005, I'll look into it. Thanks. |
One think to keep in mind is an ability to correctly handled missing values that vary in time. |
@alperaltuntas, I am sorry I deleted the |
Checklist
Fixes: #55
Adds a new function to compute monthly averages from a given dataset that has more frequent data, e.g., 5 day means.
Summary of what the function does:
Note 1: Parts of the function may be (unnecessarily) complicated, so a code review may perhaps be helpful.
Note 2: The existing monthly climatology function (compute_mon_climatology) may be rewritten to call this new function (compute_mon_averages) to compute the averages, and then to compute the correct climatology (pretty easily).
Note 3: This is a draft pull request for now, since I haven't tested it thoroughly. Let me know any issues you notice/encounter.
To test this function, you may run the following on cheyenne: