obspy.io.hypodd.pha._write_pha

_write_pha(catalog, filename, eventid_map=None, **kwargs)[source]

Write a HypoDD PHA file.

Warning

This function should NOT be called directly, it registers via the the write() method of an ObsPy Catalog object, call this instead.

Parameters
  • catalog (Catalog) – The ObsPy Catalog object to write.

  • filename (str or file-like object) – Filename to write or open file-like object.

  • eventid_map (dict) – Desired mapping of event resource ids (dict keys) to hypodd event ids (dict values). HYPODD expects integer event ids with maximal 9 digits. If the event resource id is not present in the mapping, the event resource id is stripped of all non-digit characters and truncated to a length of 9 chars. If this method does not generate a valid hypodd event id, a counter starting at 1000 is used.

Returns

Dictionary eventid_map with mapping of event resource id to hypodd event id. Items are only present if both ids are different.