eodal.metadata.sentinel2.database.querying module¶
Functions to query Sentinel-2 specific metadata from the metadata DB.
Query criteria include
the processing level (either L1C or L2A for ESA derived Sentinel-2 data)
the acquisition period (between a start and an end dat)
the tile (e.g., “T32TLT”) or a bounding box (provided as extended well-known-text)
the scene-wide cloud coverage (derived from the scene metadata); this is optional.
Copyright (C) 2022 Lukas Valentin Graf
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
- eodal.metadata.sentinel2.database.querying.find_raw_data_by_bbox(date_start: date, date_end: date, processing_level: ProcessingLevels, bounding_box: Polygon | str, cloud_cover_threshold: int | float | None = 100) DataFrame[source]¶
Queries the metadata DB by Sentinel-2 bounding box, time period and processing level (and cloud cover). The returned data is ordered by sensing time in ascending order.
Note
For the spatial query
ST_Intersectsis called.- Parameters:
date_start – start date of the time period
date_end – end date of the time period
processing_level – Sentinel-2 processing level
bounding_box_wkt – bounding box either as extended well-known text in geographic coordinates or as shapely
Polygonin geographic coordinates (WGS84)cloud_cover_threshold – optional cloud cover threshold to filter datasets by scene cloud coverage. Must be provided as number between 0 and 100%.
- Returns:
dataframe with references to found Sentinel-2 mapper
- eodal.metadata.sentinel2.database.querying.find_raw_data_by_tile(date_start: date, date_end: date, processing_level: ProcessingLevels, tile: str, cloud_cover_threshold: int | float | None = 100) DataFrame[source]¶
Queries the metadata DB by Sentinel-2 tile, time period and processing level.
- Parameters:
date_start – start date of the time period
date_end – end date of the time period
processing_level – Sentinel-2 processing level
tile – Sentinel-2 tile
cloud_cover_threshold – optional cloud cover threshold to filter datasets by scene cloud coverage. Must be provided as number between 0 and 100%.
- Returns:
dataframe with references to found Sentinel-2 mapper
- eodal.metadata.sentinel2.database.querying.get_scene_metadata(product_uri: str) DataFrame[source]¶
Returns the complete metadata record of a Sentinel-2 scene
- Parameters:
product_uri – unique product identifier. This corresponds to the .SAFE name of a Sentinel-2 dataset
- Returns:
DataFramewith complete scene metadata