def get_azimuth_plunge(vect, degrees=True):
    '''
    For a given vector in USE format, retrieve the azimuth and plunge
    '''
    if vect[0] > 0:
        vect = -1. * np.copy(vect)
    vect_hor = sqrt(vect[1] ** 2. + vect[2] ** 2.)
    plunge = atan2(-vect[0], vect_hor)
    azimuth = atan2(vect[2], -vect[1])
    if degrees:
        icr = 180. / pi
        return icr * azimuth % 360., icr * plunge
    else:
        return azimuth % (2. * pi), plunge
def get_azimuth_plunge ( vect , degrees = True ) : if vect [ 0 ] > 0 : vect = - 1. * np . copy ( vect ) vect_hor = sqrt ( vect [ 1 ] ** 2. + vect [ 2 ] ** 2. ) plunge = atan2 ( - vect [ 0 ] , vect_hor ) azimuth = atan2 ( vect [ 2 ] , - vect [ 1 ] ) if degrees : icr = 180. / pi return icr * azimuth % 360. , icr * plunge else : return azimuth % ( 2. * pi ) , plunge
For a given vector in USE format, retrieve the azimuth and plunge