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

Error in strsplit(x, ":") : non-character argument #106

Closed Saadi4469 closed 3 years ago

Saadi4469 commented 3 years ago

Hello,

I am getting this error after running the following command:

runGdal(product= "MOD13Q1",begin="2015001",end = "2020366",tileH = h,tileV = v,SDSstring = Bands,
        job = "any", outProj="GEO", datum="WGS84")
Downloading structure on 'LPDAAC' for: MOD13Q1.006
Hm, I have to search for the file. Next time provide the full path and I'll be very fast!
Error in strsplit(x, ":") : non-character argument

Also the file is not showing the date in the filename, why is that so?

Please note that I have the most recent version of MODIS i.e., 1.2.3

Saadi4469 commented 3 years ago

Even after changing "dlmethod = curl", it does ask me the username and password, but then after a while I still get the same error.

########################
outProj          =  +proj=longlat +datum=WGS84 +no_defs 
pixelSize        =  asIn 
resamplingType   =  near 
Output Directory =  ~
########################
Downloading structure on 'LAADS' for: MOD13Q1.006
    ... 2000 
    ... 2001 
    ... 2002 
    ... 2003 
    ... 2004 
    ... 2005 
    ... 2006 
    ... 2007 
    ... 2008 
    ... 2009 
    ... 2010 
    ... 2011 
    ... 2012 
    ... 2013 
    ... 2014 
    ... 2015 
    ... 2016 
    ... 2017 
    ... 2018 
    ... 2019 
    ... 2020 
    ... 2021 
Hm, I have to search for the file. Next time provide the full path and I'll be very fast!
Error in strsplit(x, ":") : non-character argument
Saadi4469 commented 3 years ago

The problem was with my password which was incorrectly entered the first time in the terminal. Fixing that resolves the issue.

fdetsch commented 3 years ago

Glad to hear you could work this out.

pabuveery commented 2 years ago

Hello! I am receiving the same error message, and I double checked that my password was entered correctly. I am running the following command:

MODISoptions(dlmethod = 'curl')
tifs <- runGdal(product = "MCD12Q1", collection = "006", SDSstring = "01", 
                extent = bcr12, 
                begin = "2010.01.01", end = "2021.12.31", 
                outDirPath = "data", job = "modis",
                MODISserverOrder = "LPDAAC") %>% 
  pluck("MCD12Q1.006") %>% 
  unlist()

bcr12 is a RasterLayer. I derived this code from eBird Best Practices' guidelines to downloading MODIS data: https://cornelllabofornithology.github.io/ebird-best-practices/covariates.html#covariates-dl

Approximately 2-3 hours after running my code, I receive the following error:

Local structure is up-to-date. Using offline information!
Hm, I have to search for the file. Next time provide the full path and I'll be very fast!
Error in strsplit(x, ":") : non-character argument

Apologies as I know you have addressed this error before but I am struggling to find any solutions that have worked for me. I have HDF4 support and have attempted 'curl' and 'wget' as the specified dlmethod. I have also attempted different date ranges. Thank you very much for any help.

pabuveery commented 2 years ago

Here's the traceback if that's helpful:

> traceback()
11: strsplit(x, ":")
10: getSdsNames(SDSnames)
9: is.factor(x)
8: gsub("\"", "", getSdsNames(SDSnames))
7: getSds(HdfName = y, SDSstring = SDSstring)
6: FUN(X[[i]], ...)
5: lapply(files, function(y) {
       getSds(HdfName = y, SDSstring = SDSstring)
   })
4: runGdal(product = "MCD12Q1", collection = "006", SDSstring = "01", 
       extent = bcr12, begin = begin_year, end = end_year, outDirPath = "data", 
       job = "modis", MODISserverOrder = "LPDAAC")
3: pluck(., "MCD12Q1.006")
2: unlist(.)
1: runGdal(product = "MCD12Q1", collection = "006", SDSstring = "01", 
       extent = bcr12, begin = begin_year, end = end_year, outDirPath = "data", 
       job = "modis", MODISserverOrder = "LPDAAC") %>% pluck("MCD12Q1.006") %>% 
       unlist()
fdetsch commented 2 years ago

Judging from a couple of forum posts (e.g. downloading ASTER L1T, LP DAAC Planned Power Outage), it seems like LP DAAC is experiencing rather heavy traffic these days resulting in 401 Authorization errors for at least some users. Can you try retrieving the data from LAADS instead?

MODISoptions(
  MODISserverOrder = "LAADS"
)

I agree that Error in strsplit(x, ":") : non-character argument is rather nondescript, though. I'll try to improve it so that it gives an immediate indication on what might be going on.