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 SEG-Y file into xarray.Dataset

The output dataset has the following structure
Dimensions:

cdp/iline - CDP or Inline axis xline - Xline axis twt/depth - The vertical axis offset - 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:

ns - number of samples vertical sample_rate - sample rate in ms/m test - text header measurement_system : m/ft source_file : segy source srd : seismic reference datum percentiles : data amplitude percentiles coord_scalar : from trace headers

Parameters
  • segyfile (str) – Input segy file path

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

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

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

  • cdpx (int, optional) – UTMX byte location, usually 181

  • cdpy (int, optional) – UTMY byte location, usually 185

  • offset (int, optional) – Offset/angle byte location

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

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

  • 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.

  • cdp_crop (list, optional) – List of minimum and maximum cmp values to output. Has the form ‘[min_cmp, max_cmp]’. Ignored for 3D 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