obspy.core.inventory.inventory.Inventory.write
- Inventory.write(path_or_file_object, format, **kwargs)[source]
Writes the inventory object to a file or file-like object in the specified format.
- Parameters:
path_or_file_object – File name or file-like object to be written to.
format (str) – The file format to use (e.g.
"STATIONXML"
). See the Supported Formats section below for a list of supported formats.kwargs – Additional keyword arguments passed to the underlying plugin’s writer method.
Example
>>> from obspy import read_inventory >>> inventory = read_inventory() >>> inventory.write("example.xml", ... format="STATIONXML")
Supported Formats
Additional ObsPy modules extend the parameters of the
write()
method. The following table summarizes all known formats with write capability currently available for ObsPy.Please refer to the Linked Function Call of each module for any extra options available.
Format
Used Module
Linked Function Call
CSS
KML
SACPZ
SHAPEFILE
STATIONTXT
STATIONXML