View source: R/dist.reg.analysis.R
dist.reg | R Documentation |
Continuous vegetation change detection
dist.reg(x, dates, rfd, dstrb_thr, rgrow_thr, cdates)
x |
Vector of anomaly and likelihood time-series created in using |
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) |
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.
Roberto O. Chavez, Mathieu Decuyper
dist.reg.map
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.