https://github.com/analysiscenter/segfast
Interacting with SEG-Y storage of seismic data
https://github.com/analysiscenter/segfast
Last synced: 5 months ago
JSON representation
Interacting with SEG-Y storage of seismic data
- Host: GitHub
- URL: https://github.com/analysiscenter/segfast
- Owner: analysiscenter
- License: apache-2.0
- Created: 2023-02-17T13:18:27.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-07-01T10:27:38.000Z (12 months ago)
- Last Synced: 2025-07-01T11:35:53.720Z (12 months ago)
- Language: Python
- Homepage: https://analysiscenter.github.io/segfast/
- Size: 7.47 MB
- Stars: 23
- Watchers: 5
- Forks: 9
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SEGFAST
Installation • Benchmarks • Getting Started
[](https://www.apache.org/licenses/LICENSE-2.0)
[](https://python.org)
[](https://github.com/analysiscenter/segfast/actions/workflows/status.yml)
---
**segfast** is a library for interacting with SEG-Y seismic data. Main features are:
* Faster access to read data: both traces headers and values
* Optional bufferization, where user can provide a preallocated memory to load the data into
* Convenient API that relies on `numpy.memmap` for most operations, while providing `segyio` as a fallback engine
## Installation
# pip / pip3
pip3 install segfast
# developer version (add `--depth 1` if needed)
git clone https://github.com/analysiscenter/segfast.git
## Benchmarks
Timings for reading data along various projections:
| | slide_i | slide_x | slide_d | crop
(256, 256, 500) | batch
(20, 256, 256, 500)|
|:-------------------------------|-----------:|-----------:|-----------:|------------------------------:|--------------------------------:|
| segyio | 2.58254 | 7.16672 | 3041.3 | 941.285 | 16104.4 |
| segfast | 1.48056 | 3.37418 | 50.1355 | 82.0574 | 2761.94 |
| segfast
segyio engine | 2.92379 | 5.69101 | 225.13 | 117.571 | 3968.81 |
| seismiqb | 1.46763 | 3.45154 | 50.3333 | 151.877 | 2738.86 |
| seismiqb+HDF5 | 1.04213 | 1.93414 | 1.80567 | 81.3581 | 2616.83 |
| segfast
quantized | 0.252452 | 0.518485 | 56.6672 | 7.71151 | 1212.74 |

## Getting started
After installation just import **segfast** into your code. A quick demo of our primitives and methods:
```python
import segfast
# Open file and read some meta info. Engine can be `segyio` or `memmap`
segfast_file = segfast.open('/path/to/cube.sgy', engine='memmap')
# Load requested headers as dataframe
segfast_file.load_headers(['INLINE_3D', 'CROSSLINE_3D', ...])
# Data access. All methods support optional buffer as target memory
segfast_file.load_traces([123, 333, 777], buffer=None)
segfast_file.load_depth_slices([5, 10, 15], buffer=None)
# Convert data format to IEEE float32: speeds up operations by a lot
segfast_file.convert(format=5)
```
You can get more familiar with the library, its functional and timings by reading [examples](examples).