obspy.io.segy.segy.SEGYTraceHeader

class SEGYTraceHeader(header=None, endian='>', unpack_headers=False)[source]

Bases: object

Convenience class that handles reading and writing of the trace headers.

Public Methods

write

Writes the header to an open file like object.

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

SEGYTraceHeader._create_empty_trace_header()[source]

Init the trace header with zeros.

SEGYTraceHeader._read_trace_header(header)[source]

Reads the 240 byte long header and unpacks all values into corresponding class attributes.

SEGYTraceHeader._repr_pretty_(p, cycle)[source]

Special Methods

SEGYTraceHeader.__delattr__(name, /)

Implement delattr(self, name).

SEGYTraceHeader.__dir__()

Default dir() implementation.

SEGYTraceHeader.__eq__(value, /)

Return self==value.

SEGYTraceHeader.__format__(format_spec, /)

Default object formatter.

SEGYTraceHeader.__ge__(value, /)

Return self>=value.

SEGYTraceHeader.__getattr__(name)[source]

This method is only called if the attribute is not found in the usual places (i.e. not an instance attribute or not found in the class tree for self).

SEGYTraceHeader.__getattribute__(name, /)

Return getattr(self, name).

SEGYTraceHeader.__gt__(value, /)

Return self>value.

SEGYTraceHeader.__hash__()

Return hash(self).

SEGYTraceHeader.__init__(header=None, endian='>', unpack_headers=False)[source]

Will take the 240 byte of the trace header and unpack all values with the given endianness.

Parameters:
  • header (str) – String that contains the packed binary header values. If header is None, a trace header with all values set to 0 will be created

  • big_endian (bool) – True means the header is encoded in big endian and False corresponds to a little endian header.

  • unpack_headers (bool) – Determines whether or not all headers will be unpacked during reading the file. Has a huge impact on the memory usage and the performance. They can be unpacked on-the-fly after being read. Defaults to False.

SEGYTraceHeader.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

SEGYTraceHeader.__le__(value, /)

Return self<=value.

SEGYTraceHeader.__lt__(value, /)

Return self<value.

SEGYTraceHeader.__ne__(value, /)

Return self!=value.

SEGYTraceHeader.__new__(**kwargs)
SEGYTraceHeader.__reduce__()

Helper for pickle.

SEGYTraceHeader.__reduce_ex__(protocol, /)

Helper for pickle.

SEGYTraceHeader.__repr__()

Return repr(self).

SEGYTraceHeader.__setattr__(name, value, /)

Implement setattr(self, name, value).

SEGYTraceHeader.__sizeof__()

Size of object in memory, in bytes.

SEGYTraceHeader.__str__()[source]

Just returns all header values.

SEGYTraceHeader.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).