perform_fit¶
- sofia_redux.toolkit.splines.spline_utils.perform_fit(coordinates, knots, coefficients, degrees, panel_mapping, panel_steps, knot_steps, nk1, spline_mapping, n_knots)[source]¶
Evaluate a given spline at multiple coordinates.
- Parameters:
- coordinatesnumpy.ndarray (float)
The coordinates at which to evaluate the spline of shape (n_dimensions, n).
- knotsnumpy.ndarray (float)
The knots in each dimension of shape (n_dimensions, max_knot_estimate). Must be monotonically increasing for each dimension.
- coefficientsnumpy.ndarray (float)
The spline coefficients of shape (n_coefficients,).
- degreesnumpy.ndarray (int)
The degrees of the spline in each dimension (n_dimensions,).
- panel_mappingnumpy.ndarray (int)
An array containing the panel mapping (flat to n-D) indices. This is created by passing the panel shape (n_knots - (2 * degrees) - 1) into
flat_index_mapping()
. Should be an array of shape (n_dimensions, n_panels).- panel_stepsnumpy.ndarray (int)
The flat index mapping steps in panel-space of shape (n_dimensions,). These are returned by passing the shape
Spline.panel_shape
intoflat_index_mapping()
.- knot_stepsnumpy.ndarray (int)
The flat index mapping steps in knot-space of shape (n_dimensions,). These are returned by passing the shape (n_knots - degrees - 1) into
flat_index_mapping()
.- nk1numpy.ndarray (int)
An array of shape (n_dimensions,) containing the values n_knots - k1 where n_knots are the number of knots in each dimension, and k1 are the spline degrees + 1 in each dimension.
- spline_mappingnumpy.ndarray (int)
An array containing the spline mapping (flat to n-D) indices. This is created by passing the spline shape (degrees + 1) into
flat_index_mapping()
. Should be an array of shape (n_dimensions, n_spline_coefficients).- n_knotsnumpy.ndarray (int)
The number of knots in each dimension (n_dimensions,).
- Returns:
- fitted_valuesnumpy.ndarray (float)
The spline evaluated at
coordinates
of shape (n,).