Currently, the magnetization argument in prism_magnetic and the magnetic_moments argument in dipole_magnetic expect a 2d array where each row corresponds to the magnetization or magnetic moment vector for each prism or dipole, respectively.
For example, if we have 5 dipoles, the magnetic_moments should be:
This introduces some inconsistencies. For example, passing arrays to the hm.magnetic_angles_to_vec would return a tuple of three arrays, one for each component of the magnetization/magnetic field. So in order to obtain magnetic moments from inclination, declination and amplitude, we would need to transpose those.
Moreover, the current 2d array is not in agreement how we treat coordinates in Harmonica: they are usually a tuple with easting, northing and upward arrays.
The solution
We should change the expected inputs of these functions so they take magnetization and magnetic_moments as a tuple with three 1-d arrays. Following the previous example, they should be:
The problem
Currently, the
magnetization
argument inprism_magnetic
and themagnetic_moments
argument indipole_magnetic
expect a 2d array where each row corresponds to the magnetization or magnetic moment vector for each prism or dipole, respectively.For example, if we have 5 dipoles, the
magnetic_moments
should be:This introduces some inconsistencies. For example, passing arrays to the
hm.magnetic_angles_to_vec
would return a tuple of three arrays, one for each component of the magnetization/magnetic field. So in order to obtain magnetic moments from inclination, declination and amplitude, we would need to transpose those.Moreover, the current 2d array is not in agreement how we treat coordinates in Harmonica: they are usually a tuple with
easting
,northing
andupward
arrays.The solution
We should change the expected inputs of these functions so they take
magnetization
andmagnetic_moments
as a tuple with three 1-d arrays. Following the previous example, they should be:This change was discussed in Fatiando Meeting of 2024-01-04
Are you willing to help implement and maintain this feature?
Yes, but anyone that wants to tackle it is more than welcome!
We should work on this before the next release, so we don't release the new magnetic functions with an interface that will be deprecated.