Skip to content

Commit

Permalink
modify doc in gp_interp
Browse files Browse the repository at this point in the history
  • Loading branch information
PFLeget committed Aug 30, 2024
1 parent 31ea5f1 commit 2e6f54b
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions python/lsst/meas/algorithms/gp_interpolation.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,13 @@ def updateMaskFromArray(mask, bad_pixel, interpBit):
Parameters
----------
mask : MaskedImage #TO DO, this is not the right format need to check.
mask : `lsst.afw.image.MaskedImage`
The mask image to update.
bad_pixel : array-like
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
interpBit : `int`
The bit value to set for the bad pixels in the mask.
Returns
-------
None
"""
x0 = mask.getX0()
y0 = mask.getY0()
Expand All @@ -45,25 +41,23 @@ def 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 : array-like
data : `np.array`
Input data array.
mad_multiplier : float, optional
mad_multiplier : `float`, optional
Multiplier for the MAD value used for clipping. Default is 2.0.
Returns:
--------
median_clipped : float
median_clipped : `float`
Median value of the clipped data.
Notes:
------
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.
Examples:
---------
>>> data = [1, 2, 3, 4, 5, 100]
Expand Down

0 comments on commit 2e6f54b

Please sign in to comment.