pysep.utils.fetch#

Grab information from external webservices or databases

Module Contents#

Functions#

get_taup_arrivals([st, event, inv, phase_list, model, ...])

Retrieve phase arrival times using TauP/TauPy based on event and station

_get_or_build_taup_model(model)

Attempts to retrieve a TauP model from the internal ObsPy directory.

pysep.utils.fetch.get_taup_arrivals(st=None, event=None, inv=None, phase_list=('ttall',), model='ak135', network=None, station=None)[source]#

Retrieve phase arrival times using TauP/TauPy based on event and station locations, either using SAC headers or using event and inventory metadata.

Note

Requires EITHER st with appropriate SAC headers OR event and inv defining event and station locations.

Available model names can be found here:

https://docs.obspy.org/packages/obspy.taup.html

OR internally at:

pysep/pysep/data/taup_models

Parameters:
  • st (obspy.core.stream.Stream) – Stream with appended SAC headers which will be used to gather TaupP arrivals from a given model

  • event (obspy.core.event.Event) – Event object to get location from

  • inv (obspy.core.inventory.Inventory) – inventory object to get locations from

  • phase_list (list of str) – phases to search TauP for. Defaults to ‘ttall’, which is ObsPy’s default for getting all phase arrivals

  • model (str) – Model to query TauP with. Looks at ObsPy and PySEP models

  • network (str) – query only a specific network

  • station (str) – query only a specific station

Return type:

dict

Returns:

a dictionary where keys are trace ID consisting of network and station (NN.SSS), and values are TauP Arrivals() instances which contain information about phase arrivals

pysep.utils.fetch._get_or_build_taup_model(model)[source]#

Attempts to retrieve a TauP model from the internal ObsPy directory. If nothing is found, will attempt to search the internal PySEP taup_model data directory for matching velocity models which can be built

Parameters:

model (str) – name of model to search for

Return type:

obspy.taup.TauPyModel

Returns:

model matching model name

Raises:

FileNotfoundError – If no matching file is found