Open
Description
Overview
Purpose: Create a registry to manage MDIO schema templates for SEG-Y file ingestion.
Key Features:
- Register templates (e.g., MDIO schemas) with unique identifiers.
- Retrieve templates by their identifiers for use in processing SEG-Y files.
- Support extensibility to add new templates without modifying existing code.
Requirements
- Registry must be stateful within the Python interpreter.
- Pre-defined templates (in code) should be auto-registered
- Newly registered templates should be available within the process as soon as they're registered.
- Names must be unique and raise an error if we attempt to overwrite them
Example Signature
class SeismicTemplateRegistry:
_templates: Dict[str, MDIOTemplate] = {}
@classmethod
def register(cls, name: str, template: MDIODatasetV1) -> None:
"""Register a template with its name as the key."""
...
@classmethod
def get(cls, name: str) -> MDIODatasetV1:
"""Retrieve a template by its name."""
...
@classmethod
def list_templates(cls) -> list[str]:
"""List all registered template names."""
...
Usage Examples
Registration
Somewhere within the MDIO library (probably __init__.py
somewhere)
def initialize_registry():
SeismicTemplateRegistry.register(...)
SeismicTemplateRegistry.register(...)
Usage
from mdio.module.path import SeismicTemplateRegistry
if __name__ == "__main__":
print("Available templates:", SeismicTemplateRegistry.list_templates())
# Retrieve and use a template
template = SeismicTemplateRegistry.get("PostStackDepth3DMigrated")
# Use template to make new MDIO
Example Template Names
These will be more concretely defined in #564. However here are some examples.
PostStackDepth3DMigrated
: Post-stack, depth-migrated 3D seismic data.
PostStackTime3DMigrated
: Post-stack, time-migrated 3D seismic data.
ShotRaw3DStreamer
: Raw shot data from 3D streamer acquisition.
ShotRaw3DOBN
: Raw shot data from 3D ocean-bottom node (OBN) acquisition.
PreStackCDP3DGathers
: Pre-stack common depth point (CDP) gathers for 3D data.
PreStackAngle3DGathers
: Pre-stack angle gathers for 3D seismic data.