Skip to main content

Convert between SEG-Y and NetCDF

Project description

https://img.shields.io/pypi/v/netcdf_segy.svg

Convert between SEG-Y and NetCDF

This is currently only a research/demonstration tool. It is not “industrial strength”. In particular, it does not run in parallel, so will likely be slow on very large datasets (if it runs at all). Also, only the SEG-Y -> NetCDF direction is implemented.

To install: pip install netcdf_segy

SegyIO is a dependency.

To convert a SEG-Y file to NetCDF from the command line: segy2netcdf <path to input SEG-Y file> <path to output NetCDF file>. For additional options, look at the help: segy2netcdf --help.

The tool can also be called from a Python script:

from netcdf_segy.segy2netcdf import segy2netcdf

segy2netcdf(segy_path, netcdf_path)

I have created a Jupyter Notebook to discuss the advantages of NetCDF compared to SEG-Y, show an example of segy2netcdf being used, and demonstrate the attractions of loading the resulting NetCDF file with xarray: Alternatives to SEG-Y.

One of the “additional options” mentioned above is to use specified headers as dimensions. This allows you to use ‘FieldRecord’ as a dimension if your data is stored as shot gathers, for example (as in the Notebook). If you don’t do this, the NetCDF file will store the data as a 2D array with Time/Depth/SampleNumber and Traces as the dimensions. As netcdf_segy currently uses SegyIO to read the SEG-Y file, the header names are those used by that package. For your convenience, here is the list (from segyio.TraceField):

‘AliasFilterFrequency’, ‘AliasFilterSlope’, ‘CDP’, ‘CDP_TRACE’, ‘CDP_X’, ‘CDP_Y’, ‘CROSSLINE_3D’, ‘CoordinateUnits’, ‘Correlated’, ‘DataUse’, ‘DayOfYear’, ‘DelayRecordingTime’, ‘ElevationScalar’, ‘EnergySourcePoint’, ‘FieldRecord’, ‘GainType’, ‘GapSize’, ‘GeophoneGroupNumberFirstTraceOrigField’, ‘GeophoneGroupNumberLastTraceOrigField’, ‘GeophoneGroupNumberRoll1’, ‘GroupStaticCorrection’, ‘GroupUpholeTime’, ‘GroupWaterDepth’, ‘GroupX’, ‘GroupY’, ‘HighCutFrequency’, ‘HighCutSlope’, ‘HourOfDay’, ‘INLINE_3D’, ‘InstrumentGainConstant’, ‘InstrumentInitialGain’, ‘LagTimeA’, ‘LagTimeB’, ‘LowCutFrequency’, ‘LowCutSlope’, ‘MinuteOfHour’, ‘MuteTimeEND’, ‘MuteTimeStart’, ‘NStackedTraces’, ‘NSummedTraces’, ‘NotchFilterFrequency’, ‘NotchFilterSlope’, ‘OverTravel’, ‘ReceiverDatumElevation’, ‘ReceiverGroupElevation’, ‘ScalarTraceHeader’, ‘SecondOfMinute’, ‘ShotPoint’, ‘ShotPointScalar’, ‘SourceDatumElevation’, ‘SourceDepth’, ‘SourceEnergyDirectionExponent’, ‘SourceEnergyDirectionMantissa’, ‘SourceGroupScalar’, ‘SourceMeasurementExponent’, ‘SourceMeasurementMantissa’, ‘SourceMeasurementUnit’, ‘SourceStaticCorrection’, ‘SourceSurfaceElevation’, ‘SourceType’, ‘SourceUpholeTime’, ‘SourceWaterDepth’, ‘SourceX’, ‘SourceY’, ‘SubWeatheringVelocity’, ‘SweepFrequencyEnd’, ‘SweepFrequencyStart’, ‘SweepLength’, ‘SweepTraceTaperLengthEnd’, ‘SweepTraceTaperLengthStart’, ‘SweepType’, ‘TRACE_SAMPLE_COUNT’, ‘TRACE_SAMPLE_INTERVAL’, ‘TRACE_SEQUENCE_FILE’, ‘TRACE_SEQUENCE_LINE’, ‘TaperType’, ‘TimeBaseCode’, ‘TotalStaticApplied’, ‘TraceIdentificationCode’, ‘TraceIdentifier’, ‘TraceNumber’, ‘TraceValueMeasurementUnit’, ‘TraceWeightingFactor’, ‘TransductionConstantMantissa’, ‘TransductionConstantPower’, ‘TransductionUnit’, ‘UnassignedInt1’, ‘UnassignedInt2’, ‘WeatheringVelocity’, ‘YearDataRecorded’,

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netcdf_segy-1.0.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

netcdf_segy-1.0.1-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file netcdf_segy-1.0.1.tar.gz.

File metadata

  • Download URL: netcdf_segy-1.0.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for netcdf_segy-1.0.1.tar.gz
Algorithm Hash digest
SHA256 20b6883ba2ade54d1b5a66921ddb04abd0cd3b03dd60cebadd420a13ba6df2fa
MD5 55b49711b7be7bcce3c37c7630cee7c1
BLAKE2b-256 e8a3f0bfdf9bfc23238241f9582776c8d88ccaf1a9eb8f0a3aea809da2575045

See more details on using hashes here.

File details

Details for the file netcdf_segy-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: netcdf_segy-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for netcdf_segy-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 872c982a530adb8cd0b2cf7fd17ba5a5e74042bed55444042ca3d2698eeb1255
MD5 333a022c8ec0f834b2cc59224a1ecd87
BLAKE2b-256 61b6d60a9b9a6aabfcb9158472b75bf129e0a99264427d807256207afebd6b6f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page