# Sigma-clip function?

**URL:** https://discourse.julialang.org/t/sigma-clip-function/88228
**Category:** Statistics
**Created:** [October 4, 2022, 1:01pm UTC](https://discourse.julialang.org/t/sigma-clip-function/88228 "2022-10-04T13:01:03Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![mkretlow](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkretlow/32/16295_2.png) [@mkretlow](https://discourse.julialang.org/u/mkretlow)
#### Post date: [October 4, 2022, 1:01pm UTC](https://discourse.julialang.org/t/sigma-clip-function/88228/1 "2022-10-04T13:01:03Z")

</div>

Before I re-invent the wheel… Do a sigma-clip function exist (similar to scipy.stats.sigmaclip) in some Julia package, preferable which works also on DataFrames !?

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [October 4, 2022, 1:07pm UTC](https://discourse.julialang.org/t/sigma-clip-function/88228/2 "2022-10-04T13:07:36Z")

</div>

There is an implementation [in Photometry.jl](https://github.com/JuliaAstro/Photometry.jl/blob/a8a699a99ad2a11953328f4b9dfc34a150dbc512/src/background/Background.jl#L207-L231).

(Of course, it’s only a few-line function, so simple enough to implement yourself … unlike in Python where this would require user code in the inner loop, or alternatively multiple temporary arrays from vectorized comparisons, and would hence be slow.)

---

<div class="post-metadata">

### Author: ![cgarling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cgarling/32/29278_2.png) [@cgarling](https://discourse.julialang.org/u/cgarling)
#### Post date: [February 5, 2026, 2:59pm UTC](https://discourse.julialang.org/t/sigma-clip-function/88228/3 "2026-02-05T14:59:29Z")

</div>

For future readers, this functionality has been moved from Photometry.jl to [BackgroundMeshes.jl](https://github.com/JuliaAstro/BackgroundMeshes.jl/blob/38bd5bec4ab19cbf1d66db3b82f8cf07796c7394/src/BackgroundMeshes.jl#L181-L236).
