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.0.tar.gz (35.7 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.0-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pysegy-0.5.0.tar.gz
  • Upload date:
  • Size: 35.7 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.0.tar.gz
Algorithm Hash digest
SHA256 9cf1409746d9802c2989ce0bba2fb746e774cff627fb3430bc8b50e6141ace29
MD5 556ee38983654ddc2800f1b7015778cd
BLAKE2b-256 f6359954afc89ecf67635930116c9b7f319cd3fc957a78c991924ce57ec86732

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pysegy-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 36.7 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3aac3b5f89878838a9af2b7f5eb7cc8d7b4dad1672dea48462bab35f18eddf1
MD5 c48fecb66a5dbc3014fe664304aeb2e8
BLAKE2b-256 df6354d51a251d47e700d2a19624c1e6f80dc8d3dc5aa948f929cccd67f0305f

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.1

2 files

This release

0.5.0 This release

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