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.7.tar.gz (178.8 kB view details)

Uploaded Source

Built Distributions

cigsegy-1.1.7-cp312-cp312-win_amd64.whl (218.1 kB view details)

Uploaded CPython 3.12 Windows x86-64

cigsegy-1.1.7-cp312-cp312-manylinux2014_x86_64.whl (278.7 kB view details)

Uploaded CPython 3.12

cigsegy-1.1.7-cp312-cp312-macosx_14_0_arm64.whl (207.6 kB view details)

Uploaded CPython 3.12 macOS 14.0+ ARM64

cigsegy-1.1.7-cp311-cp311-win_amd64.whl (218.0 kB view details)

Uploaded CPython 3.11 Windows x86-64

cigsegy-1.1.7-cp311-cp311-manylinux2014_x86_64.whl (279.2 kB view details)

Uploaded CPython 3.11

cigsegy-1.1.7-cp311-cp311-macosx_14_0_arm64.whl (207.6 kB view details)

Uploaded CPython 3.11 macOS 14.0+ ARM64

cigsegy-1.1.7-cp310-cp310-manylinux2014_x86_64.whl (277.6 kB view details)

Uploaded CPython 3.10

cigsegy-1.1.7-cp310-cp310-macosx_14_0_arm64.whl (206.4 kB view details)

Uploaded CPython 3.10 macOS 14.0+ ARM64

cigsegy-1.1.7-cp39-cp39-win_amd64.whl (213.8 kB view details)

Uploaded CPython 3.9 Windows x86-64

cigsegy-1.1.7-cp39-cp39-manylinux2014_x86_64.whl (278.2 kB view details)

Uploaded CPython 3.9

cigsegy-1.1.7-cp39-cp39-macosx_14_0_arm64.whl (206.5 kB view details)

Uploaded CPython 3.9 macOS 14.0+ ARM64

