opticam.noise

Functions

get_sky_stderr(N_source, N_pix, n_sky)

Get the standard error (in magnitudes) of the sky noise.

get_shot_stderr(N_source)

Get the standard error (in magnitudes) of the shot noise.

get_bias_stderr(N_source, N_pix, bias_var)

Get the standard error (in magnitudes) of the bias variance.

get_dark_stderr(N_source, N_pix, dark_var)

Get the standard error (in magnitudes) of the dark noise variance.

get_flat_stderr(N_source, N_pix, flat_var)

Get the standard error (in magnitudes) of the flat-field variance.

get_read_stderr(N_source, N_pix, read_noise)

Get the standard error (in magnitudes) of the readout noise.

snr(N_source, N_pix, n_sky, bias_var, dark_var, ...)

The (simplified) S/N ratio equation or CCD Equation (see Chapter 4.4 of Handbook of CCD Astronomy by Howell, 2006).

snr_stderr(N_source, N_pix, n_sky, bias_var, dark_var, ...)

The standard error (in magnitudes) on the CCD Equation (see Chapter 4.4 of Handbook of CCD Astronomy by Howell,

get_noise_params(file, catalog, background, ...)

Get the noise values of a science image.

get_snrs(file, background, catalog, psf_params, ...)

Get the S/N ratios for the cataloged sources in a science image.

characterise_noise(file, background, catalog, ...)

Characterise the expected noise from an image and compare it to the measured noise for a number of cataloged

Module Contents

opticam.noise.get_sky_stderr(N_source, N_pix, n_sky)

Get the standard error (in magnitudes) of the sky noise.

Parameters

N_sourcefloat

The total number of source counts.

N_pixint

The number of aperture pixels.

n_skyfloat

The number of sky counts per pixel.

Returns

float

The standard error (in magnitudes) of the sky noise.

Parameters:
  • N_source (float)

  • N_pix (float)

  • n_sky (float)

Return type:

float

opticam.noise.get_shot_stderr(N_source)

Get the standard error (in magnitudes) of the shot noise.

Parameters

N_sourcefloat

The total number of source counts.

Returns

float

The standard error (in magnitudes) of the shot noise.

Parameters:

N_source (float)

Return type:

float

opticam.noise.get_bias_stderr(N_source, N_pix, bias_var)

Get the standard error (in magnitudes) of the bias variance.

Parameters

N_sourceQuantity

The total number of source counts.

N_pixint

The number of aperture pixels.

bias_varQuantity

The bias variance.

Returns

float

The standard error (in magnitudes) of the bias variance.

Parameters:
  • N_source (float)

  • N_pix (float)

  • bias_var (float)

Return type:

float

opticam.noise.get_dark_stderr(N_source, N_pix, dark_var)

Get the standard error (in magnitudes) of the dark noise variance.

Parameters

N_sourcefloat

The total number of source counts.

N_pixint

The number of aperture pixels.

dark_varfloat

The dark noise variance.

Returns

float

The standard error (in magnitudes) of the dark noise.

Parameters:
  • N_source (float)

  • N_pix (float)

  • dark_var (float)

Return type:

float

opticam.noise.get_flat_stderr(N_source, N_pix, flat_var)

Get the standard error (in magnitudes) of the flat-field variance.

Parameters

N_sourcefloat

The total number of source counts.

N_pixint

The number of aperture pixels.

flat_varfloat

The flat-field variance.

Returns

float

The standard error (in magnitudes) of the flat-field variance.

Parameters:
  • N_source (float)

  • N_pix (float)

  • flat_var (float)

Return type:

float

opticam.noise.get_read_stderr(N_source, N_pix, read_noise)

Get the standard error (in magnitudes) of the readout noise.

Parameters

N_sourcefloat

The total number of source counts.

N_pixfloat

The number of aperture pixels.

read_noisefloat

The read noise of the detector in electrons/pixel.

Returns

float

The standard error (in magnitudes) of the readout noise.

Parameters:
  • N_source (float)

  • N_pix (float)

  • read_noise (float)

Return type:

float

opticam.noise.snr(N_source, N_pix, n_sky, bias_var, dark_var, flat_var, read_noise)

The (simplified) S/N ratio equation or CCD Equation (see Chapter 4.4 of Handbook of CCD Astronomy by Howell, 2006).

Parameters

N_sourcefloat | NDArray

The total number of source counts.

N_pixint

The number of aperture pixels.

n_skyfloat

The number of sky counts per pixel.

bias_varfloat

The bias variance.

dark_varfloat

The dark noise variance.

flat_varfloat

The flat-field variance.

read_noisefloat

The read noise of the detector in electrons/pixel.

Returns

float | NDArray

The S/N ratio.

Parameters:
  • N_source (float | numpy.typing.NDArray)

  • N_pix (float)

  • n_sky (float)

  • bias_var (float)

  • dark_var (float)

  • flat_var (float)

  • read_noise (float)

Return type:

float | numpy.typing.NDArray

opticam.noise.snr_stderr(N_source, N_pix, n_sky, bias_var, dark_var, flat_var, read_noise)

The standard error (in magnitudes) on the CCD Equation (see Chapter 4.4 of Handbook of CCD Astronomy by Howell, 2006).

Parameters

N_sourcefloat | NDArray

The total number of source counts.

N_pixfloat

The number of aperture pixels.

n_skyfloat

The number of sky counts per pixel.

bias_varfloat

The bias variance.

dark_varfloat

The dark noise variance.

flat_varfloat

The flat-field variance.

read_noisefloat

The read noise of the detector in electrons/pixel.

Returns

float | NDArray

The standard error (in magnitudes) on the S/N ratio.

Parameters:
  • N_source (float | numpy.typing.NDArray)

  • N_pix (float)

  • n_sky (float)

  • bias_var (float)

  • dark_var (float)

  • flat_var (float)

  • read_noise (float)

Return type:

float | numpy.typing.NDArray

opticam.noise.get_noise_params(file, catalog, background, psf_params, instrument, bias_corrector, dark_corrector, flat_corrector)

Get the noise values of a science image.

Parameters

fileMEFSlice

The science image file.

catalogQTable

The source catalog corresponding to the science image.

backgroundBaseBackground | Callable

The background estimator.

psf_paramsdict[str, float]

The PSF parameters.

instrumentInstrument

The instrument.

bias_correctorBiasCorrector | None

The bias corrector.

dark_correctorDarkNoiseCorrector | None

The dark noise corrector.

flat_correctorFlatFieldCorrector | None

The flat-field corrector.

Returns

tuple[NDArray, NDArray, float, float, float]

The source IDs, fluxes, flux errors, number of aperture pixels, backgorund counts/pixel, bias variance, dark variance, and flat-field variance.

Parameters:
Return type:

tuple[numpy.typing.NDArray[numpy.int64], numpy.typing.NDArray[numpy.float64], numpy.typing.NDArray[numpy.float64], float, float, float, float, float]

opticam.noise.get_snrs(file, background, catalog, psf_params, instrument, bias_corrector, dark_corrector, flat_corrector)

Get the S/N ratios for the cataloged sources in a science image.

Parameters

fileMEFSlice

The science image file.

backgroundBaseBackground | Callable

The background estimator.

catalogQTable

The source catalog corresponding to the science image.

psf_paramsdict[str, float]

The PSF parameters.

instrumentInstrument

The instrument.

bias_correctorBiasCorrector | None

The bias corrector.

dark_correctorDarkNoiseCorrector | None

The dark noise corrector.

flat_correctorFlatFieldCorrector | None

The flat-field corrector.

Returns

tuple[NDArray, NDArray]

The source IDs and S/N for each source.

Parameters:
Return type:

tuple[numpy.typing.NDArray, numpy.typing.NDArray]

opticam.noise.characterise_noise(file, background, catalog, psf_params, instrument, bias_corrector, dark_corrector, flat_corrector)

Characterise the expected noise from an image and compare it to the measured noise for a number of cataloged sources.

Parameters

fileMEFSlice

The science image file.

backgroundBaseBackground | Callable

The background estimator.

catalogQTable

The source catalog corresponding to the science image.

psf_paramsdict[str, float]

The PSF parameters.

instrumentInstrument

The instrument.

bias_correctorBiasCorrector

The bias corrector.

dark_correctorDarkNoiseCorrector

The dark noise corrector.

flat_correctorFlatFieldCorrector

The flat-field corrector.

Returns

dict[str, NDArray]

The noies properties.

Parameters:
Return type:

dict[str, numpy.typing.NDArray]