Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output results were empty #57

Open
goumengmeng opened this issue Nov 25, 2018 · 3 comments
Open

Output results were empty #57

goumengmeng opened this issue Nov 25, 2018 · 3 comments

Comments

@goumengmeng
Copy link

goumengmeng commented Nov 25, 2018

Hello
I got an confusing error while trying to download MODQ13 files. By using the following code and found that the corresponding path were empty~

library(MODIS)
MODISoptions(localArcPath = "C:/temp/MODIS",
             outDirPath = "C:/temp/MODIS/processed",
             MODISserverOrder = c("LAADS", "LPDAAC"),
             gdalPath = "C:/OSGeo4W64/bin/")
cll <- getCollection(product = "MOD13Q1", forceCheck = TRUE)
tfs <- runGdal(product = "MOD13Q1", collection = cll,
               tileH = 28, tileV = 6, 
               begin = "2015.01.01", end = "2015.01.31", 
               SDSstring = "101100")

I also tried another code which i had used successfully before, but in this time the code was failed.

library(MODIS)
MODISoptions(localArcPath = "E:/MODIS1990")
getHdf(product="MOD13Q1", begin = "2000.01.01", end="2000.01.31",tileH=28, tileV=6, checkIntegrity = FALSE)

It would be great honor to receive your reply~

@fdetsch
Copy link
Owner

fdetsch commented Nov 26, 2018

Sorry, but I fail to replicate the first issue. On my machine, everything runs smoothly (tested with both the current CRAN and most recent 'swath' release). Here's my sessionInfo():

R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.5 LTS

Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/atlas-base/atlas/liblapack.so.3.0

locale:
 [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C               LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8    
 [5] LC_MONETARY=en_GB.UTF-8    LC_MESSAGES=en_GB.UTF-8    LC_PAPER=en_GB.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C             LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] MODIS_1.1.4   raster_2.8-4  sp_1.3-1      mapdata_2.3.0 maps_3.3.0   

loaded via a namespace (and not attached):
 [1] remotes_2.0.2     sf_0.7-1          lattice_0.20-38   testthat_2.0.1    usethis_1.4.0     htmltools_0.3.6  
 [7] base64enc_0.1-3   rlang_0.3.0.1     pkgbuild_1.0.2    e1071_1.7-0       nloptr_1.2.1      later_0.7.5      
[13] foreign_0.8-70    glue_1.3.0        withr_2.1.2       DBI_1.0.0         sessioninfo_1.1.1 rgeos_0.4-2      
[19] mapedit_0.4.3     devtools_2.0.1    codetools_0.2-15  memoise_1.1.0     callr_3.0.0       httpuv_1.4.5     
[25] ps_1.2.1          maptools_0.9-4    parallel_3.4.4    curl_3.2          class_7.3-14      Rcpp_1.0.0       
[31] xtable_1.8-3      backports_1.1.2   promises_1.0.1    classInt_0.2-3    desc_1.2.0        pkgload_1.0.2    
[37] mime_0.6          fs_1.2.6          ptw_1.9-13        digest_0.6.18     processx_3.2.0    shiny_1.2.0      
[43] grid_3.4.4        rprojroot_1.3-2   rgdal_1.3-6       cli_1.0.1         tools_3.4.4       bitops_1.0-6     
[49] magrittr_1.5      crayon_1.3.4      prettyunits_1.0.2 spData_0.2.9.4    assertthat_0.2.0  rstudioapi_0.8   
[55] R6_2.3.0          units_0.6-1       compiler_3.4.4 

Can you maybe include your sessionInfo() and the corresponding error message thrown after running your first code chunk?

The second piece of code shouldn't fail either, but rather return an empty list (which in my case, it does). Terra MODIS was launched in February 2000, which means there won't be any MOD13Q1 files available for the time period begin = "2000.01.01", end="2000.01.31". Note that running this with the newest 'swath' release will print a warning to the console here saying

> options(warn = 0) # make sure warnings are not turned off permanently
> hdf = getHdf(product="MOD13Q1", begin = "2000.01.01", end="2000.01.31",tileH=28, tileV=6, checkIntegrity = FALSE)
Warning message:
In .local(product, ...) :
  No MOD13Q1 files found for the period from 2000-01-01 to 2000-01-31.

@goumengmeng
Copy link
Author

Thanks for your patient reply. Here's my sessionInfo():
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 7 x64 (build 7601) Service Pack 1

Matrix products: default

locale:
[1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936
[2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936
[3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936
[4] LC_NUMERIC=C
[5] LC_TIME=Chinese (Simplified)_People's Republic of China.936

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

loaded via a namespace (and not attached):
[1] compiler_3.5.1

Run the first code and i got the following result:
MODISoptions(localArcPath = "C:/temp/MODIS",

  •          outDirPath = "C:/temp/MODIS/processed",
    
  •          MODISserverOrder = c("LAADS", "LPDAAC"),
    
  •          gdalPath = "C:/OSGeo4W64/bin/")
    

Setting 'localArcPath' to 'C:/temp/MODIS/'
If you already have downloaded some HDF files, you can use '?orgStruc' to rearrange them.
'outDirPath' has been changed from 'C:/Users/hp/AppData/Local/Temp/RtmpeQc43N/MODIS_ARC/PROCESSED/' to 'C:/temp/MODIS/processed/'.
Detecting available write drivers!
Found 75 candidate drivers, detecting file extensions (this might take some time...)
48 usable drivers detected!

STORAGE:


localArcPath : C:/temp/MODIS/
outDirPath : C:/temp/MODIS/processed/

DOWNLOAD:


MODISserverOrder : LAADS, LPDAAC
dlmethod : auto
stubbornness : high
wait : 0.5
quiet : FALSE

PROCESSING:


GDAL : GDAL 2.3.2, released 2018/09/21
MRT : Version 4.1 (March 2011)
pixelSize : asIn
outProj : asIn
resamplingType : NN
dataFormat : GTiff

cll <- getCollection(product = "MOD13Q1", forceCheck = TRUE)
Updating collection from LPDAAC for product: MOD13Q1
tfs <- runGdal(product = "MOD13Q1", collection = cll,

  •            tileH = 28, tileV = 6, 
    
  •            begin = "2015.01.01", end = "2015.01.31", 
    
  •            SDSstring = "101100")
    

########################
outProj = asIn
pixelSize = asIn
resamplingType = near
Output directory = C:/temp/MODIS/processed/MOD13Q1.006_20181128163052 (no 'job' name specified, generated (date/time based))
########################
Downloading structure on 'LAADS' for: MOD13Q1.006
Downloading structure from 'LAADS'-server! Try: 1
Error in file(file, "rt") : 无法打开链结
Downloading structure of 'NA' from 'LAADS'-server.

@fdetsch
Copy link
Owner

fdetsch commented Nov 28, 2018

How about setting MODISoptions(MODISserverOrder = c("LPDAAC", "LAADS")) – does this solve your problem? Otherwise, I could only imagine that this is some kind of firewall/proxy issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants