lsst.meas.algorithms g4a7591d645+ecc601e506
Loading...
Searching...
No Matches
lsst.meas.algorithms.gp_interpolation Namespace Reference

Classes

class  GaussianProcessTreegp
class  InterpolateOverDefectGaussianProcess

Functions

 updateMaskFromArray (mask, bad_pixel, interpBit)
 median_with_mad_clipping (data, mad_multiplier=2.0)

Function Documentation

◆ median_with_mad_clipping()

median_with_mad_clipping ( data,
mad_multiplier = 2.0 )
Calculate the median of the input data after applying Median Absolute Deviation (MAD) clipping.

The MAD clipping method is used to remove outliers from the data. The median of the data is calculated,
and then the MAD is calculated as the median absolute deviation from the median. The data is then clipped
by removing values that are outside the range of median +/- mad_multiplier * MAD. Finally, the median of
the clipped data is returned.

Parameters:
-----------
data : `np.array`
    Input data array.
mad_multiplier : `float`, optional
    Multiplier for the MAD value used for clipping. Default is 2.0.

Returns:
--------
median_clipped : `float`
    Median value of the clipped data.

Examples:
---------
>>> data = [1, 2, 3, 4, 5, 100]
>>> median_with_mad_clipping(data)
3.5

Definition at line 65 of file gp_interpolation.py.

◆ updateMaskFromArray()

updateMaskFromArray ( mask,
bad_pixel,
interpBit )
Update the mask array with the given bad pixels.

Parameters
----------
mask : `lsst.afw.image.MaskedImage`
    The mask image to update.
bad_pixel : `np.array`
    An array-like object containing the coordinates of the bad pixels.
    Each row should contain the x and y coordinates of a bad pixel.
interpBit : `int`
    The bit value to set for the bad pixels in the mask.

Definition at line 42 of file gp_interpolation.py.