obspy.taup.tau.TauPyModel

class TauPyModel(model='iasp91', verbose=False, planet_flattening=0.0, cache=None)[source]

Bases: object

Representation of a seismic model and methods for ray paths through it.

Public Methods

get_pierce_points

Return pierce points of every given phase.

get_pierce_points_geo

Return pierce points of every given phase with geographical info.

get_ray_paths

Return ray paths of every given phase.

get_ray_paths_geo

Return ray paths of every given phase with geographical info.

get_travel_times

Return travel times of every given phase.

get_travel_times_geo

Return travel times of every given phase given geographical data.

Special Methods

TauPyModel.__delattr__(name, /)

Implement delattr(self, name).

TauPyModel.__dir__()

Default dir() implementation.

TauPyModel.__eq__(value, /)

Return self==value.

TauPyModel.__format__(format_spec, /)

Default object formatter.

TauPyModel.__ge__(value, /)

Return self>=value.

TauPyModel.__getattribute__(name, /)

Return getattr(self, name).

TauPyModel.__gt__(value, /)

Return self>value.

TauPyModel.__hash__()

Return hash(self).

TauPyModel.__init__(model='iasp91', verbose=False, planet_flattening=0.0, cache=None)[source]

Loads an already created TauPy model.

Parameters:
  • model – The model name. Either an internal TauPy model or a filename in the case of custom models.

  • planet_flattening (float) – Flattening parameter for the planet’s ellipsoid (i.e. (a-b)/a, where a is the semimajor equatorial radius and b is the semiminor polar radius). A value of 0 (the default) gives a spherical planet. Note that this is only used to convert from geographical positions (source and receiver latitudes and longitudes) to epicentral distances - the actual traveltime and raypath calculations are performed on a spherical planet.

  • cache (collections.OrderedDict or bool) – An object to use to cache models split at source depths. Generating results requires splitting a model at the source depth, which may be expensive. The cache allows faster calculation when multiple results are requested for the same source depth. The dictionary must be ordered, otherwise the LRU cache will not behave correctly. If False is specified, then no cache will be used.

Usage:

>>> from obspy.taup import tau
>>> i91 = tau.TauPyModel()
>>> print(i91.get_travel_times(10, 20)[0].name)
P
>>> i91.get_travel_times(10, 20)[0].time  
272.675...
>>> len(i91.get_travel_times(100, 50, phase_list = ["P", "S"]))
2
TauPyModel.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

TauPyModel.__le__(value, /)

Return self<=value.

TauPyModel.__lt__(value, /)

Return self<value.

TauPyModel.__ne__(value, /)

Return self!=value.

TauPyModel.__new__(**kwargs)
TauPyModel.__reduce__()

Helper for pickle.

TauPyModel.__reduce_ex__(protocol, /)

Helper for pickle.

TauPyModel.__repr__()

Return repr(self).

TauPyModel.__setattr__(name, value, /)

Implement setattr(self, name, value).

TauPyModel.__sizeof__()

Size of object in memory, in bytes.

TauPyModel.__str__()

Return str(self).

TauPyModel.__subclasshook__()

Abstract classes can override this to customize issubclass().

This is invoked early on by abc.ABCMeta.__subclasscheck__(). It should return True, False or NotImplemented. If it returns NotImplemented, the normal algorithm is used. Otherwise, it overrides the normal algorithm (and the outcome is cached).