dist.reg.map: Avocado algorithm - Wall-to-wall map version

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

dist.reg.mapR Documentation

Avocado algorithm - Wall-to-wall map version

Description

Continuous vegetation change detection

Usage

dist.reg.map(s, dates, rfd, dstrb_thr, rgrow_thr, cdates, nCluster, outname,
  datatype)

Arguments

s

SpatRaster of anomalies and their likelihood created with PLUGPhenAnoRFDMapPLUS

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 writeRaster

Value

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.

Author(s)

Roberto O. Chávez, Mathieu Decuyper

See Also

dist.reg

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"))

## 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)

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