eodal.metadata.sentinel2.database.ingestion module¶
Functions to insert Sentinel-2 specific metadata into the metadata DB
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.ingestion.meta_df_to_database(meta_df: DataFrame, raw_metadata: bool | None = True) None[source]¶
Once the metadata from one or more mapper have been extracted the data can be ingested into the metadata base (strongly recommended).
This function takes a metadata frame extracted from “raw” or “processed” (i.e., after spatial resampling, band stacking and merging) Sentinel-2 data and inserts the data via pandas intrinsic sql-methods into the database.
- Parameters:
meta_df – data frame with metadata of one or more mapper to insert
raw_metadata – If set to False, assumes the metadata is about processed products
- eodal.metadata.sentinel2.database.ingestion.metadata_dict_to_database(metadata: dict) None[source]¶
Inserts extracted metadata into the meta database
- Parameters:
metadata – dictionary with the extracted metadata
- eodal.metadata.sentinel2.database.ingestion.update_raw_metadata(meta_df: DataFrame, columns_to_update: List[str]) None[source]¶
Function to update one or more atomic columns in the metadata base. The table primary keys ‘scene_id’ and ‘product_uri’ must be given in the passed dataframe.
- Parameters:
meta_df – dataframe with metadata entries to update. Must contain the two primary key columns ‘scene_id’ and ‘product_uri’
columns_to_update – List of columns to update. These must be necessarily atomic attributes of the raw_metadata table.