es_sfgtools.data_models.metadata.catalogs module
- class es_sfgtools.data_models.metadata.catalogs.CatalogType(value)
Bases:
Enum- Data = 'Data'
- MetaData = 'Meta-Data'
- class es_sfgtools.data_models.metadata.catalogs.MetaDataCatalog(*, name: str | None = '', networks: Dict[str, NetworkData] = {}, info: str | None = '', type: CatalogType)
Bases:
BaseModel- info: str | None
- classmethod load_data(path: str | Path | dict, name=None, info=None) MetaDataCatalog
Load a data catalog from a path or dictionary.
- Parameters:
path (str | Path | dict) – The path to the data file or a dictionary containing the data.
name (str, optional) – The name of the catalog, by default None.
info (str, optional) – Information about the catalog, by default None.
- Returns:
The loaded data catalog.
- Return type:
- classmethod load_metadata(data_path: Path, name=None, info=None) MetaDataCatalog
Load a metadata catalog from a path.
- Parameters:
data_path (Path) – The path to the data directory.
name (str, optional) – The name of the catalog, by default None.
info (str, optional) – Information about the catalog, by default None.
- Returns:
The loaded metadata catalog.
- Return type:
- model_computed_fields = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields = {'info': FieldInfo(annotation=Union[str, NoneType], required=False, default='', description='Optional catalog meta'), 'name': FieldInfo(annotation=Union[str, NoneType], required=False, default='', description='The catalog name'), 'networks': FieldInfo(annotation=Dict[str, NetworkData], required=False, default={}, description='Network catalog'), 'type': FieldInfo(annotation=CatalogType, required=True, description='Catalog Type (meta-data or data)')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- name: str | None
- networks: Dict[str, NetworkData]
- serialize_type(value: CatalogType) str
- show()
Displays an abridged structured representation of the catalog data.
This is displayed in JSON format.
The method organizes the data into a nested dictionary structure. The output format depends on the catalog type: - For “Meta-Data”, it includes networks, stations, campaigns, and
surveys.
For “Data”, it includes networks, stations, and their shotdata.
The resulting dictionary is serialized into a JSON string and printed with indentation for readability.
- Raises:
AttributeError – If the object structure does not match the expected attributes.
Examples
>>> catalog_dir = Path("/path/to/catalog/directory") >>> DATA = Catalog.load_metadata(data_path,name="sfg metadata",info="metadata for sfg") { "alaska-shumagins": { "IVB1": { "name": "2022_A_1049", "start": "2022-07-17T13:42:19.870000", "end": "2022-07-24T11:18:33.870000", "surveys": [ { "survey_id": "2022_A_1049_1", "start": "2022-07-17T13:42:19.870000", "end": "2022-07-18T11:33:33.870000" }, { "survey_id": "2022_A_1049_2", "start": "2022-07-18T13:42:19.870000", "end": "2022-07-21T11:18:33.870000" } ] }, } >>> Outputs the JSON representation of the catalog data to the console.
- type: CatalogType
- class es_sfgtools.data_models.metadata.catalogs.NetworkData(*, name: str, stations: Dict[str, StationData | Site] = {})
Bases:
BaseModel- model_computed_fields = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields = {'name': FieldInfo(annotation=str, required=True, description='The network name'), 'stations': FieldInfo(annotation=Dict[str, Union[StationData, Site]], required=False, default={}, description='Stations in the network')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- name: str
- stations: Dict[str, StationData | Site]
- class es_sfgtools.data_models.metadata.catalogs.StationData(*, name: str, shotdata: str = None, shotdata_pre: str = None, kinpositiondata: str = None, gnssobsdata: str = None, gnssobsdata_secondary: str = None, imupositiondata: str = None, acousticdata: str = None)
Bases:
BaseModel- acousticdata: str
- gnssobsdata: str
- gnssobsdata_secondary: str
- imupositiondata: str
- kinpositiondata: str
- model_computed_fields = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields = {'acousticdata': FieldInfo(annotation=str, required=False, default=None, description="The station's acoustic data TileDB URI"), 'gnssobsdata': FieldInfo(annotation=str, required=False, default=None, description="The station's raw gnss observables TileDB URI"), 'gnssobsdata_secondary': FieldInfo(annotation=str, required=False, default=None, description="The station's secondary gnss observables TileDB URI"), 'imupositiondata': FieldInfo(annotation=str, required=False, default=None, description="The station's position data TileDB URI"), 'kinpositiondata': FieldInfo(annotation=str, required=False, default=None, description="The station's RINEX derived position TileDB URI"), 'name': FieldInfo(annotation=str, required=True, description="The station's name"), 'shotdata': FieldInfo(annotation=str, required=False, default=None, description="The station's shotdata TileDB URI"), 'shotdata_pre': FieldInfo(annotation=str, required=False, default=None, description='Pre-update shotdata')}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- name: str
- shotdata: str
- shotdata_pre: str