obspy.io.segy.core.LazyTraceHeaderAttribDict

class LazyTraceHeaderAttribDict(unpacked_header, unpacked_header_endian, data={})[source]

Bases: AttribDict

This version of AttribDict will unpack header values only if needed.

This saves a huge amount of memory. The disadvantage is that it is no longer possible to use tab completion in e.g. ipython.

This version is used for the SEGY/SU trace headers.

Attributes

defaults

do_not_warn_on

readonly

warn_on_non_default_key

Public Methods

clear

copy

get

items

keys

pop

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem

as a 2-tuple; but raise KeyError if D is empty.

setdefault

update

values

Private Methods

Warning

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

LazyTraceHeaderAttribDict._cast_type(key, value)

Cast type of value to type required in _types dict.

Parameters:
  • key (str) – The key from __setattr__.

  • value – The value being set to key.

Returns:

value cast to correct type.

LazyTraceHeaderAttribDict._pretty_str(priorized_keys=[], min_label_length=16)

Return better readable string representation of AttribDict object.

Parameters:
  • priorized_keys (list[str], optional) – Keywords of current AttribDict which will be shown before all other keywords. Those keywords must exists otherwise an exception will be raised. Defaults to empty list.

  • min_label_length (int, optional) – Minimum label length for keywords. Defaults to 16.

Returns:

String representation of current AttribDict object.

Special Methods

LazyTraceHeaderAttribDict.__contains__(key)
LazyTraceHeaderAttribDict.__deepcopy__(*args, **kwargs)[source]
LazyTraceHeaderAttribDict.__delattr__(name)
LazyTraceHeaderAttribDict.__delitem__(name)
LazyTraceHeaderAttribDict.__dir__()

Default dir() implementation.

LazyTraceHeaderAttribDict.__eq__(other)
LazyTraceHeaderAttribDict.__format__(format_spec, /)

Default object formatter.

LazyTraceHeaderAttribDict.__ge__(value, /)

Return self>=value.

LazyTraceHeaderAttribDict.__getattr__(name)
LazyTraceHeaderAttribDict.__getattribute__(name, /)

Return getattr(self, name).

LazyTraceHeaderAttribDict.__getitem__(name)[source]
LazyTraceHeaderAttribDict.__gt__(value, /)

Return self>value.

LazyTraceHeaderAttribDict.__init__(unpacked_header, unpacked_header_endian, data={})[source]
LazyTraceHeaderAttribDict.__init_subclass__()

This method is called when a class is subclassed.

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

LazyTraceHeaderAttribDict.__iter__()
LazyTraceHeaderAttribDict.__le__(value, /)

Return self<=value.

LazyTraceHeaderAttribDict.__len__()
LazyTraceHeaderAttribDict.__lt__(value, /)

Return self<value.

LazyTraceHeaderAttribDict.__ne__(value, /)

Return self!=value.

LazyTraceHeaderAttribDict.__new__(**kwargs)
LazyTraceHeaderAttribDict.__reduce__()

Helper for pickle.

LazyTraceHeaderAttribDict.__reduce_ex__(protocol, /)

Helper for pickle.

LazyTraceHeaderAttribDict.__repr__()
LazyTraceHeaderAttribDict.__setattr__(key, value)
LazyTraceHeaderAttribDict.__setitem__(key, value)
LazyTraceHeaderAttribDict.__sizeof__()

Size of object in memory, in bytes.

LazyTraceHeaderAttribDict.__str__()

Return str(self).

classmethod LazyTraceHeaderAttribDict.__subclasshook__(C)