Skip to main content

pysegy

CI Docs codecov PyPI version

pysegy is a minimal Python library for working with SEGY Rev 1 data. The project provides helpers to read and write files as well as utilities to scan large surveys without loading every trace in memory.

Capabilities

  • Read complete SEGY files with segy_read and access both binary and trace headers.
  • Write new data sets using segy_write from NumPy arrays.
  • Lazily inspect large archives via segy_scan and the SegyScan object.
  • Retrieve individual header fields with automatic scaling through get_header.
  • Compatible with any fsspec filesystem for local or remote storage.

Installation

Install the project in editable mode from the repository root:

python -m pip install -e .

Or to install the latest pypi release

pip install pysegy

Testing

Run the unit tests with pytest:

pytest -vs

The tests run automatically on GitHub Actions with coverage reports uploaded to Codecov.

Scan benchmark

The scan benchmark compares sequential and threaded scanning of a file or directory:

python benchmarks/scan_benchmark.py /path/to/large.segy
python benchmarks/scan_benchmark.py /path/to/survey --pattern '*.segy'

Without an argument the bundled data directory is scanned. Threading pays off once several files or many shots are involved; a single small file is dominated by the fixed cost of opening it.

Inspiration

This project started as a lightweight port of the Julia package SegyIO.jl. The goal is to provide a similar user experience for Python while keeping the code base small and easy to understand.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pysegy-0.5.1.tar.gz (36.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pysegy-0.5.1-py3-none-any.whl (37.6 kB view details)

Uploaded Python 3

File details

Details for the file pysegy-0.5.1.tar.gz.

File metadata

  • Download URL: pysegy-0.5.1.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pysegy-0.5.1.tar.gz
Algorithm Hash digest
SHA256 1f3b9f2c441d4c85e02b231608c428ec41b4cf7c52207ffc2178284b98c410e3
MD5 ccb3a6fee7654336481f6f15764e049a
BLAKE2b-256 f13326e2fa208658af49198c03b3a8d8ccca9d06508757ef8fe20d9851d82840

See more details on using hashes here.

File details

Details for the file pysegy-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: pysegy-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for pysegy-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b7ed5054c0fac58b09127440df27f0798845bb0fb3d6ac598d2ac653c0ff484
MD5 88225e357ad7cc2e42b56f9d0e847f5e
BLAKE2b-256 79c023bf6e7f197788e264250cd54533748d9af79018050a891fa9102e243e9b

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 files

0.5.0

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.0

1 file

0.3.0

1 file

0.2.0

2 files

0.0.0

2 files

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