krigekit.variogram_geometry#

Lag geometry, anisotropic distance, and engine-compatible rotations.

Functions#

calc_lag_vectors(coord0, coord1[, pairwise])

Return signed lag vectors coord1 - coord0.

calc_anisotropic_lag(lag, *[, anis1, anis2, azimuth, ...])

Calculate engine-compatible equivalent major-axis lag distance.

azimuth_dip_to_vector(azimuth[, dip])

Unit vector for an azimuth (deg, clockwise from +Y/North) and dip

rotation_matrix_3d([azimuth, dip, rake])

Right-handed 3D rotation whose columns are the principal axes.

Module Contents#

krigekit.variogram_geometry.calc_lag_vectors(coord0, coord1, pairwise=False)#

Return signed lag vectors coord1 - coord0.

Coordinates may be single points or (n, dim) arrays. By default, matching rows are compared and a single point is broadcast. With pairwise=True the result has shape (n0, n1, dim).

krigekit.variogram_geometry.calc_anisotropic_lag(lag, *, anis1=1.0, anis2=1.0, azimuth=0.0, dip=0.0, plunge=0.0)#

Calculate engine-compatible equivalent major-axis lag distance.

anis1 and anis2 are the first and second minor/major range ratios. Isotropic input therefore uses both ratios equal to one. The returned lag remains in coordinate units; dividing it by the major range gives the reduced lag used by the variogram kernels.

krigekit.variogram_geometry.azimuth_dip_to_vector(azimuth, dip=0.0)#

Unit vector for an azimuth (deg, clockwise from +Y/North) and dip (deg below horizontal, positive down). Returns a length-3 array [x, y, z].

krigekit.variogram_geometry.rotation_matrix_3d(azimuth=0.0, dip=0.0, rake=0.0)#

Right-handed 3D rotation whose columns are the principal axes.

The major axis points along azimuth/dip; rake (the model plunge) rotates the minor axes about the major axis. Useful for building anisotropic search/model coordinate frames or directional axis sets for directional_vgm().

The axes are taken from the engine-consistent _engine_rotation(): its rows are the data-space principal directions in model-axis order (minor1, major, minor2), which are reordered to (major, minor1, minor2) columns here, flipping minor2 to keep the frame right-handed.