obspy.core.inventory.inventory.Inventory

class Inventory(networks=None, source='ObsPy 1.3.1', sender=None, created=None, module='ObsPy 1.3.1', module_uri='https://www.obspy.org')[source]

Bases: ComparingObject

The root object of the Network-> Station-> Channel hierarchy.

In essence just a container for one or more networks.

Attributes

networks

Public Methods

copy

Return a deepcopy of the Inventory object.

extend

Extends the current Inventory object with another Inventory or a list of Network objects.

get_channel_metadata

Return basic metadata for a given channel.

get_contents

Returns a dictionary containing the contents of the object.

get_coordinates

Return coordinates for a given channel.

get_orientation

Return orientation for a given channel.

get_response

Find response for a given channel at given time.

plot

Creates a preview map of all networks/stations in current inventory object.

plot_response

Show bode plot of instrument response of all (or a subset of) the inventory's channels.

remove

Return a copy of the inventory with selected elements removed.

select

Return a copy of the inventory filtered on various parameters.

write

Writes the inventory object to a file or file-like object in the specified format.

Private Methods

Warning

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

Inventory._repr_pretty_(p, cycle)[source]

Special Methods

Inventory.__copy_inventory_metadata(other)

Will be called after two inventory objects have been merged. It attempts to assure that inventory meta information is somewhat correct after the merging.

The networks in other will have been moved to self.

Inventory.__add__(other)[source]
Inventory.__delattr__(name, /)

Implement delattr(self, name).

Inventory.__dir__()

Default dir() implementation.

Inventory.__eq__(other)[source]

__eq__ method of the Inventory object.

Parameters:

other (Inventory) – Inventory object for comparison.

Return type:

bool

Returns:

True if both Inventories are equal.

Example

>>> from obspy.core.inventory import read_inventory
>>> inv = read_inventory()
>>> inv2 = inv.copy()
>>> inv is inv2
False
>>> inv == inv2
True
Inventory.__format__(format_spec, /)

Default object formatter.

Inventory.__ge__(value, /)

Return self>=value.

Inventory.__getattribute__(name, /)

Return getattr(self, name).

Inventory.__getitem__(index)[source]
Inventory.__gt__(value, /)

Return self>value.

Inventory.__iadd__(other)[source]
Inventory.__init__(networks=None, source='ObsPy 1.3.1', sender=None, created=None, module='ObsPy 1.3.1', module_uri='https://www.obspy.org')[source]
Parameters:
  • networks (list of Network) – A list of networks part of this inventory.

  • source (str) – Network ID of the institution sending the message.

  • sender (str, optional) – Name of the institution sending this message.

  • created (UTCDateTime, optional) – The time when the document was created. Will be set to the current time if not given.

  • module (str) – Name of the software module that generated this document, defaults to ObsPy related information.

  • module_uri (str) – This is the address of the query that generated the document, or, if applicable, the address of the software that generated this document, defaults to ObsPy related information.

Note

For handling additional information not covered by the StationXML standard and how to output it to StationXML see the ObsPy Tutorial.

Inventory.__init_subclass__()

This method is called when a class is subclassed.

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

Inventory.__le__(value, /)

Return self<=value.

Inventory.__len__()[source]
Inventory.__lt__(value, /)

Return self<value.

Inventory.__ne__(other)[source]
Inventory.__new__(**kwargs)
Inventory.__reduce__()

Helper for pickle.

Inventory.__reduce_ex__(protocol, /)

Helper for pickle.

Inventory.__repr__()

Return repr(self).

Inventory.__setattr__(name, value, /)

Implement setattr(self, name, value).

Inventory.__sizeof__()

Size of object in memory, in bytes.

Inventory.__str__()[source]
Inventory.__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).