Skip to content

Commit

Permalink
Change amplitude to intensity in vector_to_angles
Browse files Browse the repository at this point in the history
  • Loading branch information
YagoMCastro committed Jun 26, 2024
1 parent f900d94 commit 4e4d4e5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions magali/_input_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def random_unitary_vector(dispersion_angle, loc=0, size=100):

def vector_to_angles(vector):
r"""
Generate inclination, declination, and amplitude from a 3-component vector
Generate inclination, declination, and intensity from a 3-component vector
.. note::
Expand All @@ -167,15 +167,15 @@ def vector_to_angles(vector):
Returns
-------
inclination : float or array
The inclination values in degrees.
Inclination of the magnetic vector in degrees.
declination : float or array
The declination values in degrees.
amplitude : float or array
The vector amplitude values.
Declination of the magnetic vector in degrees
intensity : float or array
Intensity of the magnetic vector.
"""
vector = np.asarray(vector)
x, y, z = vector.T
amplitude = np.sqrt(x**2 + y**2 + z**2)
intensity = np.sqrt(x**2 + y**2 + z**2)
inclination = -np.degrees(np.arctan2(z, np.hypot(x, y)))
declination = np.degrees(np.arctan2(x, y))
return inclination, declination, amplitude
return inclination, declination, intensity

0 comments on commit 4e4d4e5

Please sign in to comment.