segfast documentation

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 the 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

Implementation details

We rely on segyio to infer file-wide parameters.

For headers and traces, we use custom methods of reading binary data.

Main differences to segyio C++ implementation:
  • we read all of the requested headers in one file-wide sweep, speeding up by an order of magnitude compared to the segyio sequential read of every requested header. Also, we do that in multiple processes across chunks.

  • a memory map over trace data is used for loading values. Avoiding redundant copies and leveraging numpy superiority allows to speed up reading, especially in case of trace slicing along the samples axis. This is extra relevant in the case of loading horizontal (depth) slices.