Open florianboergel opened 1 year ago
What SST data are you using? For testing purposes
It's a regional uncoupled ocean simulation using the atmospheric forcing of Schimanke and Meier (2012) https://cp.copernicus.org/articles/8/1419/2012/.
I will upload a small SST dataset today for testing.
I would probably prefer to detect the type of the DatetimeIndex and then choose between the 2 approaches based on that. As there's so much more that can go wrong with the apply_ufunc() approach, simply in term of changes to xarray and/or potentially the arguments passed not working for different examples. Time axis are always causing pain
I am currently using this package to analyze SST data from 950 to 1800. Hence, I need to use cftime objects. Without fixing possible errors with the calendar I came across a problem with the function
add_doy()
.I'd simply propose a new branch called cftime first that removes
and adds
One could also just catch the type of the DatetimeIndex and choose between those two methods. The problem with cftime objects is that they do not have the function
is_leap_year
.cftime.is_leap_year
only takes integers, therefore I needed to useapply_ufunc
.