geolime.geostats.variogram.variogram¶
Data:
|
Callable type; Callable[[int], str] is a function of (int) -> str. |
|
The central part of internal API. |
Classes:
|
Generic enumeration. |
Functions:
|
Compute the angle between two vectors using the dot product |
|
Compute the covariance given an array of values for a set of pairs |
|
Compute directional vector from angles |
|
Generate lags array to be used with variogram |
|
Return a function that checks for an index vector if it belongs to an angular range. |
|
Check if target angle lies within a range of angles (defined by an angle tolerance) |
|
Return a function that check whether a vector (cartesian coordinates) lies within a slice (defined by a width and a height in meters) |
|
Matrix or vector norm. |
|
(Adapted from Apach Commons normalizeAngle, MathUtils sources) Normalize an angle in a 2pi; wide interval around a center value. |
|
Computes pairwise distances |
|
Convert plane angles to line angles. |
|
Rotation againt the Z axis |
|
Example of a convention (RGeoStats) |
|
Compare vectors from a set of indices |
|
Check whether a set of points (linked to their distances) match the input restricted boundaries. |
|
Compare vectors from a set of indices |
|
Check whether a set of distances lie within a lag-range. |
|
Compute the semivariance given an array of values for a set of pairs |
|
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) |
-
geolime.geostats.variogram.variogram.
covariance
(values: numpy.ndarray, indices: numpy.ndarray)¶ Compute the covariance given an array of values for a set of pairs
- Parameters
values (np.ndarray) – Array of float values
indices (np.ndarray) – List of pairs (couple of integers) for a specific lag
- Returns
Covariance
- Return type
float
-
geolime.geostats.variogram.variogram.
directional_vector
(dimension: int, geographic_azimuth: float, dip: float, pitch: float, deg: bool = True)¶ Compute directional vector from angles
- Parameters
dimension (int) – Angle dimension to be set for rotation convention
geographic_azimuth (float) – z-axis rotation angle
dip (float) – y-axis rotation angle
pitch – x-axis rotation angle
deg – Indicates if input angles are in degrees or not
- Returns
Directional vector, trend and plunge
- Return type
np.ndarray, float, float
-
geolime.geostats.variogram.variogram.
generate_lags
(lag: float, plag: float, nlags: int)¶ Generate lags array to be used with variogram
- Parameters
lag (float) – Calculation lag in meters
plag (float) – Tolerance (percentage of lag)
nlags (int) – Length of array to be generated
- Returns
An array of lags and the tolerance in meters
- Return type
np.ndarray, float
-
geolime.geostats.variogram.variogram.
in_angle
(vdir: numpy.ndarray, atol: float)¶ Return a function that checks for an index vector if it belongs to an angular range. Intended to be used for performance vectorization.
- Parameters
vdir (np.ndarray) – Directional vector, computed once during initialization
atol (float) – Angular tolerance in radians
- Returns
A function that returns True if vector is in the angular range, False if the vector is outside
- Return type
Callable
-
geolime.geostats.variogram.variogram.
in_range
(target: float, atol: float)¶ Check if target angle lies within a range of angles (defined by an angle tolerance)
- Parameters
target (float) – Angle to be checked (in radians)
atol (float) – Angular tolerance in radians
- Returns
if True: target is in range, if False: target is outside range
- Return type
bool
-
geolime.geostats.variogram.variogram.
in_slice
(trend: float, plunge: float, vdir: numpy.ndarray, width: float = inf, height: float = inf)¶ Return a function that check whether a vector (cartesian coordinates) lies within a slice (defined by a width and a height in meters)
- Parameters
trend (float) – Angle for y-axis rotation (in radians)
plunge (float) – Angle for y-axis rotation (in radians)
vdir (np.ndarray) – Directional vector array
plunge –
width (float) – Slicing width (in meters)
height (float) – Slicing height (in meters)
- Returns
A function that returns True if vector is in the slice, False if the vector is outside slice
- Return type
Callable
-
geolime.geostats.variogram.variogram.
select_index_from_slice
(idx: pandas.core.frame.DataFrame, f: Callable)¶ Compare vectors from a set of indices
- Parameters
idx (pd.DataFrame) – Dataframe containing indices to be checked
f (Callable) – Index selector function
- Returns
a selection of indices
- Return type
pd.DataFrame
-
geolime.geostats.variogram.variogram.
select_indices
(coords: numpy.ndarray, pwdist: numpy.ndarray, lag: float, tol: float, atol: float, f_in_angle: Callable, f_in_slice: Callable)¶ 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
coords (np.ndarray) – Cartesian coordinates in float
pwdist (np.ndarray) – N * N matrix of pairwise distances (in float)
lag (float) – Lag in meters
tol (float) – Lag tolerance in meters
f_in_angle (Callable) – Index selector function for angle
f_in_slice (Callable) – Index selector function for slice
atol (float) – Angular tolerance in degrees
- Returns
Array of indices (couple of integers)
- Return type
np.ndarray
-
geolime.geostats.variogram.variogram.
select_indices_from_angle
(idx: pandas.core.frame.DataFrame, f: Callable)¶ Compare vectors from a set of indices
- Parameters
idx (pd.DataFrame) – Dataframe containing indices to be checked
f (Callable) – Index selector function
- Returns
a selection of indices
- Return type
pd.DataFrame
-
geolime.geostats.variogram.variogram.
select_indices_from_lag
(pwdist: numpy.ndarray, lag: float, tol: float)¶ 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
pwdist (np.ndarray) – N * N pairwise distances
lag (float) – lag to be compared to (in meters)
tol (float) – lag tolerance (in meters)
- Returns
dataframe of indices lying in a lag tolerance
- Return type
pd.DataFrame
-
geolime.geostats.variogram.variogram.
semivariance
(values: numpy.ndarray, indices: numpy.ndarray, weights: numpy.ndarray = None)¶ Compute the semivariance given an array of values for a set of pairs
- Parameters
values (np.ndarray) – Array of float values
indices (np.ndarray) – List of pairs (couple of integers) for a specific lag
weights (np.ndarray) – Optional weights array for semivariance computation
- Returns
Semivariance value
- Return type
float
-
geolime.geostats.variogram.variogram.
variogram
(coords: numpy.ndarray, values: numpy.ndarray, lags: List[float], tol: float, geographic_azimuth: float, dip: float, pitch: float, atol: float, slice_width: float = inf, slice_height: float = inf, method: enum.Enum = 'semivariogram', weights: numpy.ndarray = 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
coords (np.ndarray) – Array of cartesian coordinates (in float)
values (np.ndarray) – Array of values associated with points
lags (List[float]) – List of lags (in meters)
tol (float) – Lag tolerance in meters
geographic_azimuth (float) – z-axis rotation angle in degrees
dip (float) – y-axis rotation angle in degrees
pitch (float) – x-axis rotation angle in degrees
atol (float) – Angular tolerance in degrees
slice_width (float) – Slicing width (in meters)
slice_height (float) – Slicing height (in meters)
method (Enum) – Computation method
weights (np.ndarray) – Optional weights array for semivariance computation
- Returns
A variogram dataframe, Isatis compliant output (rank, number of pairs, input lag, average distance, variogram value and indices)
- Return type
pd.DataFrame