add_knot

sofia_redux.toolkit.splines.spline_utils.add_knot(knot_weights, knot_coords, panel_shape, knots, n_knots, knot_estimate, k1)[source]

Add a knot to the spline fit.

Adds a knot near the currently highest weighted knot.

Parameters:
knot_weightsnumpy.ndarray (float)

The knot weights of shape (n_dimensions, n_knots).

knot_coordsnumpy.ndarray (float)

The knot coordinates of shape (n_dimensions, n_knots).

panel_shapenumpy.ndarray (int)

The number of panels in the spline fit of shape (n_dimensions,).

knotsnumpy.ndarray (float)

The knots in each dimension of shape (n_dimensions, max_knot_estimate). Must be monotonically increasing for each dimension.

n_knotsnumpy.ndarray (int)

The number of knots in each dimension of shape (n_dimensions,).

knot_estimatenumpy.ndarray (int)

The maximum number of knots allowable of shape (n_dimensions,).

k1numpy.ndarray (int)

An array of shape (n_dimensions,) where k1[dimension] = degree[dimension] + 1.

Returns:
exit_codeint

Returns an exit code of 1 if the maximum number of allowable knots has already been reached and no more should be added. Returns an exit code of 5 if the new knot location coincides with an already existing knot. Returns 0 if a knot was successfully added.