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, verbose = TRUE)
s2_prodlist | Named character: list of the products to be checked,
in the format |
---|---|
apihub | Path of the "apihub.txt" file containing credentials of SciHub account. If NA (default), the default location inside the package will be used. |
verbose | Logical: if TRUE, provide processing messages summarising
how many of the SAFE archives in |
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.
License: GPL 3.0
L. Ranghetti, M. Boschetti, F. Nutini, L. Busetto (2020). "sen2r": An R toolbox for automatically downloading and preprocessing Sentinel-2 satellite data. Computers & Geosciences, 139, 104473. DOI: 10.1016/j.cageo.2020.104473, URL: http://sen2r.ranghetti.info/.
# \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 #> FALSE #> S2B_MSIL1C_20180227T134629_N0206_R081_T21FVC_20180227T200327.SAFE #> TRUE #> S2A_MSIL1C_20180301T133641_N0206_R038_T21FVC_20180301T145524.SAFE #> FALSE #> S2B_MSIL1C_20180306T133629_N0206_R038_T21FVC_20180306T183210.SAFE #> FALSE #> S2A_MSIL1C_20180311T133641_N0206_R038_T21FVC_20180311T163528.SAFE #> FALSE #> S2A_MSIL1C_20180314T134631_N0206_R081_T21FVC_20180314T150724.SAFE #> FALSE #> S2B_MSIL1C_20180316T133639_N0206_R038_T21FVC_20180316T145348.SAFE #> FALSE# }