Variography analysis🍋
directional_vector(geographic_azimuth, dip, pitch)
🍋
Compute directional vector from angles.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
geographic_azimuth |
float |
z-axis rotation angle. |
required |
dip |
float |
y-axis rotation angle. |
required |
pitch |
float |
x-axis rotation angle. |
required |
Returns:
Type | Description |
---|---|
Tuple[numpy.ndarray, float, float] |
Directional vector, trend and plunge. |
generate_lags(lag, plag, nlags)
🍋
Generate lags array to be used with variogram
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lag |
float |
Calculation lag in meters |
required |
plag |
float |
Tolerance (percentage of lag) |
required |
nlags |
int |
Length of array to be generated |
required |
Returns:
Type | Description |
---|---|
Tuple[numpy.ndarray, float] |
An array of lags and the tolerance in meters |
in_angle(vidx, vdir, atol)
🍋
Return a function that checks for an index vector if it belongs to an angular range. Intended to be used for performance vectorization.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vidx |
ndarray |
Points to check the angle. |
required |
vdir |
ndarray |
Directional vector, computed once during initialization. |
required |
atol |
float |
Angular tolerance in radians. |
required |
Returns:
Type | Description |
---|---|
ndarray |
A function that returns True if vector is in the angular range, False if the vector is outside. |
in_range(target, atol)
🍋
Check if target angle lies within a range of angles (defined by an angle tolerance)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
target |
ndarray |
Array of angles to be checked (in radians) |
required |
atol |
float |
Angular tolerance in radians |
required |
Returns:
Type | Description |
---|---|
if True |
target is in range, if False: target is outside range |
in_slice(point, cp, p1, p3, width, height)
🍋
Return a function that check whether a vector (cartesian coordinates) lies within a slice (defined by a width and a height in meters)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
point |
ndarray |
Points to check the slicing dimensions. |
required |
cp |
ndarray |
Normal vector to given plane. |
required |
p1 |
ndarray |
Point in given plane. |
required |
p3 |
ndarray |
Point in given plane. |
required |
width |
Optional[float] |
Slicing width (in meters) |
required |
height |
Optional[float] |
Slicing height (in meters) |
required |
Returns A function that returns True if vector is in the slice, False if the vector is outside slice
normal_vector(trend, plunge)
🍋
Generate normal vector and in-plane points defined by a plane.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
trend |
float |
Trend of defined plane |
required |
plunge |
float |
Plunge of defined plane |
required |
Returns:
Type | Description |
---|---|
Tuple[numpy.ndarray, numpy.ndarray, numpy.ndarray] |
Normal vector and 2 in-plane points useful for slicing checks in variography. |
select_index_from_slice(idx, cp, p1, p3, slice_width, slice_height)
🍋
Compare vectors from a set of indices
Parameters:
Name | Type | Description | Default |
---|---|---|---|
idx |
DataFrame |
Dataframe containing indices to be checked |
required |
cp |
ndarray |
Normal vector to given plane. |
required |
p1 |
ndarray |
Point in given plane. |
required |
p3 |
ndarray |
Point in given plane. |
required |
slice_width |
float |
Slicing width for limitation of neighbors search |
required |
slice_height |
float |
Slicing height for limitation of neighbors search |
required |
Returns:
Type | Description |
---|---|
DataFrame |
A selection of indices |
select_indices(coords, pwdist, lag, tol, atol, cp, p1, p3, vdir, slice_width, slice_height)
🍋
Check whether a set of points (linked to their distances) match the input restricted boundaries. This function will first check if a set of points lie in a lag range. Then will process the indices for angular range conformity. Lastly, the resulting indices are tested against slicing boundaries (if slicing arguments are provided)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
coords |
ndarray |
Cartesian coordinates in float |
required |
pwdist |
ndarray |
N * N matrix of pairwise distances (in float) |
required |
lag |
float |
Lag in meters |
required |
tol |
float |
Lag tolerance in meters |
required |
atol |
float |
Angular tolerance in degrees. |
required |
cp |
Optional[numpy.ndarray] |
Normal vector to given plane. |
required |
p1 |
Optional[numpy.ndarray] |
Point in given plane. |
required |
p3 |
Optional[numpy.ndarray] |
Point in given plane. |
required |
vdir |
ndarray |
Directional vector of plane. |
required |
slice_width |
Optional[float] |
Slicing width for limitation of neighbors search |
required |
slice_height |
Optional[float] |
Slicing height for limitation of neighbors search |
required |
Returns:
Type | Description |
---|---|
ndarray |
Array of indices (couple of integers) |
select_indices_from_angle(idx, vdir, atol)
🍋
Compare vectors from a set of indices
Parameters:
Name | Type | Description | Default |
---|---|---|---|
idx |
DataFrame |
Dataframe containing indices to be checked |
required |
vdir |
ndarray |
Directional vector of plane. |
required |
atol |
float |
Angular tolerance in degrees. |
required |
Returns:
Type | Description |
---|---|
DataFrame |
A selection of indices |
select_indices_from_lag(pwdist, lag, tol)
🍋
Check whether a set of distances lie within a lag-range.
From geostatsmodels original comment: grab the coordinates in a given range: lag ± tolerance and take out the repeated elements, since p is a symmetric distance matrix
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pwdist |
ndarray |
N * N pairwise distances |
required |
lag |
float |
lag to be compared to (in meters) |
required |
tol |
float |
lag tolerance (in meters) |
required |
Returns:
Type | Description |
---|---|
DataFrame |
Dataframe of indices lying in a lag tolerance |
semivariance(values, indices, weights=None)
🍋
Compute the semivariance given an array of values for a set of pairs
Parameters:
Name | Type | Description | Default |
---|---|---|---|
values |
ndarray |
Array of float values |
required |
indices |
ndarray |
List of pairs (couple of integers) for a specific lag |
required |
weights |
Optional[numpy.ndarray] |
Optional weights array for semivariance computation |
None |
Returns:
Type | Description |
---|---|
float |
Semivariance value |
variogram(object, attribute, region, geographic_azimuth, dip, pitch, lags, tol=0.5, atol=45, slice_width=None, slice_height=None, weights_attribute=None)
🍋
Given boundary input arguments (lag and its associated tolerance, angular reference and its associated tolerance), compute the variogram for a set of points (value associated with cartesian coordinates for a specific point)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
object |
GeoRefObject |
Geo-ref Object. |
required |
attribute |
str |
Object attribute to compute variography on. |
required |
region |
Optional[str] |
Object region to select data from. |
required |
geographic_azimuth |
float |
Azimuth angle, in degrees, comprised between 0 and 360. |
required |
dip |
float |
Dip angle, in degrees, comprised between 0 and 90. |
required |
pitch |
float |
Pitch angle, in degrees, comprised between -90 and 90. |
required |
lags |
~Vector |
List of lags (in meters). |
required |
tol |
Optional[float] |
Lag tolerance, comprised between 0 and 1. |
0.5 |
atol |
Optional[float] |
Angular tolerance in degrees. |
45 |
slice_width |
Optional[float] |
Slicing width (in meters). |
None |
slice_height |
Optional[float] |
Slicing height (in meters). |
None |
weights_attribute |
Optional[str] |
Weights attribute for ponderation, generally coming from declustering. |
None |
Returns:
Type | Description |
---|---|
DataFrame |
A variogram dataframe, Isatis compliant output (rank, number of pairs, input lag, average distance, variogram value and indices) |