Skip to main content

No project description provided

Project description

logo

A SEG-Y tool developed by Computational Interpretation Group (CIG)

cigsegy is a tool for exchanging data between SEG-Y format and NumPy array inside Python environment.

It can be used to read and convert a SEG-Y format data into a Numpy array, even if the SEG-Y format data is missing some traces or its inline/crossline step is not equal to 1.

It can also be used to create a SEG-Y format data from a Numpy array. In this mode, users can use headers from a existed SEG-Y file or create new headers by setting some parameters.

Tutorial and reference documentation is provided at cigsegy.readthedocs.io. And the source code is always available at github.com/JintaoLee-Roger/cigsegy.

Core Features

  • Fast (Implemented in c++)

  • python wraping and numpy array supports

  • dealing with normal and irregular SEG-Y volume [1].

  • creating a SEG-Y file using the existed header of a SEG-Y

Quick Start

  1. Install cigsegy via PyPi

pip install cigsegy
  1. Print the 3200 bytes textual header of a SEG-Y file

>>> import cigsegy
>>> cigsegy.textual_header('rogan.sgy')
# C01 CLIENT: STUART PETROLEUM LTD    AREA:COOPER BASIN   SOUTH AUSTRALIA
# ...
# C06 INLINE RANGE: 360 - 1684(2)  CROSSLINE RANGE 1764 - 2532(1)
# C07 -------------PROCESSING FLOW---------------
# ...
# C35  DESC                   BYTE LOCATION       FORMAT
# C36  3D INLINE NUMBER        9- 12             32 BIT INTEGER
# C37  3D CROSSLINE  NUMBER   21- 24             32 BIT INTEGER
# C38  CDP_X                  73- 76             32 BIT INTEGER
# C39  CDP_Y                  77- 80             32 BIT INTEGER
# C40

You can get some key information to read the SEG-Y file, such as inline location is 9 (C36), crossline location is 21 (C37), X location is 73 (C38), Y location is 77 (C39), inline step is 2 (C06), crossline step is 1 (C06).

  1. Scan the SEG-Y file and get some meta information

>>> cigsegy.metaInfo('rogan.sgy', iline=9, xline=21, istep=2, xstep=1, xloc=73, yloc=77)
# In python, the shape is (n-inline, n-crossline, n-time) = (663, 769, 1001).

# shape: (n-time, n-crossline, n-inline) = (1001, 769, 663)
# sample interval: 4000, data format code: 4-bytes IBM floating-point
# inline range: 360 - 1684, crossline range: 1764 - 2532
# interval of inline: 35.0, interval of crossline: 17.5, time start: 0
# inline field: 9, crossline field: 21
# inline step: 2, crossline step: 1
# Is regular file (no missing traces): false

You will get some information about this SEG-Y file, such as, the data shape, intervals, data format …

  1. Read the SEG-Y

Please note that the shape is like (n-inlines, n-crosslines, n-time_samples)

>>> d = cigsegy.fromfile('rogan.sgy', iline=9, xline=21, istep=2, xstep=1)
>>> d.shape
# (663, 769, 1001)

If you need a binary file without any headers, i.e., save the numpy array

>>> cigsegy.tofile('rogan.sgy', 'out.dat', iline=9, xline=21, istep=2, xstep=1)
  1. Create a SEG-Y using a numpy array and headers from another SEG-Y file

There is often such a workflow:
  1. Display SEG-Y format data orig.segy in specialized software, such as Petrel.

  2. Use Python code to process this data and obtain new data afterprocess, which is in NumPy array format

  3. To display this processed data in specialized software, it needs to be converted back to SEG-Y format and use the headers from the original data, i.e., using the NumPy array afterprocess and the header of orig.segy to create a new SEG-Y file out.segy.

# assume the iline/xline/istep/xstep of **orig.segy** are 9/21/1/1
>>> cigsegy.create_by_sharing_header('out.segy', 'orig.segy', afterprocess, \
    iline=9, xline=21, istep=1, xstep=1)
  1. Create a SEG-Y using a numpy array and some parameters

# d is a numpy array, d.shape == (n-inlines, n-crosslines, n-time)
>>> cigsegy.create('out.segy', d, format=5, start_time=0, iline_interval=15, ...)
  1. Access the SEG-Y file as a 3D numpy array, without reading the whole file into memory

>>> from cigsegy import SegyNP
>>> d = SegyNP('rogan.sgy', iline=9, xline=21)
>>> d.shape # (ni, nx, nt), use as a numpy array, 3D geometry
>>> sx = d[100] # the 100-th inline profile
>>> sx = d[100:200] # return a 3D array with shape (100, nx, nt)
>>> sx = d[:, 200, :] # the 200-th crossline profile
>>> sx = d[:, :, 100] # the 100-th time slice, note, it may be slow if the file is large
>>> sx.min(), sx.max()
# get the min and max value, but they are evaluated from a part of data,
# so they may not be the real min and max value
>>> sx.trace_cout # get the number of traces for the file

