segysak.segy.segy_loader

segysak.segy.segy_loader(segyfile, cdp=None, iline=None, xline=None, cdpx=None, cdpy=None, offset=None, vert_domain='TWT', data_type='AMP', ix_crop=None, cdp_crop=None, xy_crop=None, z_crop=None, return_geometry=False, silent=False, extra_byte_fields=None, head_df=None, **segyio_kwargs)

Load SEGY file into xarray.Dataset

The output ncfile has the following structure
Dimensions:

d1 - CDP or Inline axis d2 - Xline axis d3 - The vertical axis d4 - Offset/Angle Axis

Coordinates:

iline - The inline numbering xline - The xline numbering cdp_x - Eastings cdp_y - Northings cdp - Trace Number for 2d

Variables

data - The data volume

Attributes:

TBC

Parameters
  • segyfile (str) – Input segy file path

  • ncfile (str, optional) – Output SEISNC file path. If none the loaded data will be returned in memory as an xarray.Dataset.

  • iline (int, optional) – Inline byte location, usually 189

  • xline (int, optional) – Cross-line byte location, usally 193

  • vert (str, optional) – Vertical sampling domain. One of [‘TWT’, ‘DEPTH’]. Defaults to ‘TWT’.

  • cdp (int, optional) – The CDP byte location, usually 21.

  • data_type (str, optional) – Data type [‘AMP’, ‘VEL’]. Defaults to ‘AMP’.

  • cdp_crop (list, optional) – List of minimum and maximum cmp values to output. Has the form ‘[min_cmp, max_cmp]’. Ignored for 3D data.

  • ix_crop (list, optional) – List of minimum and maximum inline and crossline to output. Has the form ‘[min_il, max_il, min_xl, max_xl]’. Ignored for 2D data.

  • xy_crop (list, optional) – List of minimum and maximum cdp_x and cdp_y to output. Has the form ‘[min_x, max_x, min_y, max_y]’. Ignored for 2D data.

  • z_crop (list, optional) – List of minimum and maximum vertical samples to output. Has the form ‘[min, max]’.

  • return_geometry (bool, optional) – If true returns an xarray.dataset which doesn’t contain data but mirrors the input volume header information.

  • silent (bool) – Disable progress bar.

  • extra_byte_fields (list/mapping) – A list of int or mapping of byte fields that should be returned as variables in the dataset.

  • head_df (pandas.DataFrame) – The DataFrame output from segy_header_scrape. This DataFrame can be filtered by the user to load select trace sets. Trace loading is based upon the DataFrame index.

  • **segyio_kwargs – Extra keyword arguments for segyio.open

Returns

If ncfile keyword is specified returns open handle to disk netcdf4,

otherwise the data in memory. If return_geometry is True does not load trace data and returns headers in geometry.

Return type

xarray.Dataset