astro.denoising.noise#

NOISE.

This module defines functions for estimating the noise in images.

sigma_clip(data, n_iter=3)[source]#

Sigma Clipping.

Perform iterative sigma clipping on input data.

Parameters
  • data (numpy.ndarray) – Input data array

  • n_iter (int, optional) – Number of iterations, default is 3

Returns

Mean and standard deviation of clipped sample

Return type

tuple

Raises

Examples

>>> import numpy as np
>>> from astro.denoising.noise import sigma_clip
>>> np.random.seed(0)
>>> data = np.random.ranf((3, 3))
>>> sigma_clip(data)
(0.6415801460355164, 0.17648980804276407)
noise_est(data, n_iter=3)[source]#

Noise Estimate.

Estimate the standard deviation of the noise in the input data using a smoothed median.

Parameters
  • data (numpy.ndarray) – Input 2D-array

  • n_iter (int, optional) – Number of sigma clipping iterations, default is 3

Returns

Standard deviation of the noise

Return type

float

Raises

TypeError – For invalid input data type

Examples

>>> import numpy as np
>>> from astro.denoising.noise import noise_est
>>> np.random.seed(0)
>>> data = np.random.ranf((3, 3))
>>> noise_est(data)
0.11018895815851695
sigma_scales(sigma, n_scales=4, kernel_shape=(51, 51))[source]#

Sigma Scales.

Get rescaled sigma values for wavelet decomposition.

Parameters
  • sigma (float) – Standard deviation of the noise

  • n_scales (int, optional) – Number of wavelet scales, default is 4

  • kernel_shape (tuple, list or numpy.ndarray, optional) – Shape of dummy image kernel, default is (51, 51)

Returns

Rescaled sigma values not including coarse scale

Return type

numpy.ndarray

Raises

Examples

>>> from astro.denoising.noise import sigma_scales
>>> sigma_scales(1)
array([0.89079631, 0.20066385, 0.0855075 ])