@@ -299,17 +299,17 @@ def cartesian2amplitude_dip_azimuth(m):
299299 Convert from cartesian to amplitude, dip (positive down) and
300300 azimuth (clockwise for North), in degree.
301301 """
302- m = m .reshape ((- 1 , 3 ), order = 'F' )
303- atp = cartesian2spherical (m ).reshape ((- 1 , 3 ), order = 'F' )
302+ m = m .reshape ((- 1 , 3 ), order = "F" )
303+ atp = cartesian2spherical (m ).reshape ((- 1 , 3 ), order = "F" )
304304 atp [:, 1 ] = np .rad2deg (- 1.0 * atp [:, 1 ])
305305 atp [:, 2 ] = (450.0 - np .rad2deg (atp [:, 2 ])) % 360.0
306306
307307 return atp
308308
309309
310310def spherical2cartesian (m ):
311- """ Convert from spherical to cartesian """
312- m = m .reshape ((- 1 , 3 ), order = 'F' )
311+ """Convert from spherical to cartesian"""
312+ m = m .reshape ((- 1 , 3 ), order = "F" )
313313 a = m [:, 0 ] + 1e-8
314314 t = m [:, 1 ]
315315 p = m [:, 2 ]
@@ -356,7 +356,7 @@ def spherical2cartesian(m):
356356 - :math:`p` is the radial angle defined positive CCW from Easting
357357
358358 """
359- m = m .reshape ((- 1 , 3 ), order = 'F' )
359+ m = m .reshape ((- 1 , 3 ), order = "F" )
360360 a = m [:, 0 ] + 1e-8
361361 t = m [:, 1 ]
362362 p = m [:, 2 ]
@@ -433,13 +433,9 @@ def coterminal(theta):
433433 Coterminal angles
434434
435435 """
436+ coterminal = (theta + np .pi ) % (2 * np .pi ) - np .pi
436437
437- sub = theta [np .abs (theta ) >= np .pi ]
438- sub = - np .sign (sub ) * (2 * np .pi - np .abs (sub ))
439-
440- theta [np .abs (theta ) >= np .pi ] = sub
441-
442- return theta
438+ return coterminal
443439
444440
445441def define_plane_from_points (xyz1 , xyz2 , xyz3 ):
0 commit comments