download_modis {amadeus} | R Documentation |
Download MODIS product files
Description
Need maintenance for the directory path change in NASA EOSDIS. This function first retrieves the all hdf download links on a certain day, then only selects the relevant tiles from the retrieved links. Download is only done at the queried horizontal-vertical tile number combinations. An exception is MOD06_L2 product, which is produced every five minutes every day.
Usage
download_modis(
product = c("MOD09GA", "MOD11A1", "MOD06_L2", "MCD19A2", "MOD13A2", "VNP46A2"),
version = "61",
horizontal_tiles = c(7, 13),
vertical_tiles = c(3, 6),
mod06_links = NULL,
nasa_earth_data_token = NULL,
date = c("2023-09-01", "2023-09-01"),
directory_to_save = NULL,
acknowledgement = FALSE,
download = FALSE,
remove_command = FALSE
)
Arguments
product |
character(1).
One of |
version |
character(1). Default is |
horizontal_tiles |
integer(2). Horizontal tile numbers
|
vertical_tiles |
integer(2). Vertical tile numbers
|
mod06_links |
character(1). CSV file path to MOD06_L2 download links
from NASA LAADS MOD06_L2. Default is |
nasa_earth_data_token |
character(1). Token for downloading data from NASA. Should be set before trying running the function. |
date |
character(2). length of 10 each. Start/end date for downloading data.
Format "YYYY-MM-DD" (ex. January 1, 2018 = |
directory_to_save |
character(1). Directory to save data. |
acknowledgement |
logical(1). By setting |
download |
logical(1). Download data or only save wget commands. |
remove_command |
logical(1). Remove ( |
Value
NULL; HDF (.hdf) files will be stored in
directory_to_save
.
Note
Both dates in date
should be in the same year.
Directory structure looks like
input/modis/raw/{version}/{product}/{year}/{day_of_year}.
Author(s)
Mitchell Manware, Insang Song
References
Lyapustin A, Wang Y (2022). “MODIS/Terra+Aqua Land Aerosol Optical Depth Daily L2G Global 1km SIN Grid V061.” doi:10.5067/MODIS/MCD19A2.061, https://lpdaac.usgs.gov/products/mcd19a2v061/.
MODIS Atmosphere Science Team (2017). “MODIS/Terra Clouds 5-Min L2 Swath 1km and 5km.” doi:10.5067/MODIS/MOD06_L2.061, https://ladsweb.modaps.eosdis.nasa.gov/missions-and-measurements/products/MOD06_L2.
Vermote E, Wolfe R (2021). “MODIS/Terra Surface Reflectance Daily L2G Global 1km and 500m SIN Grid V061.” doi:10.5067/MODIS/MOD09GA.061, https://lpdaac.usgs.gov/products/mod09gav061/.
Wan Z, Hook S, Hulley G (2021). “MODIS/Terra Land Surface Temperature/Emissivity Daily L3 Global 1km SIN Grid V061.” doi:10.5067/MODIS/MOD11A1.061, https://lpdaac.usgs.gov/products/mod11a1v061/.
Didan K (2021). “MODIS/Terra Vegetation Indices 16-Day L3 Global 1km SIN Grid V061.” doi:10.5067/MODIS/MOD13A2.061, https://lpdaac.usgs.gov/products/mod13a2v061/.
Román MO, Wang Z, Sun Q, Kalb V, Miller SD, Molthan A, Schultz L, Bell J, Stokes EC, Pandey B, Seto KC, Hall D, Oda T, Wolfe RE, Lin G, Golpayegani N, Devadiga S, Davidson C, Sarkar S, Praderas C, Schmaltz J, Boller R, Stevens J, Ramos González OM, Padilla E, Alonso J, Detrés Y, Armstrong R, Miranda I, Conte Y, Marrero N, MacManus K, Esch T, Masuoka EJ (2018). “NASA's Black Marble nighttime lights product suite.” Remote Sensing of Environment, 210, 113–143. ISSN 00344257, doi:10.1016/j.rse.2018.03.017, https://linkinghub.elsevier.com/retrieve/pii/S003442571830110X.
Examples
## Not run:
## NOTE: Examples are wrapped in `/dontrun{}` to avoid sharing sensitive
## NASA EarthData tokden information.
# example with MOD09GA product
download_modis(
product = "MOD09GA",
version = "61",
horizontal_tiles = c(8, 8),
vertical_tiles = c(4, 4),
date = c("2024-01-01", "2024-01-01"),
nasa_earth_data_token = "./pathtotoken/token.txt",
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE
)
# example with MOD06_L2 product
download_modis(
product = "MOD06_L2",
version = "61",
horizontal_tiles = c(8, 8),
vertical_tiles = c(4, 4),
date = c("2024-01-01", "2024-01-01"),
mod06_links =
system.file(
"extdata", "nasa", "LAADS_query.2024-08-02T12_49.csv",
package = "amadeus"
),
nasa_earth_data_token = "./pathtotoken/token.txt",
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE
)
# example with VNP46A2 product
download_modis(
product = "VNP46A2",
version = "61",
horizontal_tiles = c(8, 8),
vertical_tiles = c(4, 4),
date = c("2024-01-01", "2024-01-01"),
nasa_earth_data_token = "./pathtotoken/token.txt",
directory_to_save = tempdir(),
acknowledgement = TRUE,
download = FALSE, # NOTE: download skipped for examples,
remove_command = TRUE
)
## End(Not run)