if (FALSE) {
## DEPENDING ON HARDWARE, THIS PROCESS CAN BE HIGHLY TIME CONSUMING##
## Testing with the MegaDrought_stack from Central Chile (NDVI),
# showing extreme negative anomalies (browning)##
# Load data
# SpatRaster
library(terra)
f <- system.file("extdata/MegaDrought_spatRast.rda", package = "npphen")
MegaDrought <- readRDS(f)
# Dates
data("modis_dates")
# Define the number of cores to be use. In this example we use 1
nc1 <- 1
ExtremeAnoMap(
s = MegaDrought, dates = modis_dates, h = 2, refp = c(1:423),
anop = c(884:929), rfd = 0.9, output = "both", nCluster = nc1, outname = "anomRFD_MD.tif",
datatype = "INT2S", rge = c(0, 10000)
)
# map_an1 <- rast("anomRFD_MD.tif") # run only for load anomaly brick
# plot(map_an1)
## Testing with the Bdesert_stack from the Atacama Desert, Northern Chile (NDVI),
# showing extreme positive anomalies (greening)##
# Load data
# SpatRaster
f <- system.file("extdata/Bdesert_spatRast.rda", package = "npphen")
Bdesert <- readRDS(f)
# Dates
data("modis_dates")
# Define the number of cores to be use. In this example we use 1
nc1 <- 1
ExtremeAnoMap(
s = Bdesert, dates = modis_dates, h = 2, refp = c(1:423),
anop = c(723:768), rfd = 0.9, output = "both", nCluster = nc1, outname = "anomRFD_BD.tif",
datatype = "INT2S", rge = c(0, 10000)
)
# map_an1 <- rast("anomRFD_BD.tif") # run only for load anomaly brick
# plot(map_an1)
}
Run the code above in your browser using DataLab