🍾 Xarray is now 10 years old! 🎉

xarray.DataArray.interp_calendar

xarray.DataArray.interp_calendar#

DataArray.interp_calendar(target, dim='time')[source]#

Interpolates the DataArray to another calendar based on decimal year measure.

Each timestamp in source and target are first converted to their decimal year equivalent then source is interpolated on the target coordinate. The decimal year of a timestamp is its year plus its sub-year component converted to the fraction of its year. For example “2000-03-01 12:00” is 2000.1653 in a standard calendar or 2000.16301 in a “noleap” calendar.

This method should only be used when the time (HH:MM:SS) information of time coordinate is not important.

Parameters:
Returns:

DataArray – The source interpolated on the decimal years of target,