wxee.time_series.TimeSeries.interpolate_time

TimeSeries.interpolate_time(time: Date, method: str = 'linear') Image[source]

Use interpolation to synthesize data at a given time within the time series. Based on the interpolation method chosen, a certain number of images must be present in the time series before and after the target date.

Nearest and linear interpolation require 1 image before and after the selected time while cubic interpolation requires 2 images before and after the selected time.

Parameters:
  • date (ee.Date) – The target date to interpolate data at. This must be within the time series period.

  • method (str, default linear) – The interpolation method to use, one of “nearest”, “linear”, or “cubic”.

Returns:

Data interpolated to the target time from surrounding data in the time series.

Return type:

ee.Image

Examples

>>> ts = wxee.TimeSeries("IDAHO_EPSCOR/GRIDMET")
>>> target_date = ee.Date("2020-09-08T03")

Interpolate weather data at the target date using cubic interpolation.

>>> filled = ts.interpolate(target_date, "cubic")