ImageFusion install failed
I tried to install the package, it failed. Can you help me? Thank you very much!
OS: win10
R: 4.2.1

Hi, thanks for letting me know! The package had not yet been updated to work with R 4.2, Could you try again and let me know if it is fixed?
Hi, thanks for letting me know! The package had not yet been updated to work with R 4.2, Could you try again and let me know if it is fixed?
Thank you for your update! The install seems ok, then I will try more. Thank you for your help!

I tried the test code, it failed. `# 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 )
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 fusion on the entire time series
imagefusion_task(filenames_high = landsat, dates_high = c(68,77,93,100), filenames_low = modis, dates_low = 68:93, dates_pred = c(65,85,95), out_dir = out_dir)
remove the output directory
unlink(out_dir,recursive = TRUE)`

looking forward your reply, thank you!
I tried to use the monthly synthesized GIMMS (1982-2015) and MODIS (2001-2021) NDVI data for data fusion, but failed. The code and error are as follows:
imagefusion_task( filenames_high = dir_high, dates_high = 229:480, #2001-2021逐月,参考alldates中的序号 filenames_low = dir_lowrs, dates_low = 1:408, #1982-2015年逐月 dates_pred = 1:408, out_dir = "./gimmsMonthMaxPredicted/", method = 'estarfm' )

Hi, it seems that after the update, there are difficulties finding the proj library. Could you try running this code (preferably before loading any packages) and let me know if this changes things?
path_to_proj <- file.path(Sys.getenv("R_LIBS_USER"),"Imagefusion/proj")
Sys.setenv(PROJ_LIB=path_to_proj)
Thanks!
Hi, it seems that after the update, there are difficulties finding the proj library. Could you try running this code (preferably before loading any packages) and let me know if this changes things?
path_to_proj <- file.path(Sys.getenv("R_LIBS_USER"),"Imagefusion/proj") Sys.setenv(PROJ_LIB=path_to_proj)Thanks!


I runned that code,and then runned the test code, it still failed. Thank you!
Thanks for the feedback! It would be interesting to know if there is actually a Data base File called "proj" (~8MB) under the path_to_proj. If so, then the issue is probably just some broken path which we can fix relatively easily. Could you please check if the file exists?
Thanks for the feedback! It would be interesting to know if there is actually a Data base File called "proj" (~8MB) under the path_to_proj. If so, then the issue is probably just some broken path which we can fix relatively easily. Could you please check if the file exists?
The file does not exist.

Apologies for the delay. I have updated the package to try and find the correct proj and gdal paths when the package is loaded.
Could you try reinstalling with:
devtools::install_github("JohMast/ImageFusion") and then check if you can run the examples?
If it still does not work, it would be interesting to know which versions of R, sf, terra, and possibly rgdal you have installed. Thanks!
Thank you for your reply! The test code run successful!
I use the GIMMS NDVI data from 1982 to 2015 and the MODIS NDVI data from 2001 to 2021 for fusion. The error will be reported, as shown in the figure. Could you tell me why? Thank you!
imagefusion_task( filenames_high = dir_high, dates_high = 229:480, #2001-2021 monthly MODIS NDVI filenames_low = dir_lowrs, dates_low = 1:408, #1982-2015 year monthly gimms NDVI dates_pred = 1:408, out_dir = "./gimmsMonthMaxPredicted/", method = 'estarfm' )

Great! Thanks for your help in troubleshooting this.
About the NDVI time series: Could you run the same code with verbose = TRUE in imagefusion_task and post the output? That should give us some clues.
Ah, i think the issue is that you are inputting two time series which are without gaps, but overlapping. So we have two cases which do not produce a valid job, causing the function to fail:
- Low is available, but High is not (dates 1 to 228). In this case, fusion cannot be performed with ESTARFM, which requires two pairs.
- Both Low and High are available (dates 228 to 408). No fusion necessary, as highly resolved images already exist.
I will add a check to catch such cases in the future, and return more meaningful error messages.
In your situation, if you seek to extend the high-resolution timeseries backwards, you may want to consider STARM or FITFC which would be able to predict from only a single pair, by using method="starfm and singlepair_mode = "mixed.
Ah, i think the issue is that you are inputting two time series which are without gaps, but overlapping. So we have two cases which do not produce a valid job, causing the function to fail:
- Low is available, but High is not (dates 1 to 228). In this case, fusion cannot be performed with ESTARFM, which requires two pairs.
- Both Low and High are available (dates 228 to 408). No fusion necessary, as highly resolved images already exist.
I will add a check to catch such cases in the future, and return more meaningful error messages.
In your situation, if you seek to extend the high-resolution timeseries backwards, you may want to consider STARM or FITFC which would be able to predict from only a single pair, by using
method="starfmandsinglepair_mode = "mixed.
Thank you for your reply! I runned my data but my PC memory is not enough. Thank you for your help!