Background Estimators

All of these estimators are subtypes of Background.LocationEstimator or Background.RMSEstimator and are derived using various statistical and image processing methods.

Location Estimators

These estimators are used for estimating the background using some form of a central statistic.

Photometry.Background.MMMBackgroundType
MMMBackground(median_factor=3, mean_factor=2)

Estimate the background using a mode estimator of the form median_factor * median - mean_factor * mean. This algorithm is based on the MMMBackground routine originally implemented in DAOPHOT. MMMBackground uses factors of median_factor=3 and mean_factor=2 by default. This estimator assumes that contaminated sky pixel values overwhelmingly display positive departures from the true value.

Examples

julia> x = ones(3, 5);

julia> MMMBackground()(x)
1.0

julia> MMMBackground(median_factor=4, mean_factor=3)(x, dims = 1)
1×5 Matrix{Float64}:
 1.0  1.0  1.0  1.0  1.0

See Also

source
Photometry.Background.SourceExtractorBackgroundType
SourceExtractorBackground()

This estimator returns the background of the input using the SourceExtractorBackground algorithm.

The background is calculated using a mode estimator of the form (2.5 * median) - (1.5 * mean).

If (mean - median) / std > 0.3 then the median is used and if std = 0 then the mean is used.

Examples

julia> data = ones(3, 5);

julia> SourceExtractorBackground()(data)
1.0

julia> SourceExtractorBackground()(data, dims=1)
1×5 Matrix{Float64}:
 1.0  1.0  1.0  1.0  1.0
source
Photometry.Background.BiweightLocationBackgroundType
BiweightLocationBackground(c = 6.0, M = nothing)

Estimate the background using the robust biweight location statistic.

$\xi_{biloc}=M + \frac{\sum_{|u_i|<1}{(x_i - M)(1 - u_i^2)^2}}{\sum_{|u_i|<1}{(1-u_i^2)^2}}$

$u_i = \frac{(x_i - M)}{c\cdot\text{MAD}(x)}$

Where $\text{MAD}(x)$ is median absolute deviation of x.

Examples

julia> x = ones(3,5);

julia> BiweightLocationBackground()(x)
1.0

julia> BiweightLocationBackground(c=5.5)(x; dims = 1)
1×5 Matrix{Float64}:
 1.0  1.0  1.0  1.0  1.0
source

RMS Estimators

These estimators are used for estimating the root-mean-square (RMS) of the background using some form of a deviation statistic.

Photometry.Background.StdRMSType
StdRMS()

Uses the standard deviation statistic for background RMS estimation.

Examples

julia> data = ones(3, 5);

julia> StdRMS()(data)
0.0

julia> StdRMS()(data, dims=1)
1×5 Matrix{Float64}:
 0.0  0.0  0.0  0.0  0.0
source
Photometry.Background.MADStdRMSType
MADStdRMS()

Uses the standard median absolute deviation (MAD) statistic for background RMS estimation.

This is typically given as

$\sigma \approx 1.4826 \cdot \text{MAD}$

Examples

julia> data = ones(3, 5);

julia> MADStdRMS()(data)
0.0

julia> MADStdRMS()(data, dims=1)
1×5 Matrix{Float64}:
 0.0  0.0  0.0  0.0  0.0
source
Photometry.Background.BiweightScaleRMSType
BiweightScaleRMS(c=9.0, M=nothing)

Uses the robust biweight scale statistic for background RMS estimation.

The biweight scale is the square root of the biweight midvariance. The biweight midvariance uses a tuning constant, c, and an optional initial guess of the central value M.

$\zeta^2_{biscl}= \frac{n\sum_{|u_i|<1}{(x_i - M)^2(1 - u_i^2)^4}}{\left[\sum_{|u_i|<1}{(1-u_i^2)(1-5u_i^2)}\right]^2}$

$u_i = \frac{(x_i - M)}{c\cdot\text{MAD}(x)}$

Where $\text{MAD}(x)$ is median absolute deviation of x.

Examples

julia> data = ones(3, 5);

julia> BiweightScaleRMS()(data)
0.0

julia> BiweightScaleRMS(c=3.0)(data, dims=1)
1×5 Matrix{Float64}:
 0.0  0.0  0.0  0.0  0.0
source