# NOT RUN {
path <- system.file("extdata", package = "satellite")
files <- list.files(path, pattern = glob2rx("LC8*.tif"), full.names = TRUE)
sat <- satellite(files)
# }
# NOT RUN {
## using 'satellite' object
sat_ps <- panSharp(sat)
par(mfrow = c(1, 2))
plot(getSatDataLayer(sat_ps, "B002n"), main = "raw", legend = TRUE)
plot(getSatDataLayer(sat_ps, "B002n_PAN_sharpend"),
main = "pan-sharpened", legend = TRUE)
dev.off()
# }
# NOT RUN {
## using 'RasterLayer' object
rst_b001n <- getSatDataLayer(sat, "B001n")
rst_panch <- getSatDataLayer(sat, getSatBCDEFromType(sat, type = "PCM"))
rst_b001n_ps <- panSharp(rst_b001n, rst_panch)
par(mfrow = c(1, 2))
plot(rst_b001n, main = "raw", legend = FALSE)
plot(rst_b001n_ps, main = "pan-sharpened", legend = FALSE)
dev.off()
# }
Run the code above in your browser using DataLab