Skip to content

Commit

Permalink
update docs for new sigma_clip
Browse files Browse the repository at this point in the history
  • Loading branch information
jrob93 committed Nov 7, 2024
1 parent 0c8fd35 commit e41fcb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions docs/notebooks/outlier_detection_example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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)"
]
},
{
Expand All @@ -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)"
]
},
{
Expand Down Expand Up @@ -296,7 +296,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.13"
"version": "3.9.19"
}
},
"nbformat": 4,
Expand Down
7 changes: 5 additions & 2 deletions src/adler/utilities/science_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
-----------
Expand Down

0 comments on commit e41fcb5

Please sign in to comment.