Skip to main content

tilesegy

Tilesegy is a small MIT licensed Python library for easy interaction with seismic data, powered by TileDB. It combines an intuitive, segyio-like API with a powerful storage engine.

Feature summary

Available features

  • Converting from SEG-Y and Seismic Unix formatted seismic data to TileDB arrays.
  • Simple and powerful read-only API, closely modeled after segyio.
  • 100% unit test coverage.
  • Fully type-annotated.

Currently missing features

  • API for write operations.
  • Converting back to SEG-Y.
  • TileDB configuration and performance tuning.
  • Comprehensive documentation.
  • Real-world usage.

Installation

Tilesegy can be installed

  • from PyPI by pip:

    pip install tilesegy
    
  • from source by cloning the Git repository:

    git clone https://github.com/gsakkis/tilesegy.git
    cd tilesegy
    python setup.py install
    

    You may run the test suite with:

    python setup.py test
    

Converting from SEG-Y

Tilesegy comes with a commandline interface (CLI) called segy2tiledb for converting SEG-Y and Seismic Unix formatted files to TileDB formatted arrays. At minimum it takes an input file and generates a tilesegy directory at the same parent directory with the input and extension .tsgy:

$ segy2tiledb a123.segy
$ du -sh a123.*
73M a123.sgy
55M a123.tsgy

To see the full list of options run:

$ segy2tiledb -h
usage: segy2tiledb [-h] [-o] [-g {auto,structured,unstructured}] [--su]
                   [--iline ILINE] [--xline XLINE]
                   [--endian {big,msb,little,lsb}] [-s TILE_SIZE]
                   [--consolidation-buffersize CONSOLIDATION_BUFFERSIZE]
                   input [output]

Convert a segy file to tilesegy format

positional arguments:
  input                 Input segy file path
  output                Output tilesegy directory path (default: None)

optional arguments:
  -h, --help            show this help message and exit
  -o, --overwrite       Overwrite the output directory if it already exists (default: False)
  -g {auto,structured,unstructured}, --geometry {auto,structured,unstructured}
                        Geometry of the converted tilesegy:
                        - auto: same as the input segy.
                        - structured: same as `auto` but abort if a geometry cannot be inferred.
                        - unstructured: opt out on building geometry information.
                         (default: auto)

segyio options:
  --su                  Open a seismic unix file instead of SEG-Y (default: False)
  --iline ILINE         Inline number field in the trace headers (default: 189)
  --xline XLINE         Crossline number field in the trace headers (default: 193)
  --endian {big,msb,little,lsb}
                        File endianness, big/msb (default) or little/lsb (default: big)

tiledb options:
  -s TILE_SIZE, --tile-size TILE_SIZE
                        Tile size in bytes.
                        Larger tile size improves disk access time at the cost of higher memory (default: 4000000)
  --consolidation-buffersize CONSOLIDATION_BUFFERSIZE
                        The size in bytes of the attribute buffers used during consolidation (default: 5000000)

API

Tilesegy generally follows the segyio API so you may consult its excellent documentation to learn about the public attributes (ilines, xlines, offsets, samples) and addressing modes (trace, header, attributes', iline, xline, fast, slow, depth_slice, gather, text, bin).

You can find usage examples in the included Jupyter notebook.

The following list outlines the main differences from segyio:

  • Probably the biggest difference is that addressing modes that return a generator of numpy arrays in segyio, in tilesegy return a single numpy array of higher dimension(s). For example, in a SEG-Y with 50 ilines, 20 xlines, 100 samples, and 3 offsets:

    • f.iline[0:5]:
      • segyio returns a generator that yields 5 2D numpy arrays of (20, 100) shape
      • tilesegy returns a 3D numpy array of (5, 20, 100) shape
    • f.iline[0:5, :]:
      • segyio returns a generator that yields 15 2D numpy arrays of (20, 100) shape
      • tilesegy returns a 4D numpy array of (5, 3, 20, 100) shape
  • The mappings returned by bin, header and attributes(name) have string keys instead of segyio.TraceField enums or integers.

  • tilesegy.open(dir_path), the segyio.open(file_path) equivalent, does not currently take any optional parameters (e.g. strict or ignore_geometry).

  • tilesegy exposes two classes, TileSegy for unstructured SEG-Y and StructuredTileSegy for structured.

    • StructuredTileSegy extends TileSegy, so the whole unstructured API is inherited by the structured.
    • All attributes and addressing modes specific to structured files (e.g. ilines or gather) are available only to StructuredTileSegy. In contrast segyio returns None or raises an exception if these properties are accessed on unstructured files.
    • There is no unstructured attibute; use not isinstance(f, StructuredTileSegy) instead.
  • There is no tracecount attribute; use len(trace) instead.

  • There is no ext_headers attribute; use len(text[1:]) instead.

Metadata

Release files for tilesegy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tilesegy 0.1.0
File Size Uploaded Provenance
tilesegy-0.1.0.tar.gz 12.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for tilesegy 0.1.0
File Interpreter ABI Platform
tilesegy-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.2 kB

Release files / tilesegy-0.1.0.tar.gz

Download URL tilesegy-0.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
351fb7ed5d5d4a1aa03cf866fb474e70696d1cc5d5e20f5bafd5ea74ac1365ce
BLAKE2b-256 checksum
How to use checksums
0cd2735736b331f8adb4e2db87dc12cb56a54a52e05474873d8af62f99c3ed1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.10

Release files / tilesegy-0.1.0-py3-none-any.whl

Download URL tilesegy-0.1.0-py3-none-any.whl
Size 14.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
50c0acc514b4fce3720ec47be5e2115f4bb0b6a167cbce994e8e5682ca68ba46
BLAKE2b-256 checksum
How to use checksums
46ce9d85009f69f544d708d41763b77cf049d5b92ae3c3ef051e81472717c2d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.3.1 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.6.10

Security for tilesegy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page