eodal.metadata.sentinel1.parsing module¶
This module contains functions to extract relevant scene-specific Sentinel-1 metadata
Copyright (C) 2022 Gregor Perich
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.sentinel1.parsing.extract_s1_footprint(in_dir: Path, use_gml: bool | None = True) str[source]¶
Extract the Footprint of the S1 scene from the metadata.safe document
- Parameters:
in_dir – Filepath to the S1 raw data .SAFE folder
use_gml – Should the GML coordinates (from the manifest.safe) be used, or the KML coordinates (from the ./preview/map-overlay.kml)
- Returns:
Well-known-text (WKT) of the S1 mapper’ footprint in geographic coordinates (WGS84, EPSG:4326).
- eodal.metadata.sentinel1.parsing.loop_s1_archive(in_dir: Path, get_newest_datasets: bool | None = False, last_execution_date: date | None = None) DataFrame[source]¶
wrapper function to loop over an entire archive (i.e., collection) of Sentinel-2 mapper in either L1C or L2A processing level or a mixture thereof.
The function returns a pandas dataframe for all found entries in the archive (i.e., directory). Each row in the dataframe denotes one scene.
- Parameters:
in_dir – directory containing the Sentinel-2 data (L1C and/or L2A processing level). Sentinel-2 mapper are assumed to follow ESA’s .SAFE naming convention and structure
extract_datastrip – If True reads also metadata from the datastrip xml file (MTD_DS.xml)
get_newest_datasets – if set to True only datasets newer than a user-defined time stamp will be considered for ingestion into the database. This is particularly useful for updating the database after new mapper have been downloaded or processed.
last_execution_date – if get_newest_datasets is True this variable needs to be set. All datasets younger than that date will be considered for ingestion into the database.
- Returns:
dataframe with metadata of all mapper handled by the function call
- eodal.metadata.sentinel1.parsing.parse_s1_metadata(in_dir: Path) Dict[source]¶
Parses the metadata found in the “manifest.safe” document of S1_IW_GRDH Level-1 products and writes them into a Python dictionary
- Parameters:
in_dir – file-path of the file you want to extract the metadata from
- Returns:
Dictionary containing the metadata of the passed S1 scene ready for DB ingestion