make_knots

jwst.residual_fringe.utils.make_knots(flux, nknots=20, weights=None)[source]

Define knot positions for piecewise models.

This function simply splits the array into sections. It does NOT take into account the shape of the data.

Parameters:
fluxndarray

The flux array or any array of the same dimension.

nknotsint, optional

The number of knots to create (excluding 0 and 1023).

weightsndarray or None, optional

Optionally supply a weights array. This will be used to add knots at the edge of bad pixels or features.

Returns:
knot_idxndarray

The indices of the knots.