Skip to content

Metric🍋

AziDipPitch dataclass 🍋

Bases: Convention

Azimuth Dip Pitch Convention class.

rot_mat(angles) 🍋

Rotation matrix computation given angles.

Parameters:

Name Type Description Default
angles Angles

Azimuth, Dip and Pitch angles.

required

Returns:

Type Description
ndarray

np.ndarray: Rotation Matrix.

BearingPlungeDip dataclass 🍋

Bases: Convention

Bearing Plunge Dip Convention class.

rot_mat(angles) 🍋

Rotation matrix computation given angles.

Parameters:

Name Type Description Default
angles Angles

Bearing, Plunge and Dip angles.

required

Returns:

Type Description
ndarray

np.ndarray: Rotation Matrix.

Convention dataclass 🍋

Bases: Entity

Convention class.

Attributes:

Name Type Description
axes_seq str

order of axis.

orientation Tuple[AngleDirection, AngleDirection, AngleDirection]

orientation of angles.

angle_units AngleUnit

unit of angles.

rot_mat(angles) 🍋

Rotation matrix computation given angles.

Parameters:

Name Type Description Default
angles Angles

Angle or sequence of angles.

required

Returns:

Type Description
ndarray

np.ndarray: Rotation Matrix.

Metric 🍋

Bases: Entity

Metric class.

Attributes:

Name Type Description
scales Vector

Major axes of ellipsoid.

angles Angles

Azimuth/dip/pitch of main direction.

anisotropy Convention

Metric anisotropy matrix.

rot_mat ndarray

Rotation matrix.

dimension int

Metric dimension.

convention Convention

Metric convention.

angles: Angles property writable 🍋

Vector of the ellipsoid used for the anisotropy. 1 value in 2 dimensions(Azimuth), 3 values in 3 dimensions(Azimuth/Dip/Pitch).

Returns:

Type Description
Angles

Ellipsoid angles.

anisotropy: np.ndarray property 🍋

Matrix used for distance computation in a Mahalanobis definition. See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.spatial.distance.mahalanobis.html#scipy.spatial.distance.mahalanobis.

Returns:

Type Description
ndarray

Matrix of anisotropy.

convention: Convention property 🍋

Return Metric convention.

Returns:

Type Description
Convention

Metric Convention.

dimension: int property 🍋

Return Metric dimension.

Returns:

Type Description
int

Metric Dimension.

rot_mat: np.ndarray property 🍋

Rotation Matrix

Returns:

Type Description
ndarray

Matrix of rotation.

scales: Vector property writable 🍋

Vector of the ellipsoid used for the anisotropy. 2 values in 2 dimensions, 3 values in 3 dimension.

Returns:

Type Description
Vector

Ellipsoid scales.

distance_matrix(x, y) 🍋

Computes the distance matrix of two sets of points in the Euclidean space according to a distance.

Parameters:

Name Type Description Default
x Vector

A numpy matrix with the vectors to be analized in its rows.

required
y Vector

A numpy matrix with the vectors to be analized in its rows (it must have the same number of columns as X1)

required

Returns:

Type Description
ndarray

This functions returns a numpy matrix, where the (i,j)-th element

ndarray

corresponds to the distance between the i-th row of X1 and the

ndarray

j-th row of X2.

eval(x, y) 🍋

Compute the Euclidean distance between two points, given ellipsoid anisotropy.

x and y must be
  • Two numpy arrays of same dimension
  • One numpy matrix and one numpy array, obtaining a numpy vector of distances between the rows of the matrix and the numpy vector (there must be a column compatibility)
  • Two numpy matrices of the same shape, obtaining a numpy vector with the distances between their rows.

Parameters:

Name Type Description Default
x Vector

First array for distance computation.

required
y Vector

Second array for distance computation.

required

Returns:

Type Description
float

Metric vector.

to_pyvista(center=[0.0, 0.0, 0.0]) 🍋

Export Metric to Pyvista PolyData.

Returns:

Type Description

PolyData object.


Last update: 2022-12-23