interp_calendar
- UnitsAwareDataArray.interp_calendar(target: pd.DatetimeIndex | CFTimeIndex | DataArray, dim: str = 'time') Self
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:
target (DataArray or DatetimeIndex or CFTimeIndex) – The target time coordinate of a valid dtype (np.datetime64 or cftime objects)
dim (str) – The time coordinate name.
- Returns:
The source interpolated on the decimal years of target,
- Return type:
DataArray