dist.reg: Avocado algorithm - Single pixel version

View source: R/dist.reg.analysis.R

dist.regR Documentation

Avocado algorithm - Single pixel version

Description

Continuous vegetation change detection

Usage

dist.reg(x, dates, rfd, dstrb_thr, rgrow_thr, cdates)

Arguments

x

Vector of anomaly and likelihood time-series created in using PLUGPhenAnoRFDPLUS

dates

The julian dates for each scene in the time series. Should be in the following format: "YYYY-MM-DD"

rfd

The reference frequency distribution. Determines if an anomaly falls outside the 95 percent of the reference frequency distribution. For example a value that fall in a RDF >= 0.95, indicates that the detected anomaly belongs to the 5 percent of lowest values and is a potential disturbance/change.

dstrb_thr

sets a threshold (number of days) in which if a regrowth is detected within n days after a potential disturbance, then the candidate disturbance date is neglected.

rgrow_thr

sets a threshold (number of days) in which if a disturbance is detected within n days after a potential regrowth, then the candidate regrowth date is neglected.

cdates

Sets the number of consecutive data points for a change to be detected (minimum 2 and maximum 5 data points)

Value

The output will consist of a vector with 16 values: 1st value = year of disturbance detection; 2nd value = corresponding anomalies; 3rd=year of regrowth detection; 4th value = corresponding anomalies band 3; 5th value = 2nd disturbance detection for data points that had a previous disturbance and regrowth; 6th value etc.

Author(s)

Roberto O. Chavez, Mathieu Decuyper

See Also

dist.reg.map

Examples

## Not run: 
# Loading raster data
library(terra)
library(npphen)
MDD <- rast(system.file("extdata", "MDD_NDMI_1990_2020.tif", package = "AVOCADO"))
# load dates vector
load(system.file("extdata", "MDD_dates.RData", package = "AVOCADO"))
# load  reference forest data (output from PhenRef2d)
load(system.file("extdata", "MDD_forestReference.RData", package = "AVOCADO"))
## time series extraction for a single pixel
px <- vect(cbind(-69.265, -12.48))
plot(MDD[[1]])
plot(px, add = T)

# extract series
px_series <- as.numeric(terra::extract(MDD, px, ID = F))
plot(MDD_dates, px_series, type = "b")

## Anomaly calculation
anom_rfd <- PLUGPhenAnoRFDPLUS(x = px_series, phenref = MDD_fref, dates = MDD_dates, h = 2, anop = c(1:1063), rge = c(1, 10000))

## disturbance/regrowth analysis
dist.reg(x = anom_rfd, dates = MDD_dates, rfd = 0.95, dstrb_thr = 1, rgrow_thr = 730, cdates = 3)

## End(Not run)


MDecuy/AVOCADO documentation built on April 14, 2025, 5:30 a.m.