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

Cannot add MODIS Thermal Anomalies V006 (Burned Area). #20

Closed Gilbert2015 closed 6 years ago

Gilbert2015 commented 7 years ago

Hello, I cannot find MODIS product that i tried to add. I use the steps below to add burned area version 006. But was not successful. MODIS:::addProduct(product="MCD64A1", sensor = "MODIS", platform = "Combined", pf1="MOTA", pf2="MOD", topic="Burned Area", type = "Tile", res ="500m", temp_res="Monthly", internalseparator = "\.", server ="LPDAAC",path_ext = "/Users/gogunkoya/Downloads/MODIS/external", overwrite = TRUE)

MODIS:::addServer(name = "LPDAAC", sensor = "MODIS", basepath = "https://e4ftl01.cr.usgs.gov/MOTA/MCD64A1.006/", varpath = "PRODUCT.CCC/DATE/",path_ext="/Users/gogunkoya/Downloads/MODIS/external",overwrite=FALSE)

MODIS:::addCollection(product="MCD64A1", collection="006", path_ext = "/Users/gogunkoya/Downloads/MODIS/external", overwrite = TRUE)

Maria-da-Conceicao-Pereira commented 7 years ago

Hello Gilbert2015,

I'm very interested to know if and how you managed to get over this problem, because I'm confronted with exactly the same problem and, in spite of having been busy with it for more than a week, I still haven't been able to solve it!

Looking at your message above I would say that the issue is not about adding a new server or collection, the only function that matters here is 'addProduct'. In relation to the server, as long as the arguments of this function (product, sensor, platform...) are correctly defined, there is no reason why the software shouldn't retrieve the new product; in relation to the collection, I think it's also not necessary to add it because the new product we want, MCD64A1, only has one collection (006).

The big problem I found was that the package (MODIS R) simply doesn't read the new product, even after adding it! In fact, I managed to create, through the function 'addProduct', the file 'MODIS_Products.RData' (by means of a .cvs file with the structure of the list given originally by 'MODIS:::MODIS_Products'); that file, when loaded in R, corresponds to a list ('MODIS_Products') and the programme reads it correctly, with the new product and all its properties, defined as values of the arguments of the function 'addProduct'. The problem is that, when using the package to read the file (so, with 'MODIS:::MODIS_Products' and not just 'MODIS_Products'), the new product is not included. And in fact in a simple script to download the new product, I always get an error confirming that the new product is not found:

transDate(begin="2003.01.01",end="2003.04.31") getHdf(product="MCD64A1", begin="2003-01-01", end="2003-04-31", tileH=21, tileV=10) No product found with the name MCD64A1 try 'getProduct()' to list available products.

I even overwrote the original file 'MODIS_Products.RData', that comes with the installation of the package (folder 'external'), but it still doesn't work.

I also tried to unlist the list 'MODIS_Products', so that the function 'getHdf' can read the value 'MCD64A1' directly as character, but this also doesn't solve the problem. And anyway, I don't think this is the issue because if the new product were added and read correctly by the package, this shouldn't constitute an impediment since the components of the list are in character format, I think.

I've thus tried everything I consider logical and consequently started to think that there is a bug here. Following this reasoning I'm going to create an issue in this platform, hoping that someone amongst the developers reacts and helps. But if in the meanwhile you see this message please let me know if you found a solution, I'm sort of desperate because I can't advance in my work.

Greetings, Maria Pereira

fdetsch commented 7 years ago

This should be fixed as of commit 9b054e99b6c2fc9ef0d6e0d53c7e0c9b60c7de39. Could you please run the sample code included in #27 (which also provides further details on the topic) and verify?