0

Firstly, I'll provide a bit of context behind my question. I've been reading a paper about bushfire modelling, and the paper uses the MODIS datasets (this is my first time learning about them). In particular, the paper uses fire detection data from the MCD14ML dataset, and NDVI values from the MYD13A3 (collection 6) dataset. I'm very new to MODIS datasets and HDF files. I've downloaded the 2003 MCD14ML dataset from https://earthdata.nasa.gov/earth-observation-data/near-real-time/firms/mcd14ml. Briefly, this dataset contains some attributes (including latitude, longitude, time) of detected "hotspots" in Australia, within the year of 2003. The dataset is in CSV form (so different attributes are in different columns). Below is an image of what I am seeing (in excel). So far, so good.

enter image description here

Unfortunately, the MYD13A3 (collection 6) dataset is not available in csv form (and the same applies for most other MODIS datasets). My goal is to add a column to the MCD14ML csv file which shows the relevant NDVI value for the region that was identified as a hotspot. So basically, something like this (I've made up the NDVI values).

enter image description here

I'm fairly confident that there's a way to download the MYD13A3 MODIS file in R, and that there's a way to extract NDVI values from it. Regarding downloading MODIS files in R, I tried to read the documentation for the R packages 'MODISTools' and 'MODIS'. Unfortunately, the documentations weren't very clear on how to use them to download MODIS files - so I searched on stack exchange, and found an answer that works at MODIS R Connection error . Based on the answer there, I've done the following.

hdf = getHdf("MYD13A3", collection = "006"
+              , extent="Australia"
+              , begin = "2003.01.01", end = "2003.01.03")

So what the above does is it downloads a bunch of HDF files to some specified folder on my computer. My understanding is that these HDF files contain the NDVI values of some geographic region. At this stage, what I want to do is to somehow extract the NDVI values from each HDF file, and put them into an R dataframe/CSV file. How can I do this? An additional question is whether there is a way (in R) to extract the NDVI values given longitude and latitude data.

2
  • 2
    1: If "the MYD13A3 (collection 6) dataset is not available in csv form" how can you achieve your goal of "to add a column to the MYD13A3 csv file"? 2. "I'm fairly confident that there's a way to download the MYD13A3 MODIS file in R," - how? Is this the essence of this whole post? Should this post simply be "How do I download MYD131A3 Modis data?".
    – Spacedman
    Commented Apr 5, 2021 at 10:48
  • @Spacedman Thank you for your comment! I'm sorry for the issues in my question (and thank you for pointing them out). 1. When I wrote "add a column to the MYD13A3 csv file", I was supposed to say "add a column to the MCD14ML csv file (the first pic shown). I will make an edit to reflect this. 2. To be honest, I do not know the "standard" way of downloading MODIS datasets - I only know of the way that I described in my question; that is, by using the getHdf function from the MODIS package. Is there a more commonly used method? (Once again thank you for pointing this out) Commented Apr 5, 2021 at 23:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.