Skip to content

Add seismic geometry abstractions #112

Description

@tasansal

It would be nice to have geometry abstractions for standard interface and custom / geometry specific exception handling.

This has the following pros:

  1. Common interface for coordinate conversions.
  2. Trace iterators based on the type of data.
  3. Enforce usage of methods for geometry instances that may be added later.
  4. Improve maintainability.
  5. Allow custom things to be added, i.e., for shots, we add the conversion from unwrapped channels to wrapped channels unwrap_channels, and we still have a base implementation that should follow the extensible interface.
  6. Encapsulate the logic for geometry specific chunk size and access pattern configurations

Long shot, but cython or numba jit versions may be even better. xarray can also be used to handle named dimensions etc.

Would inherit from a base class like

# mdio/segy/geometry.pyfromabcimportABCclassSeismicGeometry(ABC):
def__init__(self, args, kwargs):
...
@abstractmethoddef__iter__(self):
...
@abstractmethoddef__getitem__(self):
...
@abstractmethoddefxy_to_grid(self, x, y, method="nearest"):
...
@property@abstractmethoddefnum_traces(self):
...

Then we would have 3D as something like

frommdio.segy.geometryimportSeismicGeometryclassSeismicStack3d(SeismicGeometry):
def__init__(self, inlines, crosslines, samples):
# set attributes, initialize grid etc.def__iter__(self):
# logic to iterate traces on spatial il/xl grid@abstractmethoddefxy_to_grid(self, x, y, method="nearest"):
# logic to convert CDP-X CDP-Y to inline and crossline@propertydefnum_traces(self):
returnself.get_size("inline") *self.get_size("crossline")

Or 3D shots like

frommdio.segy.geometryimportSeismicGeometryclassSeismicShot3d(SeismicGeometry):
def__init__(self, shots, cables, channels, samples):
# set attributes, initialize grid etc.def__iter__(self):
# logic to iterate traces on shot grid@abstractmethoddefxy_to_grid(self, x, y, method="nearest"):
# logic to convert SHOT-X SHOT-Y to shot number@propertydefnum_traces(self):
returnself.get_size("shot") *self.get_size("cable") *self.get_size("channel")
@defunwrap_channels(self, channels_per_streamer: int):
returnself.channel%channels_per_streamer+1

and so on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions