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

High level API for reading and writing ZGY files. More...

Inheritance diagram for OpenZGY::Impl::ZgyMeta:
OpenZGY::IZgyMeta OpenZGY::Impl::ZgyMetaAndTools OpenZGY::Impl::ZgyReader OpenZGY::Impl::ZgyWriter

Public Member Functions

virtual std::array< int64_t, 3 > size () const override
 Size in inline, crossline, vertical directions.
 
virtual SampleDataType datatype () const override
 Type of samples in each brick.
 
virtual std::array< float32_t, 2 > datarange () const override
 Used for float to int scaling.
 
virtual UnitDimension zunitdim () const override
 Vertical dimension.
 
virtual UnitDimension hunitdim () const override
 Horizontal dimension.
 
virtual std::string zunitname () const override
 For annotation only. Use hunitfactor, not the name, to convert to or from SI.
 
virtual std::string hunitname () const override
 For annotation only. Use hunitfactor, not the name, to convert to or from SI.
 
virtual float64_t zunitfactor () const override
 Multiply by this factor to convert from storage units to SI units.
 
virtual float64_t hunitfactor () const override
 Multiply by this factor to convert from storage units to SI units.
 
virtual float32_t zstart () const override
 First time/depth.
 
virtual float32_t zinc () const override
 Increment in vertical direction.
 
virtual std::array< float32_t, 2 > annotstart () const override
 First inline, crossline.
 
virtual std::array< float32_t, 2 > annotinc () const override
 Increment in inline, crossline directions.
 
virtual const corners_t & corners () const
 Survey corner points in world coordinates.
 
virtual const corners_t & indexcorners () const
 Survey corner points in ordinal (i,j) coordinates.
 
virtual const corners_t & annotcorners () const
 Survey corner points in inline, crossline coordinates.
 
virtual std::array< int64_t, 3 > bricksize () const override
 Size of one brick. Almost always (64,64,64), change at your own peril.
 
virtual std::vector< std::array< int64_t, 3 > > brickcount () const override
 Number of bricks at each resolution (LOD) level.
 
virtual int32_t nlods () const override
 Number of resolution (LOD) levels.
 
virtual void meta () const override
 Dictionary of meta data. NOT IMPLEMENTED.
 
virtual int32_t numthreads () const override
 Number of threads to use. NOT IMPLEMENTED.
 
virtual void set_numthreads (int32_t) override
 Number of threads to use. NOT IMPLEMENTED.
 
virtual void dump (std::ostream &os) const override
 Output in human readable form for debugging.
 
virtual SampleStatistics statistics () const override
 Statistics of all sample values on the file.
 
virtual SampleHistogram histogram () const override
 Histogram of all sample values on the file.
 

Protected Attributes

std::shared_ptr< InternalZGY::ZgyInternalMeta_meta
 Handle to the internal metadata layer which this class wraps.
 

Additional Inherited Members

- Public Types inherited from OpenZGY::IZgyMeta
typedef std::int8_t int8_t
 
typedef std::int16_t int16_t
 
typedef std::int32_t int32_t
 
typedef std::int64_t int64_t
 
typedef float float32_t
 
typedef double float64_t
 
typedef std::array< int64_t, 3 > size3i_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
 

Detailed Description

High level API for reading and writing ZGY files.

The base class contains properties common to both reader and writer.

The constructor should logically have had a ZgyInternalMeta parameter for accessing the implementation layer. But due to the way the code is structured the _meta pointer needs to be set in the constructor for the leaf types. The _meta pointer is guaranteed to not be empty except while constructig the instance.

Both ZgyReader and ZgyWriter need to retain a pointer to the file descriptor. Primarily in order to explcitly close it. Relying on the shared_ptr to do this when going out of scope is dangerous because of exception handling. ZgyWriter additionally needs it when flushing metadata to disk. Since there is no file descriptor in ZgyInternalMeta.

Both ZgyReader and ZgyWriter need a ZgyInternalBulk pointer to do bulk I/O. That instance in turn keeps private references to the file descriptor and the metadata but is not supposed to expose them.

The FileADT and ZgyInternalBulk pointers can be declared here since both the reader and the writer needs them. Or removed from here and duplicated in ZgyReader and ZgyWriter.


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