License

cigsegy is provided under a MIT license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.

TODO

  • Add convenient function to support unsorted prestack gathers.

Citations

If you find this work useful in your research and want to cite it, please consider use this:

Plain Text

Li, Jintao. "CIGSEGY: A tool for exchanging data between SEG-Y format and NumPy array inside Python environment". URL: https://github.com/JintaoLee-Roger/cigsegy

BibTex

@misc{cigsegy,
author = {Li, Jintao},
title = {CIGSEGY: A tool for exchanging data between SEG-Y format and NumPy array inside Python environment},
url = {\url{https://github.com/JintaoLee-Roger/cigsegy}},
}

Project details


Download files

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

Source Distribution

cigsegy-1.1.8.tar.gz (181.1 kB view details)

Uploaded Source

Built Distributions

cigsegy-1.1.8-cp312-cp312-win_amd64.whl (220.5 kB view details)

Uploaded CPython 3.12 Windows x86-64

cigsegy-1.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (313.8 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

cigsegy-1.1.8-cp312-cp312-macosx_14_0_arm64.whl (204.3 kB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

cigsegy-1.1.8-cp311-cp311-win_amd64.whl (220.5 kB view details)

Uploaded CPython 3.11 Windows x86-64

cigsegy-1.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (313.3 kB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

cigsegy-1.1.8-cp311-cp311-macosx_14_0_arm64.whl (204.3 kB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

cigsegy-1.1.8-cp310-cp310-win_amd64.whl (219.4 kB view details)

Uploaded CPython 3.10 Windows x86-64

cigsegy-1.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (312.0 kB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

cigsegy-1.1.8-cp310-cp310-macosx_14_0_arm64.whl (203.1 kB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

cigsegy-1.1.8-cp39-cp39-win_amd64.whl (216.3 kB view details)

Uploaded CPython 3.9 Windows x86-64

cigsegy-1.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (312.4 kB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

cigsegy-1.1.8-cp39-cp39-macosx_14_0_arm64.whl (203.1 kB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

cigsegy-1.1.8-cp38-cp38-win_amd64.whl (219.5 kB view details)

Uploaded CPython 3.8 Windows x86-64

cigsegy-1.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (312.0 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

cigsegy-1.1.8-cp38-cp38-macosx_14_0_arm64.whl (202.9 kB view details)

Uploaded CPython 3.8 macOS 14.0+ ARM64

cigsegy-1.1.8-cp37-cp37m-win_amd64.whl (219.5 kB view details)

Uploaded CPython 3.7m Windows x86-64

cigsegy-1.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (318.8 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

cigsegy-1.1.8-cp36-cp36m-win_amd64.whl (223.6 kB view details)

Uploaded CPython 3.6m Windows x86-64

cigsegy-1.1.8-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (318.7 kB view details)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

File details

Details for the file cigsegy-1.1.8.tar.gz.

File metadata

  • Download URL: cigsegy-1.1.8.tar.gz
  • Upload date:
  • Size: 181.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8.tar.gz
Algorithm Hash digest
SHA256 e357d0ab62615c35f43a9898146ce67a1da99edbe83fcdae3e316b4c12d29424
MD5 ef2558e52f739f62ec95d5e65ada6ff4
BLAKE2b-256 63c041a7cc701951f2b41f84193dcaff22c1305758854778feeb5218776a5837

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 220.5 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 51af5aa2eda0447bdd3e5b18c3efaee64f6cc8a844a327ac1c9808dcb2072c13
MD5 7cbc48f9bf9ed6f1261dd5d055fc884c
BLAKE2b-256 b5b023cbf0ee2d553d7215b24931cf4744cbf31b929140666ab58700a18f7ca0

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4cad724029e68f858884804bb1aa8354aa7ab4e206366dd79fddbf31762a60a
MD5 a387f033ddb1c7f59ee5c698c9b0395a
BLAKE2b-256 685317b7dc00a2dda774afb116a924819e2ed010cfefaee6ff18c91165c69f67

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp312-cp312-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 3dbd6dc4778e532464d45f3ea8a5943124d0cd031de600ac318885a723d96042
MD5 2c8e75e959c4b74bad18ea958eabd010
BLAKE2b-256 a303f192e311fa8e90b2ae2600b000be1c64950689b098111165e0bb219a8b5a

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 220.5 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 42ba9970569dc789e68d0fa635df079de362c419f0c2d0dabf3e11e2b817fb31
MD5 72d4637b262c80d1ef8282aa26c76bc7
BLAKE2b-256 f4bdfce3cde826584ed9383eec360c8b7f53b2c592e1a2e68224185499a99b2e

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c6267b11d2ad4785d0ff85442ab3f23150d5684d0f87f9475cd3ec80214f7a63
MD5 ceea388b8beaab1e28c992d167e6efba
BLAKE2b-256 7a5ecf638a4cad8c7e29bb2fedd9be5ea08da6c555ac540945922f15cbb06b78

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp311-cp311-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 100f5c913b508c87972984a715a5386509ecc661e1ed9aa9acf561f0a493d400
MD5 f57f57501ea3b6f562a5adad558a67fb
BLAKE2b-256 d107ea0b8dda27f007811c7ab9b52dae0219217723c41ee718275a22c3726fc2

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 219.4 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 54810188ba90cdd8724fb14be8c46ffc707362b374497f1d1f2a1ec68a8a4846
MD5 8f1cbeada20b05f9cc80207b55f8b22b
BLAKE2b-256 fcbcc570c40f45dc552db82cf654cb8b3c9df9cb8e7718ce9cb9140307448383

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0cf8f3d68fbb9e62c3110bdb9d473138a3224fb839f7fd99daeaf14e780da82c
MD5 655c0f9237bec11af93f63211dc299af
BLAKE2b-256 53fcee8405a566577e949cd49f256815bdfc6a39a6d86fb4e38305f0b00bb817

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp310-cp310-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 5bb344d6f1eef66c0bbe9757754d90fdaa299e4a9d1241a39b9caeb9b5264865
MD5 b89429b2044a5fb11f21f3f9d3bb14fe
BLAKE2b-256 400f9f1b604822bcf5d4fa2519741c72e9d5e872660de2001e6b61f25075b127

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 216.3 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 31346d618d3d7d284085e33493194d7076bc18f6f3e5b5642abb9ac9356e1627
MD5 b862a8f4c7658a4879389fdb1eba7f6c
BLAKE2b-256 f51cd9b3f26ba53ed7cb11617710a8be394659a883eb79bee323d6493bd9a5a6

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 517562dfad051145d2bec923bfecefeb4f51b2d4a77211389156f9da0fa5fdbb
MD5 d3a0361cc35911ea6e7d96030dc06ba1
BLAKE2b-256 93debf3ebaefd9bcc2160906ea373ebdf92a9a231942d135e00e7415c3bb22b6

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp39-cp39-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 4b61b4bd8f4ff2eeeab36900a8c05839d2bf5456cb26f2a7a43faf2054732678
MD5 fbadbd70abe08976b645557118eceb9d
BLAKE2b-256 ff252700dc287afc7cd50f0ee006820739593b7f189ceff2d220820c9dbbb130

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 219.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 10b109ea96140ac635d5e10d3587a5e0cc4a1f77551a3acddfc20f4a7caf52d2
MD5 894ec6d814890339b6466e87caedbbe3
BLAKE2b-256 63d274d8e121b64a20c6b0c1ea46f4e0e77dbf9d207272ff4637a1c86f80f3f3

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b69235f77f45462794571402f335b2341dd3f1fa53c27371ac6bc3571a3f52c
MD5 d37809c3a79b3568658855309774d5ae
BLAKE2b-256 7906b5cddc6c1b04111df8e15d4d99790b271b687692b56d419adf1b86fccd45

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp38-cp38-macosx_14_0_arm64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 f9933e19f7247121dfa3a78bf2b9d8b9ce4e9638730977214649bf9ab3fcef36
MD5 1d99000d7726f9a51b117bcdc92c0c78
BLAKE2b-256 d953392f6735aaf565a7753ebf95301dfd56f9ef80e7f486925b633ef9111d81

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 219.5 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 f7ab966ea0a7f49b18386926731cf9f66d6bb9600cf338c39b93a21dccdaa8bd
MD5 352af5efed8f0eb81e34608d70d91a3d
BLAKE2b-256 c25cab579134ef2f07231721f21c3f90d415ca6d4b8ab3b09c0b926ba5f69c2c

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d53bd102b671fb6dfa587c51b173f6f8e4970bf5fd0eea0b24c9476d23ddcf6c
MD5 0f926b7aa58efc88895a66972f0a922e
BLAKE2b-256 ffdefb31519f2fef210fd9b95e2f4240704c49e5e79d70b82a32f63c30b22ff4

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: cigsegy-1.1.8-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 223.6 kB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for cigsegy-1.1.8-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 49d42d04ab46172a50bb1e6f166dd185462d7552ee6216c21914c2c125499286
MD5 9c4c1478c2ed497da6dfcab8bd09cb8f
BLAKE2b-256 3ee4e000f65f6a9cca3c4e3c28cb274cda4afe22871599dfd291e9665cfa762b

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.8-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.8-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 047c7a4e8308bb44f2115bcd01ece350c475b8a512e3936f1f1221830790006f
MD5 06d9687d8cb6fc3d2bca23152e17abe9
BLAKE2b-256 5ccaa81676ad8141c2c82b3f3de5709fe7d72481ced62a3eee824ce1a9169786

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page