# NOT RUN {
# Load required libraries
library(ImageFusion)
library(raster)
# Get filesnames of high resolution images
landsat <- list.files(
system.file("landsat/filled",
package = "ImageFusion"),
".tif",
recursive = TRUE,
full.names = TRUE
)
# Get filesnames of low resolution images
modis <- list.files(
system.file("modis",
package = "ImageFusion"),
".tif",
recursive = TRUE,
full.names = TRUE
)
#Select the first two landsat images
landsat_sel <- landsat[1:2]
#Select some corresponding modis images
modis_sel <- modis[1:12]
# Create output directory in temporary folder
out_dir <- file.path(tempdir(),"Outputs")
if(!dir.exists(out_dir)) dir.create(out_dir, recursive = TRUE)
#Run the job, fusing two images
fitfc_job(input_filenames = c(landsat_sel,modis_sel),
input_resolutions = c("high","high",
"low","low","low",
"low","low","low",
"low","low","low",
"low","low","low"),
input_dates = c(68,77,68,69,70,71,72,73,74,75,76,77,78,79),
pred_dates = c(71,79),
pred_filenames = c(file.path(out_dir,"fitfc_71.tif"),
file.path(out_dir,"fitfc_79.tif"))
)
# remove the output directory
unlink(out_dir,recursive = TRUE)
# }
Run the code above in your browser using DataLab