sen2r (version 1.2.1)

safe_is_online: Check if SAFE is available for download

Description

The function checks if the required SAFE archives are available for download, or if they have to be ordered from the Long Term Archive.

Usage

safe_is_online(s2_prodlist = NULL, apihub = NA)

Arguments

s2_prodlist

Named character: list of the products to be checked, in the format safelist (see '>safelist). Alternatively, it can be the path of a JSON file exported by s2_order.

apihub

Path of the "apihub.txt" file containing credentials of SciHub account. If NA (default), the default location inside the package will be used.

Value

A logical vector of the same length and names of the SAFE products passed with s2_prodlist, in which each element is TRUE if the corresponding SAFE archive is available for download, FALSE if it is not or NA in case of errors with the SAFE url.

Examples

Run this code
# NOT RUN {
# Generate the lists of products
pos <- sf::st_sfc(sf::st_point(c(-57.8815,-51.6954)), crs = 4326)
time_window <- as.Date(c("2018-02-21", "2018-03-20"))
list_safe <- s2_list(spatial_extent = pos, time_interval = time_window)
# (at the time the documentation was written, this list was containing 5
# archives already available online and 2 stored in the Long Term Archive)

# Check for availability
safe_is_online(list_safe)
# }

Run the code above in your browser using DataLab