if (FALSE) {
## DEPENDING ON HARDWARE, THIS PROCESS CAN BE HIGHLY TIME CONSUMING##
## Testing with an NDVI spatRast from Central Chile, h = 2##
# Load data
# SpatRaster
library(terra)
f <- system.file("extdata/MegaDrought_spatRast.rda", package = "npphen")
MegaDrought <- readRDS(f)
# Dates
data("modis_dates")
# Making the LSP output raster, n bands = 23
# Define the number of cores to be use. In this example we use 1
nc1 <- 1
PhenMap(
s = MegaDrought, dates = modis_dates, h = 2,
frequency = "16-days", nCluster = nc1, outname = "phen_MD.tif",
datatype = "INT2S", rge = c(0, 10000)
)
# map1 <- rast("phen_MD.tif")#run only for load phenology brick
# plot(map1)
## Testing with an NDVI spatRast from the Atacama Desert, Northern Chile, h=2 ##
# Load data
SpatRaster
f <- system.file("extdata/Bdesert_spatRast.rda", package = "npphen")
Bdesert <- readRDS(f)
# Dates
data("modis_dates")
# Making the LSP output raster, n bands = 23
# Define the number of cores to be use. In this example we use 1
nc1 <- 1
PhenMap(
s = Bdesert, dates = modis_dates, h = 2,
frequency = "16-days", nCluster = 1, outname = "phen_BD.tif",
datatype = "INT2S", rge = c(0, 10000)
)
# map2 <- rast("phen_BD.tif") #run only for loading the multiband LSP spatRaster
# plot(map2)
}
Run the code above in your browser using DataLab