obspy.io.hypodd.pha._read_pha

_read_pha(filename, inventory=None, id_map=None, id_default='.{}..{}', ph2comp={'S': 'N', 'P': 'Z'}, encoding='utf-8')[source]

Read a HypoDD PHA file and returns an ObsPy Catalog object.

Warning

This function should NOT be called directly, it registers via the ObsPy read_events() function, call this instead.

The optional parameters all deal with the problem, that the PHA format only stores station names for the picks, but the Pick object expects a SEED id.

Parameters:
  • filename (str) File or file-like object in text mode.
  • inventory (Inventory) Inventory used to retrieve network code, location code and channel code of stations (SEED id).
  • id_map (dict) If channel information was not found in inventory, it will be looked up in this dictionary (example: id_map={‘MOX’: ‘GR.{}..HH{}’). The values must contain three dots and two {} which are substituted by station code and component.
  • id_default (str) Default SEED id expression. The value must contain three dots and two {} which are substituted by station code and component.
  • ph2comp (dict) mapping of phases to components (default: {‘P’: ‘Z’, ‘S’: ‘N’})
  • encoding (str) encoding used (default: utf-8)
Return type:

Catalog

Returns:

An ObsPy Catalog object.