aazuspan / wxee

A Python interface between Earth Engine and xarray for processing time series data
https://wxee.readthedocs.io/en/latest/
MIT License
206 stars 15 forks source link

Use regridding to handle leap day climatologies #6

Closed aazuspan closed 1 year ago

aazuspan commented 3 years ago

Currently, running climatology_dayofyear groups days by Julian date. In a leap year, all days after February 29 will be pushed back one Julian day, so the climatological day-of-year 365 would represent December 31 in non-leap years and December 30 in leap years, for example. Day 366 would always represent December 31, but would be aggregated from 1/4 as many days as other days of the year.

Tools like Ferret handle this by re-gridding all years into 365 steps regardless of leap days (Reference 1, Reference 2).

Regridding may not be a practical solution in GEE, but it should be considered. If the current solution is kept, the docs should be updated to make that distinction clear.

aazuspan commented 3 years ago

The climatology_mean_dayofyear docstring was updated by 9491947e4624d95532191b649d124082799b5da8 to add a note on how leap days are currently handled. I'll leave this open while I consider re-gridding.

aazuspan commented 1 year ago

Closing this for now. I think re-gridding will be a substantial performance hit for all users while providing a very minor benefit for a few users, so I don't currently plan on implementing it.