From 2e6f54b86fda0c55509f9844cd521b66f8ad6bad Mon Sep 17 00:00:00 2001 From: Pierre-Francois Leget Date: Fri, 30 Aug 2024 08:00:03 -0700 Subject: [PATCH] modify doc in gp_interp --- .../lsst/meas/algorithms/gp_interpolation.py | 28 ++++++++----------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/python/lsst/meas/algorithms/gp_interpolation.py b/python/lsst/meas/algorithms/gp_interpolation.py index 2a45cabc..d2a44e5f 100644 --- a/python/lsst/meas/algorithms/gp_interpolation.py +++ b/python/lsst/meas/algorithms/gp_interpolation.py @@ -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() @@ -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]