Skip to main content

A tool for converting images to SEG-Y

Project description

A tool for converting images to SEG-Y files.

Installation

Install img2segy from the PyPI with pip:

python -m pip install img2segy

or if you have pipx and only want to run img2segy from the command line:

pipx install img2segy

Basic usage

Given an image file, such as a my_cross_section.png containing a vertical cross-section provide information about the location of the image in a text (TOML) file called my_cross_section.toml, and run the img2segy convert command, supplying the image filename. If the TOML file has the same filename stem it will be discovered and used:

img2segy convert my_cross_section.png

The resulting SEG-Y file will be called my_cross_section.segy.

Configuration file format

The configuration file contains subsections which describe the position of the image in geographical space, the coordinate reference system in use, and control over how the image should be represented in SEG-Y:

[position]
left.x = 527501
left.y = 4840781

right.x = 527326
right.y = 4829018

depth.top = 0
depth.bottom = 4300

[coordinate-reference-system]
map-projection = "WGS-84 UTM"
zone-id = 15
horizontal-units = "m"
vertical-units = "m"

[segy]
# encoding = "ASCII"
# byte-order = ">"
trace-position.use-source-coord-fields = true
trace-position.use-group-coord-fields = true
trace-position.use-cdp-coord-fields = true
trace-number.use-trace-number-field = true
trace-number.use-crossline-number-field = true

base-trace-number = 1

Some of the fields, such as map-projection are ignored, but it’s wise to include them anyway so that the date is more self-documenting and the meaning of the numbers is clear to others and your future self.

The [position] section contains information which locates the corners of the supplied image in geographical space. The left.x and left.y entries are the geographic eastings and northings respectively of the left edge of the image. Similarly, the right.x and right.y entries are the geographic eastings and northings respectively of the right edge of the image. The depth.top and depth.bottom entries give the depths of the top and bottom edges of the image.

The number of traces in the resulting SEG-Y file will be equal to the horizontal number of pixels across the supplied image. The number of samples per trace will be equal to the vertical number of pixels down the image. If you want a different number of traces or samples than that which corresponds to the pixel dimensions of the image, you should pre-process the image using other tools before converting to SEG-Y.

The [[segy]] section specifies how the SEG-Y data will be written and controls which header fields are used, and for what.

The optional trace-position entries trace-position.use-source-coord-fields, trace-position.use-group-coord-fields and trace-position.use-cdp-coord-fields control whether the horizontal component of geographic position of the trace, as linearly interpolated between the two end points of the image, it written into the corresponding trace-header fields.

The trace-number entries trace-number.use-trace-number-field and trace-number.use-crossline-number-field control whether an integer trace number is written into the corresponding trace-header fields. By default, the left-most column of pixels will be given a trace-number of zero. You can control this by setting base-trace-number to some other value, such as one. If you need trace numbering to start from the right edge of the image, you should flip the image left-to-right before using img2segy.

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

img2segy-1.1.3.tar.gz (22.2 kB view details)

Uploaded Source

Built Distribution

img2segy-1.1.3-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file img2segy-1.1.3.tar.gz.

File metadata

  • Download URL: img2segy-1.1.3.tar.gz
  • Upload date:
  • Size: 22.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for img2segy-1.1.3.tar.gz
Algorithm Hash digest
SHA256 9096c1b0614c0322f65295ed2f27b99dcc2a97815471943945106519c34af9f4
MD5 249ace14003b7652bb99a9a739148b4d
BLAKE2b-256 77d0461b7f45a6cac71ff81fd52db270b5b66dd23b98bcd1ab7cd000f79a31e7

See more details on using hashes here.

File details

Details for the file img2segy-1.1.3-py3-none-any.whl.

File metadata

  • Download URL: img2segy-1.1.3-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for img2segy-1.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca12bf1a36b7259cc9f4350386ae6809b96fd5c5e4a19c163d8f20f0bc917af8
MD5 fd05ef593845445f3c287f247e15c602
BLAKE2b-256 d32d97a810f3b01d452a84d76a8e0d4011e042b28e854e4f014741b3a8a03f63

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