The function retrieves the list of available Sentinel-2 products basing on search criteria. It makes use of s2download python function only to retrieve the list of files, without downloading and correcting them.
s2_list(spatial_extent = NULL, tile = NULL, orbit = NULL, time_interval = NULL, time_period = "full", level = "auto", ignore_ingestion_time = TRUE, apihub = NA, max_cloud = 100)
spatial_extent | A valid spatial object object of class |
---|---|
tile | Single Sentinel-2 Tile string (5-length character) |
orbit | Single Sentinel-2 orbit number |
time_interval | a temporal vector (class POSIXct or Date) of length 1 (specific day) or 2 (time interval). |
time_period | (optional) Character:
|
level | Character vector with one of the following: - "auto" (default): check if level-2A is available on SciHub: if so, list it; if not, list the corresponding level-1C product - "L1C": list available level-1C products - "L2A": list available level-2A products |
ignore_ingestion_time | (optional) Logical: if TRUE (default),
the research is performed basing only on the sensing date and time
(the time in which the image was acquired), ignoring the ingestion date
and time (the time the image was ingested).
If FALSE, products with the ingestion time specified with |
apihub | Path of the "apihub.txt" file containing credentials of scihub account. If NA (default) the default credentials (username "user", password "user") will be used. |
max_cloud | Integer number (0-100) containing the maximum cloud level of the tiles to be listed (default: no filter). |
A vector of available products (being each element an URL, and its name the product name).
License: GPL 3.0
# NOT RUN { pos <- sf::st_sfc(sf::st_point(c(9.85,45.81)), crs = 4326) time_window <- as.Date(c("2016-05-01", "2017-07-30")) # Full-period list example_s2_list <- s2_list( spatial_extent = pos, tile = "32TNR", time_interval = time_window, orbit = "065" ) print(example_s2_list) # Print the dates of the retrieved products as.vector(sort(sapply(names(example_s2_list), function(x) { strftime(safe_getMetadata(x,"nameinfo")$sensing_datetime) }))) # Seasonal-period list example_s2_list <- s2_list( spatial_extent = pos, tile = "32TNR", time_interval = time_window, time_period = "seasonal" ) print(example_s2_list) # Print the dates of the retrieved products as.vector(sort(sapply(names(example_s2_list), function(x) { strftime(safe_getMetadata(x,"nameinfo")$sensing_datetime) }))) # }