|
OpenZGY/Python API and Internals (ALPHA)
Access seismic data stored in ZGY format.
|
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) |
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.
| 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.
| def openzgy.impl.meta.HeaderBase.dump | ( | self, | |
prefix = "", |
|||
file = None |
|||
| ) |
Print the entire contents of the object, including derived fields.
| def openzgy.impl.meta.HeaderBase.headersize | ( | cls | ) |
Return the size this header has on disk.
| def openzgy.impl.meta.HeaderBase.pack | ( | self | ) |
Convert the contents of this class to a byte array suitable for storing in the ZGY file.
| def openzgy.impl.meta.HeaderBase.read | ( | cls, | |
| f, | |||
| offset | |||
| ) |
Read the header from disk and parse it, returning a new instance.
| 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.
1.8.17