Open C15H24 opened 2 weeks ago
Hi! We can add this indeed. Just a couple caveats:
.resample(time="W")
and .groupby("time.week")
is not yet compatible with cf-time (https://github.com/pydata/xarray/discussions/6375).resample(time="W").mean()
the days included in week1 can vary from year to year, e.g.
# days included in week 1 between 2000 and 2002
2000: [Jan 3, Jan 9]
2001: [Jan 1, Jan 7]
2002: [Dec31 2001, Jan 6]
...
sometimes Jan 1rst is not included, sometimes Week1 includes days from december, etc. I'm curious to know if this is what you envision when you consider weekly groupings.
Yes, I envision strict adherence to ISO-8601 weeks :) So, looks like it would need to be implemented upstream (cftime.datetime) first?
Thank you for your response
Addressing a Problem?
No response
Potential Solution
the function standardized_precipitation_index accepts freq = 'W' as signifying the nature of the groupings is weekly - and any downstream adjustments that would need to be made to validate the output
Additional context
Many projects in government are beginning to operate and produce products on a weekly basis
Contribution
Code of Conduct