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
Public Methods
If key is not found, d is returned if given, otherwise KeyError is raised. |
|
as a 2-tuple; but raise KeyError if D is empty. |
|
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:
- Returns:
String representation of current AttribDict object.
Special Methods
- classmethod LazyTraceHeaderAttribDict.__class_getitem__()
Represent a PEP 585 generic type
E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).
- LazyTraceHeaderAttribDict.__contains__(key)
- 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.__gt__(value, /)
Return self>value.
- 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)