harmonica.Ellipsoid#
- class harmonica.Ellipsoid(a, b, c, yaw=0.0, pitch=0.0, roll=0.0, center=(0.0, 0.0, 0.0), *, density=None, susceptibility=None, remanent_mag=None)[source]#
Ellipsoidal body with arbitrary rotation.
- Parameters:
- a, b, c
float Semi-axis lengths of the ellipsoid in meters.
- yaw
float,optional Rotation angle about the upward axis, in degrees.
- pitch
float,optional Rotation angle about the northing axis (after yaw rotation), in degrees. A positive pitch angle lifts the side of the ellipsoid pointing in easting direction.
- roll
float,optional Rotation angle about the easting axis (after yaw and pitch rotation), in degrees.
- center
tupleoffloat,optional Coordinates of the center of the ellipsoid in the following order: easting, northing, upward, in meters.
- density
floatorNone,optional Density of the ellipsoid in \(kg/m^3\).
- susceptibility
float, (3, 3)arrayorNone,optional Magnetic susceptibility of the ellipsoid in SI units. A single float represents isotropic susceptibility in the body. A (3, 3) array represents the susceptibility tensor to account for anisotropy (defined in the local coordinate system of the ellipsoid). If None, zero susceptibility will be assigned to the ellipsoid.
- remanent_mag(3,)
arrayorNone,optional Remanent magnetization vector of the ellipsoid in A/m units. Its components are defined in the easting-northing-upward coordinate system and should be passed in that order. If None, no remanent magnetization will be assigned to the ellipsoid.
- a, b, c
Notes
The three semi-axes
a,b, andcare defined parallel to theeasting,northingandupwarddirections, respectively, before applying any rotation.Rotations directed by
yawandrollare applied using the right-hand rule across their respective axes. Pitch rotations are carried out in the opposite direction, so a positivepitchlifts the side of the ellipsoid pointing in the easting direction.- Attributes:
aLength of the first semiaxis in meters.
bLength of the second semiaxis in meters.
cLength of the third semiaxis in meters.
densityDensity of the ellipsoid in \(kg/m^3\).
remanent_magRemanent magnetization of the ellipsoid in A/m.
rotation_matrixCreate a rotation matrix for the ellipsoid.
susceptibilityMagnetic susceptibility of the ellipsoid in SI units.
Methods
to_pyvista(**kwargs)Export ellipsoid to a
pyvista.PolyDataobject.
- Ellipsoid.to_pyvista(**kwargs)[source]#
Export ellipsoid to a
pyvista.PolyDataobject.Important
The
pyvistaoptional dependency must be installed to use this method.- Parameters:
- kwargs
dict Keyword arguments passed to
pyvista.ParametricEllipsoid.
- kwargs
- Returns:
- ellipsoid
pyvista.PolyData A PyVista’s parametric ellipsoid.
- ellipsoid
Attributes#
- Ellipsoid.a#
Length of the first semiaxis in meters.
- Ellipsoid.b#
Length of the second semiaxis in meters.
- Ellipsoid.c#
Length of the third semiaxis in meters.
- Ellipsoid.density#
Density of the ellipsoid in \(kg/m^3\).
- Ellipsoid.remanent_mag#
Remanent magnetization of the ellipsoid in A/m.
- Ellipsoid.rotation_matrix#
Create a rotation matrix for the ellipsoid.
Use this matrix to rotate from the local coordinate system (centered in the ellipsoid center) in to the global coordinate system (easting, northing, upward).
- Returns:
- rotation_matrix(3, 3)
array Rotation matrix that transforms coordinates from the local ellipsoid-aligned coordinate system to the global coordinate system.
- rotation_matrix(3, 3)
Notes
Generate the rotation matrix from Tait-Bryan intrinsic angles: yaw, pitch, and roll. The rotations are applied in the following order: (ZŶX). Yaw (Z) and roll (X) rotations are done using the right-hand rule. Rotations for the pitch (Ŷ) are carried out in the opposite direction, so positive pitch lifts the easting axis.
- Ellipsoid.susceptibility#
Magnetic susceptibility of the ellipsoid in SI units.