The modules cesard.metadata.stac and cesard.metadata.xml contain functions for creating metadata files in STAC JSON and OGC EO XML standard, respectively. As input they get a nested dictionary of type dict[str, dict[str, int | float | str | list[str] | datetime.datetime]], which needs to be created by the satellite-specific packages, e.g. s1ard.metadata.extract.meta_dict.
This complex nested dictionary structure is very hard to maintain thus making it hard for authors of new satellite-specific ARD packages to keep an overview of which attributes are required.
A formal metadata model (or multiple) could explicitly define individual attributes, their allowed values and value types as well as a description. One package providing tools for creating such models is pydantic.
It is to be explored in how far the handling of metadata from the source products and target ARD product can be formalized with a (pydantic) data model.
The metadata attribute names were largely adapted from the CEOS-ARD specifications, see in particular the SAR metadata spec XLSX file here. Also, A STAC extension card4l is available, which is currently being replaced by a new ceos-ard extension. The OGC standard can be found here.
The modules
cesard.metadata.stacandcesard.metadata.xmlcontain functions for creating metadata files in STAC JSON and OGC EO XML standard, respectively. As input they get a nested dictionary of typedict[str, dict[str, int | float | str | list[str] | datetime.datetime]], which needs to be created by the satellite-specific packages, e.g. s1ard.metadata.extract.meta_dict.This complex nested dictionary structure is very hard to maintain thus making it hard for authors of new satellite-specific ARD packages to keep an overview of which attributes are required.
A formal metadata model (or multiple) could explicitly define individual attributes, their allowed values and value types as well as a description. One package providing tools for creating such models is pydantic.
It is to be explored in how far the handling of metadata from the source products and target ARD product can be formalized with a (pydantic) data model.
The metadata attribute names were largely adapted from the CEOS-ARD specifications, see in particular the SAR metadata spec XLSX file here. Also, A STAC extension card4l is available, which is currently being replaced by a new ceos-ard extension. The OGC standard can be found here.