opticam.noise

Functions

get_source_photons(N_source, gain)

Get the number of source photons.

get_sky_photons_per_pixel(n_sky, gain)

Get the number of sky photons per pixel.

get_dark_counts_per_pixel(dark_curr, t_exp)

Get the number of dark counts per pixel.

get_read_counts_per_pixel(n_read)

Get the read noise per pixel.

get_sky_stderr(N_source, N_pix, n_sky, gain)

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

get_shot_stderr(N_source, gain)

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

get_dark_stderr(N_source, N_pix, n_dark, t_exp, gain)

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

get_read_stderr(N_source, N_pix, n_read, gain)

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

snr(N_source, N_pix, N_bkg, n_sky, dark_curr, n_read, ...)

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_bkg, n_sky, dark_curr, ...)

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, psf_params)

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, psf_params)

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

Module Contents

opticam.noise.get_source_photons(N_source, gain)

Get the number of source photons.

Parameters

N_sourceQuantity

The number of source counts [ADU].

gainQuantity

The gain [photons/ADU].

Returns

float

The number of source photons.

Parameters:
  • N_source (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.get_sky_photons_per_pixel(n_sky, gain)

Get the number of sky photons per pixel.

Parameters

n_skyQuantity

The sky counts per unit pixel [ADU/pix].

gainQuantity

The gain [photons/ADU].

Returns

float

The number of sky photons per pixel.

Parameters:
  • n_sky (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.get_dark_counts_per_pixel(dark_curr, t_exp)

Get the number of dark counts per pixel.

Parameters

dark_currQuantity

The dark current [ADU/pixel/second]

t_expQuantity

The exposure time [seconds].

Returns

float

The number of dark counts per pixel.

Parameters:
  • dark_curr (astropy.units.Quantity)

  • t_exp (astropy.units.Quantity)

Return type:

float

opticam.noise.get_read_counts_per_pixel(n_read)

Get the read noise per pixel.

Parameters

n_readQuantity

The number of counts due to read noise per pixel [ADU/pixel].

Returns

float

The read noise per pixel.

Parameters:

n_read (astropy.units.Quantity)

Return type:

float

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

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

Parameters

N_sourceQuantity

The total number of source counts.

N_pixint

The number of aperture pixels.

n_skyQuantity

The number of sky counts per pixel.

gain: Quantity

The detector gain.

Returns

float

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

Parameters:
  • N_source (astropy.units.Quantity)

  • N_pix (astropy.units.Quantity)

  • n_sky (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.get_shot_stderr(N_source, gain)

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

Parameters

N_sourceQuantity

The total number of source counts.

gain: Quantity

The detector gain.

Returns

float

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

Parameters:
  • N_source (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.get_dark_stderr(N_source, N_pix, n_dark, t_exp, gain)

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

Parameters

N_sourceQuantity

The total number of source counts.

N_pixint

The number of aperture pixels.

dark_currQuantity

The number of dark current electrons per pixel per unit time.

t_exp: Quantity

The exposure time.

gain: Quantity

The detector gain.

Returns

float

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

Parameters:
  • N_source (astropy.units.Quantity)

  • N_pix (astropy.units.Quantity)

  • n_dark (astropy.units.Quantity)

  • t_exp (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.get_read_stderr(N_source, N_pix, n_read, gain)

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

Parameters

N_sourceQuantity

The total number of source counts.

N_pixint

The number of aperture pixels.

n_readQuantity

The number of electrons per pixel due to read noise.

gain: Quantity

The detector gain.

Returns

float

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

Parameters:
  • N_source (astropy.units.Quantity)

  • N_pix (astropy.units.Quantity)

  • n_read (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.snr(N_source, N_pix, N_bkg, n_sky, dark_curr, n_read, t_exp, gain)

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

Parameters

N_sourceQuantity

The total number of source counts.

N_pixint

The number of aperture pixels.

N_bkgQuantity

The number of pixels used to estimate the background.

n_skyQuantity

The number of sky counts per pixel.

dark_currQuantity

The number of dark current electrons per pixel per unit time.

n_readQuantity

The number of electrons per pixel due to read noise.

t_exp: Quantity

The exposure time.

gain: Quantity

The detector gain.

Returns

float

The S/N ratio.

Parameters:
  • N_source (astropy.units.Quantity)

  • N_pix (astropy.units.Quantity)

  • N_bkg (astropy.units.Quantity)

  • n_sky (astropy.units.Quantity)

  • dark_curr (astropy.units.Quantity)

  • n_read (astropy.units.Quantity)

  • t_exp (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.snr_stderr(N_source, N_pix, N_bkg, n_sky, dark_curr, n_read, t_exp, gain)

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

Parameters

N_sourceQuantity

The total number of source counts.

N_pixint

The number of aperture pixels.

N_bkgQuantity

The number of pixels used to estimate the background.

n_skyQuantity

The number of sky counts per pixel.

dark_currQuantity

The number of dark current electrons per pixel per unit time.

n_readQuantity

The number of electrons per pixel due to read noise.

t_exp: Quantity

The exposure time.

gain: Quantity

The detector gain.

Returns

float

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

Parameters:
  • N_source (astropy.units.Quantity)

  • N_pix (astropy.units.Quantity)

  • N_bkg (astropy.units.Quantity)

  • n_sky (astropy.units.Quantity)

  • dark_curr (astropy.units.Quantity)

  • n_read (astropy.units.Quantity)

  • t_exp (astropy.units.Quantity)

  • gain (astropy.units.Quantity)

Return type:

float

opticam.noise.get_noise_params(file, catalog, background, psf_params)

Get the noise values of a science image.

Parameters

filestr

The path to the science image.

catalogQTable

The source catalog corresponding to the science image.

backgroundBaseBackground | Callable

The background estimator.

psf_paramsDict[str, float]

The PSF parameters.

Returns

Tuple[NDArray, NDArray, Quantity, Quantity, Quantity, Quantity, Quantity, Quantity]

The fluxes, flux errors, number of pixels, backgorund counts/pixel, dark current, readout noise, exposure time, and gain.

Parameters:
Return type:

Tuple[numpy.typing.NDArray, numpy.typing.NDArray, astropy.units.Quantity, astropy.units.Quantity, astropy.units.Quantity, astropy.units.Quantity, astropy.units.Quantity, astropy.units.Quantity, astropy.units.Quantity]

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

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

Parameters

filestr

The path to the science image.

backgroundBaseBackground | Callable

The background estimator.

catalogQTable

The source catalog corresponding to the science image.

psf_paramsDict[str, float]

The PSF parameters.

Returns

List[float]

The S/N for each source. Sources are ordered as they appear in catalog.

Parameters:
Return type:

List[float]

opticam.noise.characterise_noise(file, background, catalog, psf_params)

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

Parameters

filestr

The file path to the science image.

backgroundBaseBackground | Callable

The background estimator.

catalogQTable

The source catalog corresponding to the science image.

psf_paramsDict[str, float]

The PSF parameters.

Returns

Dict[str, NDArray]

The noies properties.

Parameters:
Return type:

Dict[str, numpy.typing.NDArray]