@staticmethod
def calc_depth_tor(mag: float, mechanism: str) ->float:
    """Calculate an estimate of the depth to top of rupture (km).

        Parameters
        ----------
        mag : float
            moment magnitude of the event (:math:`M_w`)
        mechanism : str
            fault mechanism. Valid options: "U", "SS", "NS",
            "RS".

        Returns
        -------
        depth_tor : float
            estimated depth to top of rupture (km)

        """
    if mechanism == 'RS':
        depth_tor = 2.704 - 1.226 * max(mag - 5.849, 0)
    else:
        depth_tor = 2.673 - 1.136 * max(mag - 4.97, 0)
    return max(depth_tor, 0) ** 2
