SlownessModel.layer_number_below(depth, is_p_wave)[source]

Find the index of the slowness layer that contains the given depth.

Note that if the depth is a layer boundary, it returns the deeper of the two or possibly more (since total reflections are zero thickness layers) layers.

  • depth (float or ndarray) The depth to find, in km.
  • is_p_wave (bool) Whether to look at P (True) velocity or S (False) velocity.

The slowness layer containing the requested depth.

Return type:

int or ndarray (dtype = int, shape = depth.shape)

Raises SlownessModelError:

If no layer in the slowness model contains the given depth.