Open-EO / openeo-processes-dask

Python implementations of many OpenEO processes, dask-friendly by default.
Apache License 2.0
19 stars 14 forks source link

`aggregate_temporal_period` missing some predefined periods #27

Open clausmichele opened 1 year ago

clausmichele commented 1 year ago

The current implementation is missing some temporal periods which are not yet defined, since they are not pandas standard. Additionally, if an openEO period is being selected and it's not present in the python code, there's no warning and it will raise an Exception due to the frequency variable missing.

Some good examples for Pandas periods: https://regenerativetoday.com/a-complete-guide-to-time-series-analysis-in-pandas/

openEO process definition: https://processes.openeo.org/#aggregate_temporal_period

Missing openEO periods:

    dekad: Ten day periods, counted per year with three periods per month (day 1 - 10, 11 - 20 and 21 - end of month). The third dekad of the month can range from 8 to 11 days. For example, the fourth dekad is Feb, 1 - Feb, 10 each year.
    tropical-season: Six month periods of the tropical seasons (November - April, May - October).
    decade: Ten year periods ([0-to-9 decade](https://en.wikipedia.org/wiki/Decade#0-to-9_decade)), from a year ending in a 0 to the next year ending in a 9.
    decade-ad: Ten year periods ([1-to-0 decade](https://en.wikipedia.org/wiki/Decade#1-to-0_decade)) better aligned with the anno Domini (AD) calendar era, from a year ending in a 1 to the next year ending in a 0.

an idea could be to just define custom periods based on the inputs and re use aggregate_temporal.

LukeWeidenwalker commented 1 year ago

Agreed, this is an implementation gap from before that's never been addressed for lack of bandwidth - using pandas custom periods like you suggest sounds like a good idea to me! Would definitely be good to support all the predefined options.