Parallel download data from the NASA ORNL DAAC server given period, spatial bounding box, and data DOI.

NASA_DAAC_download(
  ul_lat,
  ul_lon,
  lr_lat,
  lr_lon,
  ncore = 1,
  from,
  to,
  outdir = getwd(),
  band = NULL,
  credential.folder = NULL,
  doi,
  just_path = FALSE
)

Arguments

ul_lat

Numeric: upper left latitude.

ul_lon

Numeric: upper left longitude.

lr_lat

Numeric: lower right latitude.

lr_lon

Numeric: lower right longitude.

ncore

Numeric: numbers of core to be used if the maximum core

from

Character: date from which the data search starts. In the form "yyyy-mm-dd".

to

Character: date on which the data search end. In the form "yyyy-mm-dd".

outdir

Character: path of the directory in which to save the downloaded files. Default is the current work directory(getwd()).

band

Character: the band name of data to be requested.

credential.folder

Character: physical path to the folder that contains the credential file. The default is NULL.

doi

Character: data DOI on the NASA DAAC server, it can be obtained directly from the NASA ORNL DAAC data portal (e.g., GEDI L4A through https://daac.ornl.gov/cgi-bin/dsviewer.pl?ds_id=2056).

just_path

Boolean: if we just want the metadata and URL or proceed the actual download.

Value

Physical paths of downloaded files (just_path = T) or URLs of the files (just_path = F).

Author

Dongchen Zhang

Examples

if (FALSE) { # \dontrun{
ul_lat <- 35
ul_lon <- -121
lr_lat <- 33
lr_lon <- -117
from <- "2022-02-23"
to <- "2022-05-30"
doi <- "10.3334/ORNLDAAC/2183"
outdir <- "/projectnb/dietzelab/dongchen/SHIFT/test_download"
paths <- NASA_DAAC_download(ul_lat = ul_lat, 
                            ul_lon = ul_lon, 
                            lr_lat = lr_lat, 
                            lr_lon = lr_lon, 
                            from = from, 
                            to = to, 
                            doi = doi,
                            just_path = T)
} # }