obspy.io.nlloc.core.read_nlloc_hyp

read_nlloc_hyp(filename, coordinate_converter=None, picks=None, **kwargs)[source]

Reads a NonLinLoc Hypocenter-Phase file to a Catalog object.

Note

Coordinate conversion from coordinate frame of NonLinLoc model files / location run to WGS84 has to be specified explicitly by the user if necessary.

Note

An example can be found on the nlloc submodule front page in the documentation pages.

Parameters:
  • filename – File or file-like object in text mode.

  • coordinate_converter (callable) – Function to convert (x, y, z) coordinates of NonLinLoc output to geographical coordinates and depth in meters (longitude, latitude, depth in kilometers). If left None, the geographical coordinates in the “GEOGRAPHIC” line of NonLinLoc output are used. The function should accept three arguments x, y, z (each of type numpy.ndarray) and return a tuple of three numpy.ndarray (lon, lat, depth in kilometers).

  • picks (list of Pick) – Original picks used to generate the NonLinLoc location. If provided, the output event will include the original picks and the arrivals in the output origin will link to them correctly (with their pick_id attribute). If not provided, the output event will include (the rather basic) pick information that can be reconstructed from the NonLinLoc hypocenter-phase file.

Return type:

Catalog

The following parameters deal with the problem, that the format only stores station names for the picks, but the Pick object expects a SEED id. The SEED id is looked up for every pick by the following procedure:

  1. look at seedid_map for a direct station name match and use the specified template

  2. if 1 did not succeed, look if the station is present in inventory and use its first channel as template

  3. if 1 and 2 did not succeed, use specified default template (default_seedid)

Parameters:
  • inventory (Inventory) – Inventory used to retrieve network code, location code and channel code of stations (SEED id).

  • seedid_map (dict) – Default templates for each station (example: seedid_map={‘MOX’: ‘GR.{}..HH{}’). The values must contain three dots and two {} which are substituted by station code and component.

  • default_seedid (str) – Default SEED id template. The value must contain three dots and two {} which are substituted by station code and component.

  • warn (bool) – Whether or not to warn on failed look ups (no matching data found or ambiguous results) in the inventory

  • ph2comp (dict) – mapping of phases to components if format does not specify the component or if the component ends with ‘?’. Set it to None for no mapping of components. (default: {‘P’: ‘Z’, ‘S’: ‘N’})