georgemilosh / Climate-Learning

How to predict extreme events in climate using rare event algorithms and modern tools of machine learning
https://georgemilosh.github.io/Climate-Learning/
MIT License
19 stars 5 forks source link

Leap years #69

Open AlessandroLovo opened 1 year ago

AlessandroLovo commented 1 year ago

ERA data has leap years, and right now we select data based on the time.dt.dayofyear This means that the 1st of june has two different dayofyear depending on leap year or not

AlessandroLovo commented 1 year ago

The current fix is adapting the data (xr.DataArray) by doing

new_da = old_da.convert_calendar('noleap')