obspy.taup.tau.TauPyModel.__init__¶

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

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