diff --git a/docs/notebooks/outlier_detection_example.ipynb b/docs/notebooks/outlier_detection_example.ipynb index f3af189..82ef920 100644 --- a/docs/notebooks/outlier_detection_example.ipynb +++ b/docs/notebooks/outlier_detection_example.ipynb @@ -177,7 +177,7 @@ "outputs": [], "source": [ "# astropy sigma_clip normally uses the median as the central function\n", - "utils.sigma_clip(res, {\"cenfunc\": \"median\"})" + "utils.sigma_clip(res, cenfunc=\"median\", maxiters=1)" ] }, { @@ -188,7 +188,7 @@ "outputs": [], "source": [ "# assuming that the model is the ground truth, we use zero as the centroid for the residuals\n", - "utils.sigma_clip(res, {\"cenfunc\": utils.zero_func})" + "utils.sigma_clip(res, cenfunc=utils.zero_func, maxiters=1)" ] }, { @@ -296,7 +296,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.13" + "version": "3.9.19" } }, "nbformat": 4, diff --git a/src/adler/utilities/science_utilities.py b/src/adler/utilities/science_utilities.py index 146f9c0..7bcf46a 100644 --- a/src/adler/utilities/science_utilities.py +++ b/src/adler/utilities/science_utilities.py @@ -78,7 +78,6 @@ def zero_func(x, axis=None): return 0 -# def sigma_clip(data_res, kwargs={"sigma":3, "maxiters": 1, "cenfunc": zero_func}): def sigma_clip(data_res, **kwargs): """Wrapper function for astropy.stats.sigma_clip, here we define the default centre of the data (the data - model residuals) to be zero @@ -88,7 +87,11 @@ def sigma_clip(data_res, **kwargs): data_res: array The residuals of the data compared to the model. kwargs: dict - Dictionary of keyword arguments from astropy.stats.sigma_clip + Dictionary of keyword arguments from astropy.stats.sigma_clip, namely: + sigma : default 3 + maxiters: default 5 + cenfunc: default 'median' + Returns -----------