obspy.core.inventory.inventory.read_inventory
- read_inventory(path_or_file_object=None, format=None, level='response', *args, **kwargs)[source]
Function to read inventory files.
- Parameters
path_or_file_object (str, pathlib.Path, or file-like object, optional) – String containing a file name or a URL, a Path object, or a open file-like object. Wildcards are allowed for a file name. If this attribute is omitted, an example
Inventory
object will be returned.format (str) – Format of the file to read (e.g.
"STATIONXML"
). See the Supported Formats section below for a list of supported formats.level (str) – Level of detail to read from file. One of
'response'
,'channel'
,'station'
or'network'
. Lower level of detail can result in much shorter reading times for some file formats.
- Return type
- Returns
An ObsPy
Inventory
object.
Additional args and kwargs are passed on to the underlying
_read_X()
methods of the inventory plugins.Supported Formats
Additional ObsPy modules extend the functionality of the
read_inventory()
function. The following table summarizes all known file formats currently supported by ObsPy.Please refer to the Linked Function Call of each module for any extra options available at the import stage.
Format
Used Module
Linked Function Call
INVENTORYXML
RESP
SC3ML
SEED
STATIONTXT
STATIONXML
XSEED
Note
For handling additional information not covered by the StationXML standard and how to output it to StationXML see the ObsPy Tutorial.