Inventory Utilities

Utilities for dealing with inventory objects.

copyright:

Lion Krischer (lion.krischer@gmail.com), 2013-2021

license:

BSD 3-Clause (“BSD New” or “BSD Simplified”)

pyasdf.inventory_utils.get_coordinates(data, level='station')[source]

Very quick way to get coordinates from a StationXML file.

Can extract coordinates at the station and at the channel level.

pyasdf.inventory_utils.isolate_and_merge_station(inv, network_id, station_id)[source]

Takes an inventory object, isolates the given station and merged them.

Merging is sometimes necessary as many files have the same station multiple times.

Returns the processed inventory object. The original one will not be changed.

Parameters:
  • inv (Inventory) – The inventory.

  • network_id (str) – The network id.

  • station_id (str) – The station id.

pyasdf.inventory_utils.merge_inventories(inv_a, inv_b, network_id, station_id)[source]

Takes two inventories, merges the contents of both and isolates the contents of a certain network and station id.

Returns the processed inventory object. The original one will not be changed.

Parameters:
  • inv_a (Inventory) – Inventory A. Contents of that inventory will be prioritized.

  • inv_b (Inventory) – Inventory B.

  • network_id (str) – The network id.

  • station_id (str) – The station id.