Closed t-stratmann closed 6 years ago
Hi,
Sorry for the delay. The answer here is rather simple: there exists no file for the specified time period from "2017325" to "2017336", see here:
The file for "2017321" might include some values for this time range since we are dealing with 16-day composites here. However, the file search is performed via the actual names of the 16-day files, which is why runGdal()
cannot find any match.
Nonetheless, I admit that the reported error is not very helpful. Therefore, as of a904a09184fc26032ed0d943a878056d74833125, a warning is thrown whenever no file could be found for a particular product and time range. In addition, runGdal()
now returns a single NA
for this product rather than throwing an error.
> tfs = runGdal(product = "MOD13Q1", collection = cll, job="giraffe", extent = tile@extent,
+ begin = "2017325", end = "2017336", SDSstring = "110000000000")
########################
outProj = asIn
pixelSize = asIn
resamplingType = near
Output Directory = C:/Users/.../MODIS_ARC/PROCESSED//giraffe
########################
Local structure is up-to-date. Using offline information!
Warning message:
In runGdal(product = "MOD13Q1", collection = cll, job = "giraffe", :
No MOD13Q1 files found for the period from 2017-11-21 to 2017-12-02.
> tfs
$MOD13Q1.006
[1] NA
Thanks for taking the time to look into this and fixing the error message!!! Much appreciated. So the key is to make sure to give dates that match with the 16 day composite dates? I think this used to not matter, since "2017325" to "2017336" fall within the 321 16-day composite, the files in the 321 folder would be downloaded.
Yeah, exactly. On second thought, maybe an automated reset of user-defined dates to the 16-day composite periods could indeed be of added value. I'll think about it and then come back to you!
That could be really cool / easy! But a clear statement that one needs to match the MODIS scene dates would definitely be easier. Just extremely thankful your package exists!
Starting with 3cac4832279b7c285bba161fd5509cb2af01113f (runGdal()
) and 1a928a693ec4e89530beca699633bcf4da71558b (getHdf()
), 'begin' is now reset to the start date of the corresponding composite period (e.g. start of 16-day cycle for MOD13Q1). In addition, a warning is printed to the console:
> tfs = runGdal(product = "MOD13A1", collection = cll, job = "giraffe"
+ , extent = tile@extent, begin = "2017325", end = "2017336"
+ , SDSstring = "110000000000")
########################
outProj = asIn
pixelSize = asIn
resamplingType = near
Output Directory = C:/Users/florianD/Data/MODIS_ARC/PROCESSED/giraffe
########################
Local structure is up-to-date. Using offline information!
Warning message:
In correctStartDate(tLimits$begin, sel, prodname) :
Resetting 'begin' to start of corresponding MOD13A1 16-day composite period (2017-11-17).
Can you please install the 'develop' version via devtools::install_github("MatMatt/MODIS", ref = "develop")
and verify?
Installed. Tried the "giraffe" example and a different extent and date (also not set to the beginning of the MODIS scene) and it worked! Both times I got a warning, but it downloaded the MODIS scenes which make sense for the dates given:
Warning message: In correctStartDate(tLimits$begin, sel, prodname) : Resetting 'begin' to start of corresponding MOD13A1 16-day composite period (2017-11-17).
Warning message: In correctStartDate(tLimits$begin, sel, prodname) : Resetting 'begin' to start of corresponding MOD13A1 16-day composite period (2018-02-02).
Thank-you very much!
Great, then I consider this solved!
A small addition as of 9be254a1365ddcd567998eff53284834cad3d24c on branch 'sinusoidal' (heavy development going on lately...): These warning messages can now be disabled through MODISoptions(quiet = TRUE)
.
First of all, thank-you for this great package!!! It has saved me a lot of time! I just have a question. Last week I was able to successfully use the runGdal function and download HDF files, stitch them, and convert to TIFF. Now I am working in a different area and am getting a confusing error. All it says is "Error in lst_todo[[1]] : subscript out of bounds" The error message is not really enough to help me troubleshoot the issue. Any help / insight would be greatly appreciated!
Thank-you!!!
Script and console output below