fdetsch / MODIS

Download and processing framework for MODIS imagery. The package provides automated access to the global online data archives LP DAAC, LAADS and NSIDC as well as processing capabilities such as file conversion, mosaicking, subsetting and time series.
Other
58 stars 27 forks source link

getHdf error (empty collection) #13

Closed mabdelrazek closed 7 years ago

mabdelrazek commented 7 years ago

Hello,

I got an error while trying to download some hdfs:

> getHdf(product="MOD13Q1", tileH=29, tileV=7,  begin="2000049",checkIntegrity = TRUE)

Error in tapply(INDEX = mtr[, 1], X = mtr[, 2], function(x) { : 
  'INDEX' is of length zero

Apparently, the collection files are empty for some reason.

Session infos and MODISOptions are as follows:

> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: macOS Sierra 10.12.2

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] MODIS_1.0.0   raster_2.5-8  sp_1.2-4      mapdata_2.2-6 maps_3.1.1   

loaded via a namespace (and not attached):
 [1] rgdal_1.2-5     parallel_3.3.2  tools_3.3.2     RCurl_1.95-4.8  Rcpp_0.12.8     grid_3.3.2      nloptr_1.0.4    ptw_1.9-11      bitops_1.0-6    rgeos_0.3-21    XML_3.98-1.5   
[12] lattice_0.20-34

> MODISoptions()

STORAGE:
_______________
localArcPath : /path/to/HDFs 
outDirPath   : /path/to/Preprocessed 

DOWNLOAD:
_______________
MODISserverOrder : LPDAAC, LAADS 
dlmethod         : auto 
stubbornness     : high 

PROCESSING:
_______________
GDAL           : GDAL 2.1.2, released 2016/10/24 
MRT            : Enabled 
pixelSize      : asIn 
outProj        : asIn 
resamplingType : NN 
dataFormat     : GTiff 

Hope to see MODIS package on CRAN very soon :-)

Best, Mohammad

fdetsch commented 7 years ago

Hi Mohammad,

thanks for the hint. Apparently, data access through LP DAAC has been moved from http://e4ftl01.cr.usgs.gov to https://e4ftl01.cr.usgs.gov. As a consequence, getCollection could no longer find any online information about the most recent data collection, which in turn triggered the above error.

I adjusted the URL and uploaded the dataset. Could you please try it out for yourself?

devtools::install_github("MatMatt/MODIS", ref = "release")
library(MODIS)
getCollection("MOD13Q1", forceCheck = TRUE)

For me, it worked both on Ubuntu (R-3.3.2) and Windows (R-devel). Also, have you read the information on MODIS data download from LP DAAC included in ?MODISoptions? As of late, you are required to create a hidden .netrc file with Earthdata login credentials (e.g., via lpdaacLogin) in order to get things going. However, this does not apply to LAADS.

mabdelrazek commented 7 years ago

Thanks Florian! I appreciate the very fast response It works now :-D

Have a nice evening Mohammad