API reference

This page provides an auto-generated summary of the segysak package API. For more details and examples, refer to the relevant chapters in the main part of the documentation.

SEG-Y Files

Inspecting SEG-Y data files

segy_header_scrape(segyfile[, partial_scan, ...])

Scape all data from segy trace headers

segy_bin_scrape(segyfile, **segyio_kwargs)

Scrape binary header

segy_header_scan(segyfile[, ...])

Perform a scan of the segy file headers and return ranges.

get_segy_texthead(segyfile[, ext_headers, ...])

Return the ebcidc

Loading & Converting SEG-Y data files

segy_loader(segyfile[, cdp, iline, xline, ...])

Load SEG-Y file into xarray.Dataset

segy_freeloader(segyfile[, vert_domain, ...])

Freeform loader for SEG-Y data.

segy_converter(segyfile, ncfile[, cdp, ...])

Convert SEG-Y data to NetCDF4 File

well_known_byte_locs(name)

Return common bytes position kwargs_dict for segy_loader and segy_converter.

Modifying and Creating Text Headers

put_segy_texthead(segyfile, ebcidc[, ...])

create_default_texthead([override])

Returns a simple default textual header dictionary.

Writing SEG-Y files

segy_writer(seisnc, segyfile[, ...])

Convert siesnc format (NetCDF4) to SEGY.

segy_freewriter(seisnc, segyfile[, ...])

Convert siesnc format (NetCDF4) to SEG-Y.

output_byte_locs(name)

Return common bytes position variable_dict for segy_writer.

SEISNC Operations

Opening and Saving seisnc Files

open_seisnc(seisnc, **kwargs)

Load from netcdf4 with seisnc specs.

Functions which operate on seisnc objects

coordinate_df(seisnc[, coord, extras, ...])

From an xarray seisnc quickly create iline and xline df.

Creating empty seisnc volumes

create3d_dataset(dims[, first_sample, ...])

Create a regular 3D seismic dataset from basic grid geometry with optional offset dimension for pre-stack data.

create2d_dataset(dims[, first_sample, ...])

Create a regular 2D seismic dataset from basic geometry.

create_seismic_dataset([twt, depth, cdp, ...])

Create a blank seismic dataset by setting the dimension sizes (d#) or by passing arrays for known dimensions.

Xarray Accessor modules

Accessor modules are accessed as namespaces within the Xarray.Dataset objects created by SEGY-SAK. When segysak is imported, all xarray.Dataset objects will contain the .seis and .seisio namespaces.

segysak xarray accessor modules

SeisIO(xarray_obj)

SeisGeom(xarray_obj)

SeisIO

Access via xarray.Dataset.seisio

SeisIO.to_netcdf(seisnc, **kwargs)

Output to netcdf4 with specs for seisnc.

SeisGeom

Access via xarray.Dataset.seis

SeisGeom.is_2d()

Returns True if the dataset is 2D peformant else False

SeisGeom.is_2dgath()

Returns True if the dataset is 2D peformant and has offset or angle else False

SeisGeom.is_3d()

Returns True if the dataset is 3D peformant else False

SeisGeom.is_3dgath()

Returns True if the dataset is 3D peformant and has offset or angle else False

SeisGeom.is_twt()

Check if seisnc volume is in twt

SeisGeom.is_depth()

Check if seisnc volume is in depth

SeisGeom.is_empty()

Check if empty

SeisGeom.zeros_like()

Create a new dataset with the same attributes and coordinates and dimensions but with data filled by zeros.

SeisGeom.get_measurement_system()

Return measurement_system if present, else None

SeisGeom.fill_cdpna()

Fills NaN cdp locations by fitting known cdp x and y values to the local grid using a planar surface relationshipt.

seisnc data tools

SeisGeom.zeros_like()

Create a new dataset with the same attributes and coordinates and dimensions but with data filled by zeros.

SeisGeom.calc_corner_points()

Calculate the corner points of the geometry or end points of a 2D line.

seisnc sampling operations

SeisGeom.xysel(cdp_x, cdp_y[, method, ...])

Select data at x and y coordinates

SeisGeom.interp_line(cdpx, cdpy[, extra, ...])

Select data at x and y coordinates

SeisGeom.surface_from_points(points, attr[, ...])

Sample a 2D point set with an attribute (like Z) to the seisnc geometry using interpolation.

seisnc plotting functions

SeisGeom.plot_bounds([ax])

Plot survey bbounding box to a new or existing axis

SeisGeom.get_affine_transform()

Calculate the forward iline/xline -> cdp_x, cdp_y Affine transform for Matplotlib using corner point geometry.

ZGY Files

Reading and Writing from ZGY

Experimental