11

I use a 'R' script for downloading MODIS imageries. However, it doesn't give MOD16 product. I could neither find the MOD16 product in earthexplorer website. Though the desired product is available at http://www.ntsg.umt.edu/project/mod16#data-product but I could not find any script to download.

Is there any script available for it? or I need to click each image for download.

For example, if I want to download "h02v08" image from each and every month of the year, how to do it?

  • expanding on the same cuestion after i have identified my 'landgrind', how can i select a specific date for example during november? – Mauro Jan 13 '17 at 11:36
  • If you have a new question, please ask it by clicking the Ask Question button. Include a link to this question if it helps provide context. - From Review – Evil Genius Jan 13 '17 at 12:00
11

The project website hosts the MOD16 dataset on an FTP server.

As FTPs allow directory listings you can easily download complete folders without having to click individual links. This can be done with most FTP clients - a popular one would be FileZilla. Just right click the folder you want and select download.

edit: The question now specifies that only one MODIS granule is required. There are two ways to achieve this:

  1. Using the command line: Get a directory listing of all the files on the ftp, i.e. on linux with ncftpls -R, grep for the desired granule and download via curl/wget.

  2. The easier way would be to use a dedicated ftp tool, search for the granule and download all files with it. @AndreJ already showed how to do this with fireFTP. The screenshot shows how you would do it in FileZilla.

enter image description here

  • Thanks but, I don't require all the files. What I need is specific files from each month. Downloading the entire dataset would be the last choice. – Mario Oct 2 '15 at 12:27
  • In that case you can list all the files in the directory, sort the list to your needs (i.e. with grep) and then use a download tool like curl, wget or DownThemAll to download that list. – Kersten Oct 2 '15 at 12:30
  • Thanks again, I have downloaded data using "wget" but there we used to write file address in a text file and then call it using wget. However, here I find it difficult to get the links of required files. Could you please elaborate or pass come link to understand "list all the files in the directory, sort the list to your needs (i.e. with grep)" in your reply. – Mario Oct 2 '15 at 12:45
2

The data seems to be archived in files for every 8 days. If you only need a part of the world, you have to select the right h and v tile according to https://nsidc.org/data/docs/daac/mod10_modis_snow/landgrid.html from every 8-days folder.

If you have fireFTP installed in Firefox and connected to the ftp server, you can search for h02v08 on the remote datasource, and check for include subdirectories.

It is still rather slow, so a command line tool might be a better solution.

2

As pointed out by @EstevenMuriillo, data access is realized exclusively through http:// as of late. The R MODIS package currently supports the automated download of 8-day MOD16A2 and yearly MOD16A3 files from this new address, see

library(MODIS)
getProduct("MOD16")

In order to download particular files, simply run

mod16a2 <- getHdf(product = "MOD16A2", 
                  begin = "2011001", end = "2011031", 
                  tileH = 2, tileV = 8)
mod16a2

$MOD16A2.105
[1] "~/MOD16A2.A2011001.h02v08.105.2013122121506.hdf"
[2] "~/MOD16A2.A2011009.h02v08.105.2013122121506.hdf"
[3] "~/MOD16A2.A2011017.h02v08.105.2013122121506.hdf"
[4] "~/MOD16A2.A2011025.h02v08.105.2013122121506.hdf"

Note that it is also possible to download files and extract relevant SDS layers in one go using runGdal instead of getHdf. In addition, be aware that you need to install wget to get the whole thing up and running.

1

The current address (2017) is not ftp change by http://www.ntsg.umt.edu/project/mod16#data-product, so the use of Filezilla is not possible, wget is a very reliable possibility for this Type of shares

0

You can try the ModisDownload() function from the rts package. Its last version allows for the needed NASA authentication prior to search and download. I believe that it is required now and the direct FTP download is not possible anymore. Even if I am wrong, this function provides a very rich set of tools to download and process MODIS imagery.

Its advantages include the possibility to mosaic and to reproject the raw .hdr files downloaded (for the latter, you need to install the Modis Download Tool from NASA - link) to generate, say, a geotiff of all your tiles together.

To create your NASA user, go to https://urs.earthdata.nasa.gov/users/new. Then try

devtools::install_github('babaknaimi/rts')  # must install the latest one
library(rts)

setNASAauth("yourNASAlogin", "yourNASApassword", update = T) # authenticates at NASA's server
> username and password are successfully updated...!
Then to download the required images:

ModisDownload(x='MOD16A2',h=2,v=8,dates=c('2011.01.01','2011.01.31'), mosaic=F, proj=F)

This package allows actually to get any product available from MODIS analogously.

0

You can use this online tool to download the HDF files:

Mod16A2 Downloader

-1

I think this video is helpful for getting data from MOD16A2 HDF File

  • You can add this to your previous answer, edit it and add more information. Link-only answers will be deleted – aldo_tapia Apr 9 at 21:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.