This code is a python reimplementation of R package GreenBrown. Detailed API/tutorial please see Example.ipynb . It contains a range of R packages and methods reimplement like GeenBrown bfast, Strucchange.
For now, It could be used to
- Detect Annual, Seasonal, and Short Structure change and Breakpoints based on OLS-SUM/differential method (or Differential or Recursive)
- Execute trend test like MK. Sctest
- Seasonal Decomposition: 1.Yt=Tt+An+Tm+St+rem 2. Yt=Tt+St+Res
- Preprocess and Spatial Statistics according to Annual Data.
In the Future
- Finished some works in library
- More functions, More Trend Tests
- Design for Anomaly Classification
The package has been developed at the Max Planck Institute for Biogeochemistry, Jena, Germany in order to distribute the code of the following publications:
- Verbesselt, J., Hyndman, R., Newnham, G., & Culvenor, D. (2010). Detecting trend and seasonal changes in satellite image time series. Remote Sensing of Environment, 114, 106-115. DOI: 10.1016/j.rse.2009.08.014. DownLoad Paper
- Verbesselt, J., Hyndman, R., Zeileis, A., & Culvenor, D. (2010). Phenological change detection while accounting for abrupt and gradual trends in satellite image time series. Remote Sensing of Environment, 114, 2970-2980. DOI: 10.1016/j.rse.2010.08.003. DownLoad Paper
- Verbesselt, J., Zeileis, A., & Herold, M. (2013). Near real-time disturbance detection using satellite image time series, Remote Sensing of Environment. DOI: 10.1016/j.rse.2012.02.022. DownLoad Paper
- Forkel, M., Carvalhais, N., Verbesselt, J., Mahecha, M., Neigh, C., Reichstein, M., 2013. Trend Change Detection in NDVI Time Series: Effects of Inter-Annual Variability and Methodology. Remote Sensing 5, 2113–2144. doi:10.3390/rs5052113
- Forkel, M., Migliavacca, M., Thonicke, K., Reichstein, M., Schaphoff, S., Weber, U., Carvalhais, N., 2015. Codominant water control on global interannual variability and trends in land surface phenology and greenness. Glob Change Biol 21, 3414–3435. doi:10.1111/gcb.12950
import numpy as np
import matplotlib.pyplot as plt
from greenbrown.utils import *
import greenbrown as gb
Yt = load_example() Tt = Yt.index
trd3=gb.AnomalyDetection(Yt,Tt)
trd3.summary()
trd3.plot()
ATs,Am,An,Sts,St_bp,Rem=trd3.values
tif = load_tif_sample()[20:24,20:24,:]
tif_index = pd.date_range('2000', periods=16, freq='Y')
tif = interpolate_3d(tif)
Ss = gb.Spatial_Statistcs(tif,tif_index)
Ss.excute()
Ss.plot()
# Ss.summary()
bst=gb.bfast.BFAST(Yt,Tt,max_iter=1)
bst.plot()
bst.summary()
yt,tt,st,rt=bst.composition
Output: See Example.juynb
trd=gb.TrendAAT(Yt,Tt,0.15,0.05)
trd.summary()
trd.plot()
ATs,Am,An=trd.values
Output: See Example.juynb
trd2=gb.TrendSST(Yt,Tt)
trd2.summary()
trd2.plot()
STs,St_bp=trd2.values
Output: See Example.juynb