Skip to content

read_segy builtin

read_segy(
    path,
    *,
    column="amplitude",
    inline_byte=189,
    crossline_byte=193,
    x_byte=181,
    y_byte=185,
    nodata=None,
    length_unit=None,
)

Reads a post-stack SEG-Y cube as a 3D BlockModel.

Parameters:

Name Type Description Default
path str or Path

A SEG-Y file with one trace per inline and crossline, in sample format 1 (IBM float), 2, 3, 5, 6, 8, 10, 11 or 16 and either byte order.

required
column str

Name of the float32 column holding the samples.

"amplitude"
inline_byte int

1-based trace-header bytes of the 4-byte inline and crossline numbers.

189 and 193
crossline_byte int

1-based trace-header bytes of the 4-byte inline and crossline numbers.

189 and 193
x_byte int

1-based trace-header bytes of the 4-byte CDP x and y, scaled by the coordinate scalar at byte 71 (negative divides).

181 and 185
y_byte int

1-based trace-header bytes of the 4-byte CDP x and y, scaled by the coordinate scalar at byte 71 (negative divides).

181 and 185
nodata float

Sample value read as null. NaN samples are always null.

None

Returns:

Type Description
BlockModel

A regular grid with x along the inlines and y along the crosslines, each from the smallest to the largest line number in steps of the gcd of their gaps; positions without a trace are null. Cell sizes, origin and azimuth (that of the crossline axis) are a least-squares fit of the CDP coordinates; a left-handed survey has its inlines reversed. z is minus the sample time (ms) or depth, the sample interval divided by 1000, so the first sample is the top cell.

Raises:

Type Description
InvalidInput

For truncated or non-SEG-Y files, unsupported sample formats, two traces at one position (prestack gathers) and skewed surveys.

used in