cdmt | R Documentation |
This is the main function of the package.
cdmt( sr_data, si_data, out_path = NULL, sr = NULL, si = NULL, years, cng_dir, th_const = 1.2, noise_rm = TRUE, cores = 1 )
sr_data |
character. Yearly surface reflectance data. Either the name of a |
si_data |
character. Yearly spectral indices. Either the name of a |
out_path |
character. The path where output rasters (in .tif format) will be saved. Folders are created recursively if they do not exist. If |
sr |
numeric vector. Layer indices (positive integers) of reflectance bands in each raster to be included in the time series. If |
si |
numeric vector. Layer indices (positive integers) of spectral indices in each raster to be included in the time series. If |
years |
numeric vector. Time interval (years) to be analysed. |
cng_dir |
numeric vector. Direction of change caused by a disturbance in each spectral band/index. Valid values are either 1 or -1. |
th_const |
numeric. Constant controlling the change threshold employed by the HiTS procedure during thresholding. Typical values are comprised in the interval [1, 1.4]. |
noise_rm |
logical. If |
cores |
positive integer. Number of CPU cores used during analysis. |
cdmt()
maps changes in spectral trends at the pixel level by analysing inter-annual Landsat time series.
Time series can include single or multiple spectral bands/indices, hereafter referred to as bands.
Impulsive noise, i.e. outliers in the time series, are removed through an iterative procedure.
One-year gaps in the time series are filled using either linear interpolation or extrapolation.
Input bands are SpatRaster
objects created by the terra package.
Changes in the intercept, slope or both of linear trends are detected using the High-dimensional Trend Segmentation (HiTS) procedure proposed by \insertCitemaeng2019adaptive;textualcdmt.
The HiTS procedure aims at detecting changepoints in a piecewise linear signal where their number and location are unknown.
A SpatRaster
containing the following layers.
EST |
Estimated values (one layer for each year and band). |
CPT |
Detected changepoints (one layer for each year and band). |
SLO |
Slope of the linear segments (one layer for each year and band). |
MAG |
Magnitude in absolute terms (one layer for each year and band). |
MAG_REL |
Magnitude in relative terms (one layer for each year and band). |
LEN |
Length of segments (one layer per year). |
CPT_ID |
Type of change (one layer per year). One of the following values: 101 (abrupt disturbance); 102 (abrupt greening); 201 (gradual disturbance); 202 (gradual greening); 9 (other change). |
TPA |
Impulsive noise (one layer per year). |
D_DUR |
Duration of disturbance (one layer per year). |
G_DUR |
Duration of greening (one layer per year). |
D_MAX |
Maximum disturbance change magnitude (in relative terms) throughout the time series (one layer per band). |
D_FST |
Change magnitude (in relative terms) associated with the first disturbance detected within the time series (one layer per band). |
G_MAX |
Maximum greening change magnitude (in relative tems) throughout the time series (one layer per band). |
WGTS |
Weights assigned to each band (one layer per band). |
D_MAX_MD |
Median among bands using values of |
D_FST_MD |
Median among bands using values of |
G_MAX_MD |
Median among bands using values of |
D_MAX_YR |
Year corresponding to |
D_FST_YR |
Year corresponding to |
G_MAX_YR |
Year corresponding to |
D_MAX_DR |
Duration of the disturbance corresponding to |
D_FST_DR |
Duration of the disturbance corresponding to |
G_MAX_DR |
Duration of the greening corresponding to |
D_MAX_ID |
Type of change ( |
D_FST_ID |
Type of change ( |
G_MAX_ID |
Type of change ( |
N_GAP |
Number of gaps in the time series, if any (single layer). |
N_TPA |
Number of years containing impulsive noise, if any (single layer). |
N_ITER |
Number of iterations performed by the impulsive noise filter (single layer). |
If a valid out_path
is provided, output rasters in *.tif format are directly written in the output folder.
Donato Morresi, donato.morresi@gmail.com
maeng2019adaptivecdmt
cdmt_int
library(cdmt) # Load raster data data(lnd_sr) data(lnd_si) lnd_sr <- terra::rast(lnd_sr) lnd_si <- terra::rast(lnd_si) # Process data rsout <- cdmt(sr_data = "lnd_sr", si_data = "lnd_si", years = 1985:2020, cng_dir = c(-1, -1, 1, 1), cores = 2 ) # Plot the maximum disturbance magnitude terra::plot(rsout[["D_MAX_MD"]])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.