LoopStructural.interpolators.SurfeRBFInterpolator#
- class LoopStructural.interpolators.SurfeRBFInterpolator(*args, **kwargs)#
Bases:
GeologicalInterpolatorDummy class to handle the case where Surfe is not installed. This will raise a warning when used.
Initialize the geological interpolator.
This method sets up the basic data structures and parameters required for geological interpolation.
- Parameters:
data (dict, optional) – Dictionary containing constraint data arrays, by default {}
up_to_date (bool, optional) – Whether the interpolator is already built and up to date, by default False
Notes
This is an abstract method that must be implemented by subclasses. All subclasses should call this parent constructor to ensure proper initialization of the base data structures.
- __init__(*args, **kwargs)#
Initialize the geological interpolator.
This method sets up the basic data structures and parameters required for geological interpolation.
- Parameters:
data (dict, optional) – Dictionary containing constraint data arrays, by default {}
up_to_date (bool, optional) – Whether the interpolator is already built and up to date, by default False
Notes
This is an abstract method that must be implemented by subclasses. All subclasses should call this parent constructor to ensure proper initialization of the base data structures.
Methods
__init__(*args, **kwargs)Initialize the geological interpolator.
add_gradient_constraints([w])add_inequality_pairs_constraints([w, ...])add_interface_constraints([w])add_norm_constraints([w])add_tangent_constraints([w])add_value_constraints([w])add_value_inequality_constraints([w])check_array(array)Validate and convert input to numpy array.
clean()Removes all of the data from an interpolator
debug()Helper function for debugging when the interpolator isn't working
evaluate_gradient(locations)evaluate_value(locations)Get the location of all data points
get_inequality_pairs_constraints()get_inequality_value_constraints()Get the location of interface constraints
reset()set_gradient_constraints(points)Set gradient constraints for the interpolation.
set_inequality_pairs_constraints(points)set_interface_constraints(points)set_nelements(nelements)Set the number of elements for the interpolation support.
set_normal_constraints(points)set_region(**kwargs)Set the interpolation region.
set_tangent_constraints(points)set_value_constraints(points)Set value constraints for the interpolation.
set_value_inequality_constraints(points)setup(**kwargs)Runs all of the required setting up stuff
setup_interpolator(**kwargs)Runs all of the required setting up stuff
solve_system(solver[, solver_kwargs])Solves the interpolation equations
to_dict()to_json()Return a JSON representation of the geological interpolator.
update()Attributes
Get the constraint data dictionary.
Get the number of elements in the interpolation support.
- check_array(array: ndarray)#
Validate and convert input to numpy array.
- Parameters:
array (array_like) – Input array to validate and convert
- Returns:
np.ndarray – Validated numpy array
- Raises:
LoopTypeError – If the array cannot be converted to a numpy array
- clean()#
Removes all of the data from an interpolator
- property data#
Get the constraint data dictionary.
- Returns:
dict – Dictionary containing constraint data arrays
- debug()#
Helper function for debugging when the interpolator isn’t working
- get_data_locations()#
Get the location of all data points
- Returns:
numpy array – Nx3 - X,Y,Z location of all data points
- get_gradient_constraints()#
- Returns:
numpy array
- get_interface_constraints()#
Get the location of interface constraints
- Returns:
numpy array – Nx4 - X,Y,Z,id location of all interface constraints
- get_norm_constraints()#
- Returns:
numpy array
- get_tangent_constraints()#
- Returns:
numpy array
- get_value_constraints()#
- Returns:
numpy array
- abstract property n_elements: int#
Get the number of elements in the interpolation support.
- Returns:
int – Number of elements
Notes
This is an abstract property that must be implemented by subclasses.
- set_gradient_constraints(points: ndarray)#
Set gradient constraints for the interpolation.
- Parameters:
points (np.ndarray) – Array containing gradient constraints with shape (n_points, 7-8). Columns should be [X, Y, Z, gx, gy, gz, weight]. If weight is not provided, a weight of 1.0 is assumed for all points.
- Raises:
ValueError – If points array doesn’t have the minimum required columns
Notes
Gradient constraints specify the direction and magnitude of the scalar field gradient at specific locations. These are typically derived from structural measurements like bedding or foliation orientations.
- abstractmethod set_nelements(nelements: int) int#
Set the number of elements for the interpolation support.
- Parameters:
nelements (int) – Target number of elements
- Returns:
int – Actual number of elements set
Notes
This is an abstract method that must be implemented by subclasses. The actual number of elements may differ from the requested number depending on the interpolator’s constraints.
- set_normal_constraints(points: ndarray)#
- Parameters:
points (np.ndarray) – array containing the value constraints usually 7-8 columns. X,Y,Z,nx,ny,nz,(weight, default : 1 for each row)
Notes
If no weights are provided, w = 1 is assigned to each normal constraint.
- abstractmethod set_region(**kwargs)#
Set the interpolation region.
- Parameters:
**kwargs (dict) – Region parameters specific to the interpolator implementation
Notes
This is an abstract method that must be implemented by subclasses. The specific parameters depend on the interpolator type.
- set_tangent_constraints(points: ndarray)#
- Parameters:
points (np.ndarray) – array containing the value constraints usually 7-8 columns. X,Y,Z,nx,ny,nz,weight
- set_value_constraints(points: ndarray)#
Set value constraints for the interpolation.
- Parameters:
points (np.ndarray) – Array containing the value constraints with shape (n_points, 4-5). Columns should be [X, Y, Z, value, weight]. If weight is not provided, a weight of 1.0 is assumed for all points.
- Raises:
ValueError – If points array doesn’t have the minimum required columns
Notes
Value constraints specify known scalar field values at specific locations. These are typically used for interface points or measured data values.
- setup(**kwargs)#
Runs all of the required setting up stuff
- abstractmethod setup_interpolator(**kwargs)#
Runs all of the required setting up stuff
- abstractmethod solve_system(solver, solver_kwargs: dict = {}) bool#
Solves the interpolation equations
- to_json()#
Return a JSON representation of the geological interpolator.
- Returns:
dict – Dictionary containing the interpolator’s state and configuration suitable for JSON serialization
Notes
This method packages the essential state of the interpolator including its type, constraints, data, and build status for serialization.