cigsegy-1.1.7-cp38-cp38-win_amd64.whl (217.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

cigsegy-1.1.7-cp38-cp38-manylinux2014_x86_64.whl (277.5 kB view details)

Uploaded CPython 3.8

cigsegy-1.1.7-cp38-cp38-macosx_14_0_arm64.whl (206.3 kB view details)

Uploaded CPython 3.8 macOS 14.0+ ARM64

cigsegy-1.1.7-cp37-cp37m-win_amd64.whl (217.0 kB view details)

Uploaded CPython 3.7m Windows x86-64

cigsegy-1.1.7-cp37-cp37m-manylinux2014_x86_64.whl (283.9 kB view details)

Uploaded CPython 3.7m

cigsegy-1.1.7-cp36-cp36m-win_amd64.whl (220.3 kB view details)

Uploaded CPython 3.6m Windows x86-64

cigsegy-1.1.7-cp36-cp36m-manylinux2014_x86_64.whl (282.9 kB view details)

Uploaded CPython 3.6m

File details

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

File metadata

  • Download URL: cigsegy-1.1.7.tar.gz
  • Upload date:
  • Size: 178.8 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.7.tar.gz
Algorithm Hash digest
SHA256 79af2493668e04615c3a50967f4e249629d65ff5a3729bfad68eaf36cf97c914
MD5 bc1aac5f34eefadea949d933185387ed
BLAKE2b-256 147d1bf72c405a35206cb5e558ea5447f5d9cb700f5ff1aa6aba8b91000020ec

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cigsegy-1.1.7-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 218.1 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.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 d743c05e10d4020edccb1dc21976f7818ffae9025bc9dd96c62503b8d73e55b3
MD5 5e2801373999b13b45867b3b9491cf4d
BLAKE2b-256 cf2b509a5b96708513021e484eef6e5afdf2217bf7200f880ff7d5106b27cce1

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp312-cp312-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp312-cp312-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04561b2759d52e55a56e3e733d95a3d1e66b5ae9bb90e192042ad4dfd78ee885
MD5 230b1d416103726f0aa483e14e09d650
BLAKE2b-256 68a01dce7b8265c6a192a1e4382d9988dc8cbf2ef2b4baf61c334700f5923a78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp312-cp312-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 e53498e8cb77326d0994c29be382c87f1730e2bee4959c66c7b87386a18213c4
MD5 ad043b00c659365ef79b3862f482edcb
BLAKE2b-256 dcce72035011227c65b68fd86af5c61a33bb64af60a2f8c14306ddd7fed197ac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cigsegy-1.1.7-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 218.0 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.7-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b29b6c9b5a9764ddc16f868af173043ce435e1508d0e5584c521b8b696b3a24f
MD5 3e9b8c17f66a72498eb44055f5225540
BLAKE2b-256 fe28cb6ebddc73a0e622c8a1a72432459b556d6795196b79743b0179dc30b6a1

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp311-cp311-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp311-cp311-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c82636d179c0fbbd03da3c4530961981ab3553e27cba006d51f89c6cf5195e7
MD5 332487842902c229f7177dcf59620b0e
BLAKE2b-256 efd72767fd9ec8c267c6f24b2c87833cec56ecea9b65eeba61d44737c5900446

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp311-cp311-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 2ce8cee6a6a75b8720d4d536a8737b29f0a08df48faca882ba9aefff6af2921e
MD5 e98e0ccabd87fde42d5a1ad81abf2385
BLAKE2b-256 6dcb7fad18e46999285c7f8c30e412e839d77a342130e8f2674e6d3b484148d3

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp310-cp310-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp310-cp310-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8da5caeda8d473c9428efb5400cb653ddd96e01d6c98d9a62c5f511c7e2c19e1
MD5 be4943b43417b7666a0fdb6d8c4790c4
BLAKE2b-256 e98c088823e7b80a51b82e20ff9e24ce7457083f511399e5abe9822117bc5a02

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp310-cp310-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 ecb5b6b9fb8834877c24082d0661d0c810b097d1e097c435daed0e60accd247e
MD5 3467d9d26ceef5cbd9123d70832bbd3a
BLAKE2b-256 e8e58920cccaa749351eea16e01232c9690f4c26bb0d8f65e2d91a010e2ce389

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cigsegy-1.1.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 213.8 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.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 00392f83b40facc5a293cd3b53ee1e93290a055416c307d307f55b1f39555dbf
MD5 4173524b0008c26c8e3a6d5935c1c35e
BLAKE2b-256 fa22f5e8aa399245149cfd27db2daef1bfb5fa56959f809792eead9003829af2

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 85681da4fbbfd050b8c0920e404659cc743af8681b0cc2329b81945b81729ae8
MD5 d1880ca776f6940f87a4a6208916e077
BLAKE2b-256 e8a989d8af44372558ea30cae4fc1863d02fd388a3f707f4f75320f56459f3b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp39-cp39-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 d3a8a377d4528dc31087114adc855a1e7948794cd51be79ef310cfb06d7a3a6f
MD5 e38a4b3332f0dfd3ee7d03eaf2d71bd2
BLAKE2b-256 ffd27831db5adb47c6b68ed5a274c27ed18be5722b72eb0a6a4d587c53508386

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cigsegy-1.1.7-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 217.0 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.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 3d5b45c6df69e13ac60579828a5667664182b3d65fa68cda1eec8181ce18fa02
MD5 88ec85c49c07a6194979c692ac5aa0d3
BLAKE2b-256 b1d885554af276ffa0e1ea3827b134380880fed1d20eceb1dfd287870c4f9d67

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba0dfab4d7ee0ce532448123f1f6d239f787cb79385d70fead505801f0ab8bd8
MD5 f287e32c17e33f53a2e1b6170f709fff
BLAKE2b-256 8f5789f28e5a3e83d07f2f27415aed6361b955cb7fe9a60da6c0302dad984854

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp38-cp38-macosx_14_0_arm64.whl
Algorithm Hash digest
SHA256 05103602c1fa6e4ff98201754dc7e1391261dd583281f9ced33b6cbd8cca8905
MD5 61048a07e65e0cdab3f7a7eee5a2d6ab
BLAKE2b-256 7485f55a832b9f27de80a74d564245ebf974a9779553d90f21dafa2348052679

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cigsegy-1.1.7-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 217.0 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.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 869877b25a929d7d5520952b2349643dd71ca0655c5aefb5fc9dc4a6bcc7c289
MD5 b558b10e4b3a2317a2f93ff88fe39191
BLAKE2b-256 953ae5c3815468c1bd48baee05d3e56a7042d77f4a99a4083f7a66a83313709c

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ef748881dbb3159b4f0f08fa229b598c2beae8fc2ec12ef42800794c6fbf34ca
MD5 10ca60b113edd631112e639ea7ec51de
BLAKE2b-256 4b47df0342bd109306fda55257f519e73ec2a4b9b7c6b0f6425e16fac96b7263

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cigsegy-1.1.7-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 220.3 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.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 b157cff4072de4c21f2a16b7dc2ff083286dd28724dd52ffcf3a0b636711ce62
MD5 7231297b53daf026136efda38e242e04
BLAKE2b-256 6991339b17a732be6b117adef42cec338e2282758c855e0e37762db3f6f31065

See more details on using hashes here.

File details

Details for the file cigsegy-1.1.7-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for cigsegy-1.1.7-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 856c8eab52c08c718e8f3be1aaea74317e48a9d2d0ab47057eb6227e483198a4
MD5 823f03dd5eb1df07786ec7da1d728c60
BLAKE2b-256 9d719ec79d1f4eaa847dc665c5385935f3037929d77c6847807165169d911bdc

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