obspy.signal.rotate._dip_azimuth2zse_base_vector

_dip_azimuth2zse_base_vector(dip, azimuth)[source]

Helper function converting a vector described with azimuth and dip of unit length to a vector in the ZSE (Vertical, South, East) base.

The definition of azimuth and dip is according to the SEED reference manual, as are the following examples (they use rounding for small numerical inaccuracies - also positive and negative zero are treated as equal):

>>> r = lambda x: np.array([_i if _i != -0.0 else 0.0        for _i in np.round(x, 10)])
>>> r(_dip_azimuth2zse_base_vector(-90, 0)) 
array([ 1., 0., 0.])
>>> r(_dip_azimuth2zse_base_vector(90, 0)) 
array([-1., 0., 0.])
>>> r(_dip_azimuth2zse_base_vector(0, 0)) 
array([ 0., -1., 0.])
>>> r(_dip_azimuth2zse_base_vector(0, 180)) 
array([ 0., 1., 0.])
>>> r(_dip_azimuth2zse_base_vector(0, 90)) 
array([ 0., 0., 1.])
>>> r(_dip_azimuth2zse_base_vector(0, 270)) 
array([ 0., 0., -1.])