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

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.

Note

License: GPL 3.0

Examples

# \donttest{ # 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)
#> S2B_MSIL1C_20180224T133629_N0206_R038_T21FVC_20180224T194845.SAFE #> TRUE #> S2B_MSIL1C_20180227T134629_N0206_R081_T21FVC_20180227T200327.SAFE #> FALSE #> S2A_MSIL1C_20180301T133641_N0206_R038_T21FVC_20180301T145524.SAFE #> TRUE #> S2B_MSIL1C_20180306T133629_N0206_R038_T21FVC_20180306T183210.SAFE #> TRUE #> S2A_MSIL1C_20180311T133641_N0206_R038_T21FVC_20180311T163528.SAFE #> TRUE #> S2A_MSIL1C_20180314T134631_N0206_R081_T21FVC_20180314T150724.SAFE #> TRUE #> S2B_MSIL1C_20180316T133639_N0206_R038_T21FVC_20180316T145348.SAFE #> TRUE
# }