maskinterp

sofia_redux.toolkit.image.fill.maskinterp(image, func=<function spline_interp_2dfunc>, mask=None, apstep=1, maxap=9, cval=nan, minfrac=0.2, minpoints=4, cdis=1, statistical=False, creep=False, coplanar=None, **kwargs)[source]

Interpolates over image using a mask.

The func parameter defines the function used for interpolation within the aperture. This can be either a statistical or interpolation function depending on whether statistical is True or False:

if statistical is True:

data_out = func(data_in, **kwargs)

if statistical is False:

data_out = func(data_in, c_in, c_out, **kwargs)
c_in, c_out : numpy.array of floats (npoints, (y, x))
Parameters:
imagenumpy.ndarray

Input data array (ncol, nrow)

funcfunction

The function to use for interpolating values within each aperture. The format of the function is described above. Note the distinction between functions if statistical=True.

masknumpy.ndarray, optional

True = Use as a data point for interpolation False = Interpolate values for these points

apstepfloat, optional

The step by which to increase aperture radius between each iteration

maxapfloat, optional

The maximum interpolation aperture radius in pixels. Iterations will be terminated after reaching this aperature size.

cvalfloat, optional

value with which to fill missing data points

minfracfloat, optional

The minimum fraction of valid points within an aperture in order for interpolation to be attempted (0 < minfrac < 1)

minpoints: int, optional

The minimum number of valid points within aperture radius in order for interpolation to be attempted.

cdisfloat, optional

Maximum distance from the center of aperture to the “center of mass” of good pixels in the aperture.

statisticalbool, optional

Use statistical function rather than interpolation

creepbool, optional

If True, allow interpolated values to be used in successive iterations. Otherwise, only the original “good” mask=True data will be used in all iterations.

coplanarbool, optional

If True, interpolation is only performed if interpolants are functions of both the x and y features. If False, only one of the features may vary. Use depends on the interpolating algorithm. May be set to False for statistical / minimizing functions.

Returns:
np.ndarray

output image (nrow, ncol)