geolime.geostats.math.neighborhood¶
Data:
|
Callable type; Callable[[int], str] is a function of (int) -> str. |
|
The central part of internal API. |
Classes:
|
|
Functions:
|
Anisotropic distance between two points according to the anisotropy matrix a. |
|
Function to compute the indexes indicating the order in which the rows of X are close to p according to the distance distance (from small distance to large distance) |
|
Compute the Euclidean distance between two points. |
|
Example of a convention (RGeoStats) |
|
Compute the angles in radians necessary for matrix rotation operation from geographic azimuth, dip and pitch angles defined in degrees |
|
Function to return the indexes of the points which are in a (closed) ball in the Euclidean space. |
|
Function to return the indexes of the points which are in a (closed) parallelepiped in the Euclidean space. |
|
Function to obtain the N closest points of a set of points to the # center of a ball which are on that ball. |
-
class
geolime.geostats.math.neighborhood.
MinMaxPointsNeighborhood
(dim: int, angles: List[float], scales: List[float], min_n: int, max_n: int, convention: Callable = <function rot_zyx>)¶ Bases:
geolime.geostats.math.neighborhood.Neighborhood
Methods:
select
(x, p)Neighborhood selection function.
-
select
(x: numpy.ndarray, p: numpy.ndarray)¶ Neighborhood selection function.
- Parameters
x (np.ndarray) – A numpy matrix where each row is a vector in the Euclidean Space
p (np.ndarray) – A numpy vector indicating the position (center of the ball). By default is a vector of zeros in dimension 3.
- Returns
This function returns the indixes of the N rows of X which are the closest to the vector p according to the distance
- Return type
np.ndarray
-
-
class
geolime.geostats.math.neighborhood.
Neighborhood
¶ Bases:
object
Methods:
select
(x, p)-
select
(x, p)¶
-
-
geolime.geostats.math.neighborhood.
arg_sort_near_points
(p: numpy.ndarray, x: numpy.ndarray, distance: Callable = <function euclidian_distance>)¶ Function to compute the indexes indicating the order in which the rows of X are close to p according to the distance distance (from small distance to large distance)
- Parameters
p (np.ndarray) – Vector with respect to which calculate the distances.
x (np.ndarray) – A numoy matrix with the vectors to be analyzed in its rows.
distance (Callable) – A Distance function.
- Returns
Returns the indexes of the rows of X according to which are closer to p according to the distance Distance. Note: this function could be easily vectorized in p using the Distance Matrix
- Return type
np.ndarray
-
geolime.geostats.math.neighborhood.
which_in_ball
(x: numpy.ndarray, p: numpy.ndarray = array([0., 0., 0.]), r: float = 1.0, distance: Callable = <function euclidian_distance>)¶ Function to return the indexes of the points which are in a (closed) ball in the Euclidean space. THIS FUNCTION IS ONLY ADAPTED (AND OPTIMIZED) FOR DISTANCES INDUCED BY A NORM.
- Parameters
x (np.ndarray) – A numpy matrix whose rows represent vectors in the Euclidean space.
p (np.ndarray) – Position vector indicating the center of the ball, by default a # vector of zeros in dimension 3.
r (float) – Radius of the ball, by default r = 1.
distance (Callable) – A distance function, by default euclidian_distance.
- Returns
- Return type
A numpy arrray
-
geolime.geostats.math.neighborhood.
which_in_parallelepiped
(x: numpy.ndarray, p: numpy.ndarray = array([0., 0., 0.]), r: float = 1.0, distance: Callable = <function euclidian_distance>)¶ Function to return the indexes of the points which are in a (closed) parallelepiped in the Euclidean space. THIS FUNCTION IS ONLY ADAPTED (AND OPTIMIZED) FOR DISTANCES INDUCED BY A NORM.
- Parameters
x (np.ndarray) – A numpy matrix whose rows represent vectors in the Euclidean space.
p (np.ndarray) – Position vector indicating the center of the ball, by default a # vector of zeros in dimension 3.
r (float) – Radius of the parallelepiped in each dimension, by default r = 1 and defines a cube.
distance (Callable) – A distance function, by default euclidian_distance.
- Returns
- Return type
A numpy arrray
-
geolime.geostats.math.neighborhood.
which_nearest_in_ball
(x: numpy.ndarray, p: numpy.ndarray = array([0., 0., 0.]), r: float = 1.0, distance: Callable = <function euclidian_distance>, min_n: int = 1, max_n: int = 100)¶ Function to obtain the N closest points of a set of points to the # center of a ball which are on that ball. THIS FUNCTION IS ONLY ADAPTED (AND OPTIMIZED) FOR DISTANCES INDUCED BY A NORM.
- Parameters
x (np.ndarray) – A numpy matrix where each row is a vector in the Euclidean Space
p (np.ndarray) – A numpy vector indicating the position (center of the ball). By default is a vector of zeros in dimension 3.
r (float) – Radius of the ball. By default r=1.
distance (Callable) – Distance function defining the ball. By default euclidian_distance.
min_n (int) – Minimum number of points in the ball to be considered otherwise returns no points.
max_n (int) – Maximum number of points in the ball to be considered (the N closest).
- Returns
A numpy array. This function returns the indixes of the N rows of X
which are the closest to the vector p according to the distance
Distance and which are in the ball of center p and radius r (according
to that distance). If there is less points in the ball than N, the
indexes of all those points are returned. There is no particular order
in which the indexes are delivered.