OpenZGY/C++ API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Types | Public Member Functions | List of all members
OpenZGY::ZgyWriterArgs Class Reference

Argument package for creating a ZGY file. More...

#include <api.h>

Public Types

typedef double float64_t
 
typedef std::array< std::array< float64_t, 2 >, 4 > corners_t
 
typedef std::pair< std::shared_ptr< const void >, std::int64_t > rawdata_t
 
typedef std::function< rawdata_t(const rawdata_t &, const std::array< int64_t, 3 > &)> compressor_t
 

Public Member Functions

void dump (std::ostream &out)
 Output in human readable form for debugging.
 
ZgyWriterArgsfilename (const std::string &value)
 Set file to open. More...
 
ZgyWriterArgsiocontext (const IOContext *value)
 Set credentials and other configuration. More...
 
ZgyWriterArgscompressor (const compressor_t &value)
 Set functor for compressing full resolution data.
 
ZgyWriterArgscompressor (const std::string &name, const std::vector< std::string > &args)
 Set functor for compressing full resolution data. More...
 
ZgyWriterArgszfp_compressor (float snr)
 Set functor for compressing full resolution data. More...
 
ZgyWriterArgslodcompressor (const compressor_t &value)
 Set functor for compressing low resolution data.
 
ZgyWriterArgslodcompressor (const std::string &name, const std::vector< std::string > &args)
 Set functor for compressing low resolution data. More...
 
ZgyWriterArgszfp_lodcompressor (float snr)
 Set functor for compressing low resolution data. More...
 
ZgyWriterArgssize (std::int64_t ni, std::int64_t nj, std::int64_t nk)
 Set size of the survey. More...
 
ZgyWriterArgsbricksize (std::int64_t ni, std::int64_t nj, std::int64_t nk)
 Set size of one brick. More...
 
ZgyWriterArgsdatatype (SampleDataType value)
 Set type of samples in each brick.
 
ZgyWriterArgsdatarange (float lo, float hi)
 Set scaling factors. More...
 
ZgyWriterArgszunit (UnitDimension dimension, const std::string &name, double factor)
 Set vertical unit. More...
 
ZgyWriterArgshunit (UnitDimension dimension, const std::string &name, double factor)
 Set horizontal unit. More...
 
ZgyWriterArgsilstart (float value)
 Set first (ordinal 0) inline number. More...
 
ZgyWriterArgsilinc (float value)
 Set inline number increment between two adjacent ordinal values. More...
 
ZgyWriterArgsxlstart (float value)
 Set first (ordinal 0) crossline number. More...
 
ZgyWriterArgsxlinc (float value)
 Set crossline number increment between two adjacent ordinal values. More...
 
ZgyWriterArgszstart (float value)
 Set first time/depth. More...
 
ZgyWriterArgszinc (float value)
 Set increment (distance between samples) in vertical direction. More...
 
ZgyWriterArgscorners (const corners_t &value)
 Set survey corner points in world coordinates. More...
 
ZgyWriterArgsmetafrom (const std::shared_ptr< OpenZGY::IZgyReader > &)
 Copy metadata from existing file. More...
 

Detailed Description

Argument package for creating a ZGY file.

This is a short lived helper class for passing arguments to the functions that create a ZGY file. Needed because there are a lot of arguments and C++ doesn't allow keyword arguments. Do NOT use this class for holding on to the information.

Information not set explicitly will be defaulted. The following two statements give the same result:

ZgyWriterArgs default_args = ZgyWriterArgs();
ZgyWriterArgs default_args = ZgyWriterArgs()
.filename("")
.iocontext(nullptr)
.compressor(nullptr)
.lodcompressor(nullptr)
.size(0, 0, 0)
.bricksize(64, 64, 64)
.datatype(SampleDataType::float32)
.datarange(0, -1)
.zunit(UnitDimension::unknown, "", 1.0)
.hunit(UnitDimension::unknown, "", 1.0)
.ilstart(0)
.ilinc(0)
.xlstart(0)
.xlinc(0)
.zstart(0)
.zinc(0)
.corners(ZgyWriterArgs::corners_t{0,0,0,0,0,0,0,0});

Member Function Documentation

◆ bricksize()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::bricksize ( std::int64_t  ni,
std::int64_t  nj,
std::int64_t  nk 
)

