l4_download: DOWNLOAD GEDI level 4A data from DAACL.ORNL

View source: R/l4_download.R

l4_downloadR Documentation

DOWNLOAD GEDI level 4A data from DAACL.ORNL

Description

Download all GEDI footprints from the official repository that intersect a study area, defined as an extent in lon/lat coordinates. The footprints are located within the global latitude band observed by the International Space Station (ISS), nominally 51.6 degrees N and S and reported for the period 2019-04-18 to 2020-09-02

Usage

l4_download(
  ul_lat,
  lr_lat,
  ul_lon,
  lr_lon,
  ncore = parallel::detectCores() - 1,
  from = NULL,
  to = NULL,
  outdir = getwd(),
  just_path = F,
  subset = NULL
)

Arguments

ul_lat

Numeric: upper left latitude.

lr_lat

Numeric: lower right latitude.

ul_lon

Numeric: upper left longitude.

lr_lon

Numeric: lower right longitude.

ncore

Numeric: numbers of core to be used if the maximum core available is less than the number of files to be download. Default to the number of cores available minus one.

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 to the working directory. If it doesn't exist it will be created. Ignored if just_path=TRUE

just_path

Logical: if TRUE return a character vector of available files without downloading them. Default to FALSE.

subset

Numeric vector of indices for downloading a subset of files instead of all. If is not numeric it will be ignored silently.

Details

During the first use, users will be ask to enter their Earth Explore login Information for downloading the data. If you don't have already an account, register at this link. These information will be saved in outdir as a netrc file. This function uses the foreach package for downloading files in parallel, with the doParallel configuration. If a file with the same name is already presented in outdir it will be overwrite.

Value

List of file path in outdir

Examples


#retrive Italy bound
bound <- sf::st_as_sf(raster::getData('GADM', country='ITA', level=1))
ex <- raster::extent(bound)
ul_lat <- ex[4]
lr_lat <- ex[3]
ul_lon <- ex[2]
lr_lon <- ex[1]
from <- "2020-07-01"
to <- "2020-07-02"
#get just files path available for the searched parameters
l4_download(ul_lat=ul_lat,
           lr_lat=lr_lat,
           ul_lon=ul_lon,
           lr_lon=lr_lon,
           from=from,
           to=to,
           just_path=T
)

#download the first 4 files

l4_download(ul_lat=ul_lat,
           lr_lat=lr_lat,
           ul_lon=ul_lon,
           lr_lon=lr_lon,
           from=from,
           to=to,
           just_path=F,
           outdir = tempdir(),
           subset=1:4)

VangiElia/GEDI4R documentation built on April 8, 2023, 6:13 p.m.