View source: R/dist.reg.analysis.R
dist.reg.map | R Documentation |
Continuous vegetation change detection
dist.reg.map(s, dates, rfd, dstrb_thr, rgrow_thr, cdates, nCluster, outname,
datatype)
s |
SpatRaster of anomalies and their likelihood created with |
dates |
The julian dates for each scene in the time series brick. 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). |
nCluster |
Numeric. Number of CPU's to be used for the job. |
outname |
Character vector with the output path and filename with extension or only the filename and extension if work directory was set. More information: See writeRaster |
datatype |
Character vector that determines the interpretation of values written to disk. More information: See |
The output will consist of a SpatRaster with 16 bands: Band1=disturbance detection; Band2=corresponding anomalies band 1; Band3=regrowth detection; Band4=corresponding anomalies band 3; Band5= 2nd disturbance detection for data points that had a previous disturbance and regrowth; Band 6 etc.
Roberto O. Chávez, Mathieu Decuyper
dist.reg
## 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"))
## Disturbance/regrowth calculation
# checking availiable cores and leave one free
nc1 <- parallel::detectCores() - 1
ano.rfd.st <- rast("YourDirectory/MDD_AnomalyLikelihood.tif") # Load in the anomaly-rfd brick that you created
dist.reg.map(
s = ano.rfd.st, dates = MDD_dates, rfd = 0.95, dstrb_thr = 1, rgrow_thr = 730,
nCluster = nc1, cdates = 3, outname = "YourDirectory/ChangeMap.tif", datatype = "INT2S"
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.