Simple tools for reading SEG2 format seismic or radar files
Project description
seg2_files
Simple file reading tools
seg2_files is a basic tool for reading binary SEG2 format seismic and ground-penetrating radar data files. It improves on other implementations by having few non-standard library dependencies (only numpy) and being able to read file headers containing any field supported by the SEG2 standard.
Using this library
First, import the function "seg2_load" from the seg2load module in the library:
from seg2_files.seg2load import seg2_load
Next, load the trace data as a numpy array with traces as columns, and header as a dictionary from a SEG2 file:
traces, header = seg2load('example_file.seg2')
The header is a nested dictionary, with the following structure:
header
- Key:'tr' Value: dictionary of trace headers
- Key: trace header field e.g. 'SAMPLE_INTERVAL' for trace timestep (more are detailed in SEG2 specification), Value: List of values of the key field for each trace in the file in order
- Key: 'rec' Value: Dictionary with field names as keys (found in SEG2 standard) containing information about the entire recording (file)
As an example, to get the timestep (dt) between samples of the 3rd trace in a file, you can use:
seis_data, seis_header = seg2_load('example_file.seg2')
dt = seis_header['tr']['SAMPLE_INTERVAL'][2]
And that's all there is to it! This library is simple but hopefully should cover most basic use cases. Don't hesitate to contact me if you have an additional feature idea that you think would be useful or if I missed part of the standard implementation.
Note that this is library is supposed to be pretty bare-bones - it reads SEG2 files (maybe SEGY in the future) and turns them into Python data types. That's it. Processing, plotting, etc. are up to other libraries or you.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file seg2_files-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: seg2_files-0.0.1-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a604dd212ec2648b693831f3a86746ef73234281ee355c5247436ad1895764b |
|
MD5 | 62d79fe7fc37d97fd3a4d2f9189abed5 |
|
BLAKE2b-256 | 1de86e95e374b1f4d12bb4cc780f99d016b364c6cba402dc3b99c7fcdbc5e7c2 |