obspy.taup.slowness_model.SlownessModel.layer_time_dist

SlownessModel.layer_time_dist(spherical_ray_param, layer_num, is_p_wave, check=True, allow_turn=False)[source]

Calculate time and distance for a ray passing through a layer.

Calculates the time and distance increments accumulated by a ray of spherical ray parameter p when passing through layer layer_num. Note that this gives half of the true range and time increments since there will be both an upgoing and a downgoing path. It also only does the calculation for the simple cases of the centre of the planet, where the ray parameter is zero, or for constant velocity layers. Otherwise, it calls bullen_radial_slowness().

Either spherical_ray_param or layer_num must be 0-D, or they must have the same shape.

Parameters:
  • spherical_ray_param (float or ndarray) – The spherical ray parameter of the ray(s), in s/km.

  • layer_num (float or ndarray) – The layer(s) in which the calculation should be done.

  • is_p_wave (bool) – Whether to look at the P (True) or S (False) wave.

  • check (bool) – Whether to perform checks of input consistency.

  • allow_turn (bool) – Whether to allow the ray to turn in the middle of a layer.

Returns:

The time (in s) and distance (in rad) increments for the specified ray(s) and layer(s).

Return type:

ndarray (dtype = obspy.taup.helper_classes.TimeDist, shape = spherical_ray_param.shape or layer_num.shape)

Raises:

SlownessModelError – If the ray with the given spherical ray parameter cannot propagate within this layer, or if the ray turns within this layer but not at the bottom. These checks may be bypassed by specifying check=False.