find_knot¶
- sofia_redux.toolkit.splines.spline_utils.find_knot(coordinate, knots, valid_knot_start, valid_knot_end, allow_outside=True, lower_bounds=None, upper_bounds=None)[source]¶
Find the knot index for a single coordinate.
- Parameters:
- coordinatenumpy.ndarray (float)
The coordinates of shape (n_dimensions, m).
- knotsnumpy.ndarray (float)
The knots in each dimension of shape (n_dimensions, max_knot_estimate). Must be monotonically increasing for each dimension.
- valid_knot_startnumpy.ndarray (int)
The start indices for the first valid knot in each dimension. For a spline of degree k, this should be k. The shape is (n_dimensions,).
- valid_knot_endnumpy.ndarray (int)
The last valid knot index in each dimension of shape (n_dimensions,). for a spline of degree k, this should be n_knots - degree - 1.
- allow_outsidebool, optional
If
True
(default), allow a fit outside the bounds of the knots.- lower_boundsnumpy.ndarray (float)
Specifies the lower range of valid coordinates for each dimension.
- upper_boundsnumpy.ndarray (float)
Specifies the upper range of valid coordinates for each dimension.
- Returns:
- knot_indicesnumpy.ndarray (int)
The knot index for each coordinate in each dimension of shape (n_dimensions, m).