Set size of one brick.

Almost always (64,64,64). Change at your own peril.

◆ compressor()

ZgyWriterArgs & OpenZGY::ZgyWriterArgs::compressor ( const std::string &  name,
const std::vector< std::string > &  args 
)

Set functor for compressing full resolution data.

This overload uses a factory to look up the compressor.

◆ corners()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::corners ( const corners_t &  value)

Set survey corner points in world coordinates.

The corners are ordered origin, last inline (i.e. i=last, j=0), last crossline, diagonal.

◆ datarange()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::datarange ( float  lo,
float  hi 
)

Set scaling factors.

For integral storage this specifies the two floating point numbers that correspond to the lowest and highest representable integer value. So for int8 files, -128 will be converted to "lo" and +127 will be converted to "hi".

◆ filename()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::filename ( const std::string &  value)

Set file to open.

If starting with sd:// this opens a file on seismic store.

◆ hunit()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::hunit ( UnitDimension  dimension,
const std::string &  name,
double  factor 
)

Set horizontal unit.

Parameters
dimensioncartesian length or (unsupported) polat coordinates,
namefor annotation only.
factormultiply by this factor to convert from storage units to SI units.

◆ ilinc()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::ilinc ( float  value)

Set inline number increment between two adjacent ordinal values.

For maximum portability the inline and crossline start and increment should be integral numbers. Some applications might choose to convert them to int.

◆ ilstart()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::ilstart ( float  value)

Set first (ordinal 0) inline number.

For maximum portability the inline and crossline start and increment should be integral numbers. Some applications might choose to convert them to int.

◆ iocontext()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::iocontext ( const IOContext value)

Set credentials and other configuration.

This depends on the back-end. For local files you normally don't need to pass anything here.

◆ lodcompressor()

ZgyWriterArgs & OpenZGY::ZgyWriterArgs::lodcompressor ( const std::string &  name,
const std::vector< std::string > &  args 
)

Set functor for compressing low resolution data.

This overload uses a factory to look up the compressor.

◆ metafrom()

ZgyWriterArgs & OpenZGY::ZgyWriterArgs::metafrom ( const std::shared_ptr< OpenZGY::IZgyReader > &  reader)

Copy metadata from existing file.

Set most of the metadata from an open file descriptor. Typically used when the file to be created is to be computed from an existing file. Typically this will be called first so the settings don't inadverently shadow something set explicitly.

◆ size()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::size ( std::int64_t  ni,
std::int64_t  nj,
std::int64_t  nk 
)

Set size of the survey.

Parameters
ninumber of inlines (slowest varying index).
njnumber of crosslines.
nknumber of samples per trace (fastest).

◆ xlinc()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::xlinc ( float  value)

Set crossline number increment between two adjacent ordinal values.

For maximum portability the inline and crossline start and increment should be integral numbers. Some applications might choose to convert them to int.

◆ xlstart()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::xlstart ( float  value)

Set first (ordinal 0) crossline number.

For maximum portability the inline and crossline start and increment should be integral numbers. Some applications might choose to convert them to int.

◆ zfp_compressor()

ZgyWriterArgs & OpenZGY::ZgyWriterArgs::zfp_compressor ( float  snr)

Set functor for compressing full resolution data.

This overload uses a factory to look up the ZGY compressor. It is just a convenience that is shorter to type.

◆ zfp_lodcompressor()

ZgyWriterArgs & OpenZGY::ZgyWriterArgs::zfp_lodcompressor ( float  snr)

Set functor for compressing low resolution data.

This overload uses a factory to look up the ZGY compressor. It is just a convenience that is shorter to type.

◆ zinc()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::zinc ( float  value)

Set increment (distance between samples) in vertical direction.

Vertical annotation is generally safe to have non-integral.

◆ zstart()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::zstart ( float  value)

Set first time/depth.

Vertical annotation is generally safe to have non-integral.

◆ zunit()

ZgyWriterArgs& OpenZGY::ZgyWriterArgs::zunit ( UnitDimension  dimension,
const std::string &  name,
double  factor 
)

Set vertical unit.

Parameters
dimensiontime or depth (a.k.a. length).
namefor annotation only.
factormultiply by this factor to convert from storage units to SI units.

The documentation for this class was generated from the following files: