ropensci / MODIStsp

An "R" package for automatic download and preprocessing of MODIS Land Products Time Series
https://docs.ropensci.org/MODIStsp
GNU General Public License v3.0
155 stars 50 forks source link

MODIStsp GUI issues #232

Closed caseylynnbrown closed 3 years ago

caseylynnbrown commented 3 years ago

Issue description I am having issues with the MODIStsp GUI connecting to my desktop path folders. I am able to successfully open MODIStsp GUI and select products and layers and the spatial and temporal options. However, I have not been able to load a spatial layers from file. Since I can manually select tiles, I could still work around this problem. However, I am unable to select an Output Folder to save my products. I cannot manually enter a file path and the "Browse" option does not work. Thank you for your help!

Reproducible example

## PLEASE DELETE AND WRITE YOUR OWN

##Since I am running the GUI, I do not have very much reproducible code. I have included the output from the following lines:
install.packages("MODIStsp")
MODIStsp()

Expected and actual behavior

> install.packages("MODIStsp")
Installing package into ‘\\fwstk/home/BrownCa1/My Documents/R/win-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cran.rstudio.com/bin/windows/contrib/4.0/MODIStsp_2.0.5.zip'
Content type 'application/zip' length 1814184 bytes (1.7 MB)
downloaded 1.7 MB

package ‘MODIStsp’ successfully unpacked and MD5 sums checked

> MODIStsp()
GDAL version in use: 3.0.4
Loading required package: shiny

Listening on http://127.0.0.1:6126

System information

# R version 4.0.3 (2020-10-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19041)

Matrix products: default

Random number generation:
 RNG:     Mersenne-Twister 
 Normal:  Inversion 
 Sample:  Rounding 

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] shiny_1.6.0    MODIStsp_2.0.5

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6           lattice_0.20-41      png_0.1-7            class_7.3-17         zoo_1.8-8           
 [6] assertthat_0.2.1     digest_0.6.27        mime_0.9             R6_2.5.0             e1071_1.7-4         
[11] httr_1.4.2           pillar_1.4.7         rlang_0.4.10         shinyalert_2.0.0     data.table_1.13.6   
[16] raster_3.4-5         jquerylib_0.1.3      shinyjs_2.0.0        stringr_1.4.0        htmlwidgets_1.5.3   
[21] compiler_4.0.3       httpuv_1.5.5         pkgconfig_2.0.3      base64enc_0.1-3      htmltools_0.5.1.1   
[26] gdalUtilities_1.1.1  mapedit_0.6.0        tidyselect_1.1.0     tibble_3.0.5         codetools_0.2-16    
[31] crayon_1.4.0         dplyr_1.0.3          later_1.1.0.1        sf_0.9-7             bitops_1.0-6        
[36] rappdirs_0.3.3       grid_4.0.3           jsonlite_1.7.2       xtable_1.8-4         lifecycle_0.2.0     
[41] DBI_1.1.1            magrittr_2.0.1       units_0.6-7          KernSmooth_2.23-17   stringi_1.5.3       
[46] cachem_1.0.1         fs_1.5.0             promises_1.1.1       leaflet_2.0.4.1      sp_1.4-5            
[51] xml2_1.3.2           bslib_0.2.4          ellipsis_0.3.1       shinyFiles_0.9.0     xts_0.12.1          
[56] generics_0.1.0       vctrs_0.3.6          tools_4.0.3          leafem_0.1.3         glue_1.4.2          
[61] purrr_0.3.4          crosstalk_1.1.1      parallel_4.0.3       fastmap_1.1.0        yaml_2.2.1          
[66] shinydashboard_0.7.1 classInt_0.4-3       sass_0.3.1   

> packageVersion("MODIStsp")
[1] ‘2.0.5’

Additional context

Scientific publication

ranghetti commented 3 years ago

I suspect it could be a problem related to package shinyFiles.

  1. Paste the ouput of
    packageVersion("shinyFiles")
  2. Try running
    library(shinyFiles)
    shinyFilesExample()

    and verify that all the three buttons on the left are working.

  3. If they do not work, update the package:
    install.packages("shinyFiles")

    and try again with point 2.

Let me know if it helped solving,

caseylynnbrown commented 3 years ago

Unfortunately, that did not resolve the problem.

packageVersion("shinyFiles") [1] ‘0.9.0

I was able to verify that all three buttons on the left worked. However, when I open the GUI, I am still unable to browse or select files from my drive.

Any other ideas? I really appreciate your help on this.

Casey

ranghetti commented 3 years ago

Unfortunately it is impossible for me to understand the problem without having the possibility to debug it. Maybe some screenshot could help. Do you have the possibility to run it on a different machine? Otherwise you can try using a virtual machine.

caseylynnbrown commented 3 years ago

I tried running the noninteractive execution of MODIStsp to see if I could pinpoint problems to possibly debug. There seems to be an error in the path to the Temp folder.

MODIStsp(gui=FALSE, out_folder = "H:/ODFW ArcGIS Files/MODIS/MODIS FILES", selprod = "Vegetation_Indexes_16Days_250m (M*D13Q1)", bandsel = c("EVI", "NDVI"), quality_bandsel ="QA_qual", indexes_bandsel = NULL, user ="Caseylynnbrown", password="Rubysue2006!", download_range="Seasonal", start_date = "2015.03.15",end_date = "2019.11.01",spatmeth="tiles", start_x = 9, end_x=9, start_y=4, end_y=4, ts_format="R RasterStack", out_format="GTiff", )

GDAL version in use: 3.0.4 Error: Path 'C:\Users\brownca1\AppData\Local\Temp\RtmpM9wXi1/MODIStsp/HDFs' does not exist

This Temp folder is where the binary packages were installed...however, my packages along with all my data are stored on a different drive. Is that the problem?

ranghetti commented 3 years ago

That path is the folder in which original HDF files are downloaded in case the argument out_folder_mod is not provided. There was a bug in the code which caused the error when argument out_folder_mod is not provided: you can try installing the development branch of the package with the command:

remotes::install_github("ropensci/MODIStsp", ref = "devel")

and then relaunchinng your processing.

Alternatively you can specify the argument out_folder_mod as done for out_folder (in this case, the bug does not have effect).

Moreover, note that the product name is not "Vegetation_Indexes_16Days_250m (M*D13Q1)" but "Vegetation Indexes_16Days_250m (M*D13Q1)".

Let me know,

ranghetti commented 3 years ago

Closing due to missing feedback (assuming solved); reopen if necessary.