modis_download: Download MODIS products

View source: R/Functions.R

modis_downloadR Documentation

Download MODIS products

Description

This function is used to download and process modis files that can then be classified into floodmaps using modis_classify(). Important: MODIS bands 1-7 will be downloaded, yet only band 7 should be used in modis_classify(). Note that the filenames simply correspond to the aqcuisition date of the MODIS satellite imagery.

Usage

modis_download(
  dates = NULL,
  outdir = getwd(),
  tmpdir = tempdir(),
  username = NULL,
  password = NULL,
  messages = T,
  overwrite = F,
  overwrite_temp = F
)

Arguments

dates

character vector of dates. Dates for which a modis image should be downloaded. Needs to be of format "YYYY-mm-dd".

outdir

character. Directory were the downloaded and processed files should be stored to. This data will be used in modis_classify()

username

character. Username of your EarthData account

password

character. Password of your EarthData account

overwrite

logical. If such a file already exists in the path, should it be overwritten?

overwrite_temp

logical. If the temporary HDF file already exists in the tmpdir, should it be overwritten?

tempdir

character. Directory were intermediary files should be stored to (e.g. hdf files). By default these are stored to tempdir(). However, you can change this to any other folder.

Value

Character vector of filename pointing to the downloaded files

Examples

## Not run: 
# Download files for two dates
files <- modis_download(
    dates     = c("2020-01-01", "2020-01-01")
  , outdir    = getwd()
  , tmpdir    = tempdir()
  , username  = "username"
  , password  = "password"
  , overwrite = F
)

# Check them
files

## End(Not run)

DavidDHofmann/floodmapr documentation built on Jan. 15, 2024, 9:32 p.m.