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
57 stars 27 forks source link

problems with runGdal #101

Closed cedlfc44 closed 3 years ago

cedlfc44 commented 4 years ago

hi: i try to download a time series of EVI data, using MODIS package for this dates: Fechas_MODIS 1 2015-01-01 2 2015-01-17 3 2015-02-02 4 2015-02-18 5 2015-03-06 6 2015-03-22

im using a loop, its works perfectly two months ago, but now present problems in line Rungdal.

bandas <- "010000000001"
for (i in 1:6) { ptm<- proc.time() ## contador de tiempo INICIO bucle FOR print(fechas[i,1]) runGdal(job="H11_12_V11",product="MOD13Q1",collection = '006',

begin=fechas[i,1],end = fechas[i,1],

                  begin=as.Date(fechas[i,1], "%Y-%m-%d"), end = as.Date(fechas[i,1], "%Y-%m-%d"),
                  tileH = 11:12,tileV = 11, 
                  SDSstring = bandas, 
                  outProj="4326")

ERROR IS : Error in strsplit(x, ":") : argumento de tipo no-carácter

but, when i use same loop to download this product :MOD11A1, works perfectly, error is generated when i try to download EVI and NDVI products like MOD13Q1.

thanks for your help

fdetsch commented 4 years ago

Before going any further, have you tested this with the latest development version?

remotes::install_github("MatMatt/MODIS", ref = "develop")
library(MODIS)
cedlfc44 commented 4 years ago

Yes i have, with lastest version, there aren t any error messages but, i check Output Directory where images must be, but there aren t any tiff images, only found two hdf files with 1Kb sizes, both of them. Is there a relation between this dowload error with MODIS Reprojection Tool (MRT) and MRTSwath tool retired from lpdaac.usgs.gov page ? (https://lpdaac.usgs.gov/news/downloadable-modis-reprojection-tool-mrt-and-mrtswath-tool-have-been-retired/)

fdetsch commented 4 years ago

No, there shouldn't be a connection between MRT and the download issue you reported. Are you certain the credentials in ~/.netrc are correct?

cedlfc44 commented 4 years ago

Hello: First, I checked the credentials in ~/.netrc, and they are fine, but I still put back my username and password. I put back the improved script lines down. -This week, I was trying to download EVI images, once download proccess starts inside the loop, this happen: Downloading structure on 'LAADS' for: MOD13Q1.006

-Then, it starts with the first image of the date "i" inside the loop. [1] "2015-06-26" ######################## outProj = +proj=longlat +datum=WGS84 +no_defs pixelSize = asIn resamplingType = near Output Directory = D:/outfile/modisfinal1/img/H11_12_V11 ######################## Local structure is up-to-date. Using offline information!

-Then, I check Output Directory, when loop goes to the next date, and hdf images weights 1kb, so, function can t download anything, but the function runGdal works.

-in another attempt of download, happens all things i explained before, but in this try, modis can dowload 3 of 6 images of the loop, (images 2,4 and 6 of the loop), but of one tile only ( h11 and v11.) Another attempt, and it no longer downloads any image and so on until now.

This is very strange, because I already used same script 2 months ago, to download entire EVI time series from 2000 to 2020, and works perfectly, but now fails, I really need this for my research.

SCRIPT

remotes::install_github("MatMatt/MODIS", ref = "develop")

library(MODIS) library(rgdal)

fechas <- read.csv(file = "MOD13Q1.006.LAADS.2020314 - copia.txt",header = FALSE)

MODISoptions(localArcPath = './modisfinal/datoshdf', MODISserverOrder = c("LAADS", "LPDAAC"),

outProj = "asIn",

         # pixelSize = "asIn",
         outDirPath = './modisfinal/img')

h = c("11","12") ## tiles v = c("11")

for (i in 1:6) { runGdal(job="H11_12_V11",product="MOD13Q1",collection = '006', begin=as.Date(fechas[i,1], "%Y-%m-%d"), end = as.Date(fechas[i,1], "%Y-%m-%d"), tileH = h,tileV = v, SDSstring = "010000000000", outProj="4326", forceDownload = TRUE) Sys.sleep(5) }

example

fdetsch commented 3 years ago

Maybe this helps. Have you tried with another dlmethod?

cedlfc44 commented 3 years ago

Yes I have. firstable, I used debug to check what was going in on with script (debug(MODIS:::ModisFileDownloader)) and found the fail.

runGdal , checks two urls, LAADS and LPDAAC, and fail were in both. precisely in download.file ( [1] "Error in download.file(url = infile, destfile = destfile, mode = \"wb\", : \n 'wget' call had nonzero exit status\n")

So, I set up "curl" like download method. [MODISoptions(dlmethod = 'curl')]. Despite download is slower than before, It works fine for me.

thanks for your help.

fdetsch commented 3 years ago

Glad to help. I consider this issue closed, we'll try to solve the dlmethod problem in #104.