Skip to main content

Segpy is open source software created by Sixty North and licensed under the GNU Affero General Public License.

Alternative commercial license terms are available from Sixty North AS if you wish to redistribute Segpy as part of a proprietary closed source product or deliver software software-as-a-service (SaaS) using Segpy as part of a proprietary closed source service.

Status

Build status:

https://travis-ci.org/sixty-north/segpy.svg?branch=master Documentation Status https://coveralls.io/repos/github/sixty-north/segpy/badge.svg?branch=master

Installation

The segpy package is available on the Python Package Index (PyPI):

https://badge.fury.io/py/segpy.svg

The package supports Python 3 only. To install:

$ pip install segpy

What is Segpy?

The SEG-Y file format is one of several standards developed by the Society of Exploration Geophysicists for storing geophysical seismic data. It is an open standard, and is controlled by the SEG Technical Standards Committee, a non-profit organization.

This project aims to implement an open SEG-Y module in Python 3 for transporting seismic data between SEG-Y files and Python data structures in pure Python.

Basic Usage

Here’s a short example which converts non-standard little-endian SEG-Y to standard big-endian SEG-Y:

from segpy.reader import create_reader
from segpy.writer import write_segy

with open('seismic_little.sgy', 'rb') as segy_in_file:
    # The seg_y_dataset is a lazy-reader, so keep the file open throughout.
    seg_y_dataset = create_reader(segy_in_file, endian='<')  # Non-standard Rev 1 little-endian
    print(seg_y_dataset.num_traces())
    # Write the seg_y_dataset out to another file, in big-endian format
    with open('seismic_big.sgy', 'wb') as segy_out_file:
        write_segy(segy_out_file, seg_y_dataset, endian='>')  #  Standard Rev 1 big-endian

The create_reader() function creates Dataset which lazily fetches traces from the file, which is why the file must stay open for read for the duration of use of this dataset. We override the default endian paramers, to specify that the SEG-Y file we’re reading is in non-standard little-endian byte order. On the last line of the example we write the Dataset out to a different file, this time with standard compliant big-endian byte order. Note that the input file must remain open as the write_segy() will only request one trace at a time from the input dataset. This means overal memory usage is very low, and the program can handle arbitrarily large SEG-Y files.

Contributing

The easiest way to contribute is to use Segpy submit reports for defects or any other issues you come across. Please see CONTRIBUTING.rst for more details.

Development

Segpy was created by – and to meet the needs of – Sixty North. If you require additional features, improved performance, portability to earlier versions of Python, or specific defects fixed (such defects are marked ‘unfunded’ in the GitHub issue tracker) Sixty North’s experienced Segpy maintainers may be available to perform funded development work. Enquire with Sixty North at http://sixty-north.com.

Segpy Versions

Segpy 2.0 is a complete re-imagining of a SEG-Y reader in Python 3 and represents a complete break from any and all older versions of Segpy. No attempt has been made to maintain API compatibility with earlier versions of Segpy and no code is shared across versions. Although earlier versions of Segpy were open source, they were never ‘released’ as such. Earlier versions of Segpy are deprecated and completely unsupported.

Development

Deployment

$ pip install -e .[dev] $ bumpversion minor $ python setup.py sdist bdist_wheel $ twine upload –config-file <path>/sixty-north.pypirc dist/* $ git push origin

Metadata

Release files for segpy 2.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 segpy 2.1.0
File Size Uploaded
segpy-2.1.0.tar.gz 85.4 kB Details

Built distribution (wheel)

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

Total release size: 160.3 kB

Release files / segpy-2.1.0.tar.gz

Download URL segpy-2.1.0.tar.gz
Size 85.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ad42d2a94bb9f625cc879115a8846c79e0e8cc4dba3c7ef94f84b8d3d14893ab
BLAKE2b-256 checksum
How to use checksums
97e536e362837b62c208dbaeb1b4e3e331de33dbcdb2a595a8cdc81ac16cac7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release files / segpy-2.1.0-py3-none-any.whl

Download URL segpy-2.1.0-py3-none-any.whl
Size 74.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9660469b3784a05e13192d2956ef592d0d1cda6950c1607bef752c92641182c9
BLAKE2b-256 checksum
How to use checksums
385e1d5fc448d1225ee1e1a69ffc4c06f1b7fcf792deebea9452bfdc47ca04f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.3.3 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.1

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release 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