OpenZGY/Python API and Internals (ALPHA)
Access seismic data stored in ZGY format.
Public Member Functions | List of all members
openzgy.impl.meta.HeaderBase Class Reference
Inheritance diagram for openzgy.impl.meta.HeaderBase:
openzgy.impl.meta.FileHeader openzgy.impl.meta.HistHeaderV1 openzgy.impl.meta.HistHeaderV2 openzgy.impl.meta.InfoHeaderV1 openzgy.impl.meta.InfoHeaderV2 openzgy.impl.meta.HistHeaderV3 openzgy.impl.meta.InfoHeaderV3

Public Member Functions

def headersize (cls)
 
def checkformats (cls, verbose=False, *file=None)
 
def pack (self)
 
def unpack (self, buf=None)
 
def read (cls, f, offset)
 
def dump (self, prefix="", file=None)
 

Detailed Description

Convenience base class for implementing classes that map 1:1 to a
specific header with a specific version that exists in a ZGY file.
The constructor should unpack a supplied byte buffer into a new
instance of this header. Caller is responsible for all I/O, so no
methods in this class need an iocontext except read(). The various
headers don't need to inherit this base class if they don't want to.

Member Function Documentation

◆ checkformats()

def openzgy.impl.meta.HeaderBase.checkformats (   cls,
  verbose = False,
file = None 
)
Helper to compare the python definition of the header layout with
the C++ version. Also check that the same attribute isn't listed twice.

◆ dump()

def openzgy.impl.meta.HeaderBase.dump (   self,
  prefix = "",
  file = None 
)
Print the entire contents of the object, including derived fields.

◆ headersize()

def openzgy.impl.meta.HeaderBase.headersize (   cls)
Return the size this header has on disk.

◆ pack()

def openzgy.impl.meta.HeaderBase.pack (   self)
Convert the contents of this class to a byte array suitable for
storing in the ZGY file.

◆ read()

def openzgy.impl.meta.HeaderBase.read (   cls,
  f,
  offset 
)
Read the header from disk and parse it, returning a new instance.

◆ unpack()

def openzgy.impl.meta.HeaderBase.unpack (   self,
  buf = None 
)
Convert a byte array as read from the ZGY file into a Python object.
Normally a call to unpack() will immediately be followed by a call
to calculate() to fill in any derived information, convert enume, etc.
If buf is None, unpacking is done on an all zero buffer. This ensures
that all data fields are present in the object. Simplifying things
if the application is creating an instance from scratch.

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