InterpLinear

Class that performs linear interpolation

class xmsinterp.interpolate.InterpLinear(points=None, triangles=None, scalars=None, **kwargs)
__init__(points=None, triangles=None, scalars=None, **kwargs)

x.__init__(…) initializes x; see help(type(x)) for signature

extrapolation_point_indexes

Returns vector of point indexes for points that were outside of all triangles

extrapolation_value

Set the constant extrapolation value

interpolate_to_point(point)

Use the stored triangles to interpolate to a point. Returns extrapolation value if the point is outside the triangles.

Parameters:point (tuple) – Location that is interpolated to.
Returns:Interpolated value at point.
interpolate_to_points(points)

Calls InterpToPt in a loop.

Parameters:points (iterable) – Locations of points.
Returns:Interpolated values at points.
interpolate_weights(point)

Use the stored triangles to get interpolation weights for a point. Returns false if the point is outside the triangles.

Parameters:point (tuple) – Location that is interpolated to.
Returns:tuple of a bool, array of indexes, and array of weights
native_neighbor_blend_weights

Get the option for blending weights when using Natural Neighbor

native_neighbor_nodal_func

Get the value for the Natural Neighbor nodal function

native_neighbor_nodal_func_nearest_points_option

Get the option for the Natural Neighbor nodal function nearest points.

native_neighbor_nodal_func_number_nearest_points

Get the value for the number of nearest points to use when calculating the nodal function

point_activity

Gets the point activity

points

Gets the points

scalars

Gets the scalars

set_points_and_triangles(points, triangles)

Adds the triangles to the class.

Parameters:
  • points (iterable) – Array of point locations.
  • triangles (iterable) – Array of triangles that references the a_pts array. This array will have a size that is a multiple of 3. The first 3 locations in array represent the first triangle and will have indices that correspond to locations in the a_pts array.
set_truncation(maximum, minimum)

Set the truncation values for the interpolation and turn on truncation.

Parameters:
  • maximum (float) – The maximum value for truncation.
  • minimum (float) – The minimum value for truncation.
set_use_clough_tocher(on, progress=None)

Set the class to use the Clough Tocher interpolation method. This is a legacy feature from GMS. Compare to linear.

Parameters:
  • on (bool) – TIndicate if CT should be used.
  • progress (observer) – Progress bar to give users feed back on the set up process of CT. If you have a really large set of triangles this may take some time.
set_use_natural_neighbor(on, nodal_function_type='constant', nodal_function_point_search_option='nearest_pts', nodal_function_number_nearest_points=16, nodal_function_blend_weights=True, progress=None)

Set the class to use natural neighbor (NN) interpolation.

Parameters:
  • on (bool) – Indicate if NN should be used.
  • nodal_function_type (int) – Indicates which nodal function to use.
  • nodal_function_point_search_option (int) – Indicates options for the nearest points when computing the nodal functions.
  • nodal_function_number_nearest_points (int) – The number of nearest points for nodal function computation.
  • nodal_function_blend_weights (bool) – Option to use a blending function on the calculated weights.
  • progress (observer) – Progress bar to give user feedback for generation of the nodal functions.
triangle_activity

Gets the triangle activity

triangle_containing_point(point)

Find the triangle containing the point.

Parameters:point (tuple) – Location used to find a triangle.
Returns:Index of triangle containing point. If None is returned then no triangle contained the point.
triangle_envelopes_containing_point(point)

Find all triangles whose envelop contains the point.

Parameters:point (tuple) – Location used to find a triangle.
Returns:Iterable of triangle indexes containing the point
triangles

Gets the triangles

truncate_interpolated_values

Get the option to truncate interpolated values

truncate_max

Get maximum truncation value

truncate_min

Get minimum truncation value

use_clough_tocher

Get the option for using Clough Tocher interpolation

use_natural_neighbor

Get the option for using Natural Neighbor interpolation