deafrica_tools.temporal.xr_phenology

deafrica_tools.temporal.xr_phenology(da, stats=['SOS', 'POS', 'EOS', 'Trough', 'vSOS', 'vPOS', 'vEOS', 'LOS', 'AOS', 'ROG', 'ROS'], method_sos='median', method_eos='median', complete='fast_complete', smoothing=None, show_progress=True)

Obtain land surface phenology metrics from an xarray.DataArray containing a timeseries of a vegetation index like NDVI.

last modified June 2020

Parameters
  • da (xarray.DataArray) – DataArray should contain a 2D or 3D time series of a vegetation index like NDVI, EVI

  • stats (list) –

    list of phenological statistics to return. Regardless of the metrics returned, all statistics are calculated due to inter-dependencies between metrics. Options include:

    • SOS = DOY of start of season

    • POS = DOY of peak of season

    • EOS = DOY of end of season

    • vSOS = Value at start of season

    • vPOS = Value at peak of season

    • vEOS = Value at end of season

    • Trough = Minimum value of season

    • LOS = Length of season (DOY)

    • AOS = Amplitude of season (in value units)

    • ROG = Rate of greening

    • ROS = Rate of senescence

  • method_sos (str) – If ‘first’ then vSOS is estimated as the first positive slope on the greening side of the curve. If ‘median’, then vSOS is estimated as the median value of the postive slopes on the greening side of the curve.

  • method_eos (str) – If ‘last’ then vEOS is estimated as the last negative slope on the senescing side of the curve. If ‘median’, then vEOS is estimated as the ‘median’ value of the negative slopes on the senescing side of the curve.

  • complete (str) – If ‘fast_complete’, the timeseries will be completed (gap filled) using fast_completion(), if ‘linear’, time series with be completed using da.interpolate_na(method=’linear’)

  • smoothing (str) – If ‘wiener’, the timeseries will be smoothed using the scipy.signal.wiener filter with a window size of 3. If ‘rolling_mean’, then timeseries is smoothed using a rolling mean with a window size of 3. If set to ‘linear’, will be smoothed using da.resample(time=’1W’).interpolate(‘linear’)

Returns

Dataset containing variables for the selected phenology statistics

Return type

xarray.Dataset