CR2RE Pipeline Reference Manual 1.6.8
Functions
Limiting Magnitude Module

This module contains a function to compute the limiting magnitude of an image. Several methods are available to deal with different data points distributions. More...

Functions

cpl_error_code hdrl_maglim_compute (const cpl_image *image, const double zeropoint, const double fwhm, const cpl_size kernel_size_x, const cpl_size kernel_size_y, const hdrl_image_extend_method image_extend_method, const hdrl_parameter *mode_parameter, double *limiting_magnitude)
 Computes the limiting magnitude of an image.
 

Detailed Description

This module contains a function to compute the limiting magnitude of an image. Several methods are available to deal with different data points distributions.

The limiting magnitude is a quantity that characterizes the depth of an observation. It is one of the mandatory header keywords in the Phase3 archival standard for imaging and datacubes. HDRL implements a general algorithm to compute the magnitude limit of an image (or can be used to compute it for each plan of a data cube). The limiting magnitude, according to the Phase3 archive standard, is defined as the magnitude of a unresolved source whose flux is 5 times the noise background (e.g., the magnitude of a point like source detected with S/N = 5).

Function Documentation

◆ hdrl_maglim_compute()

cpl_error_code hdrl_maglim_compute ( const cpl_image *  image,
const double  zeropoint,
const double  fwhm,
const cpl_size  kernel_size_x,
const cpl_size  kernel_size_y,
const hdrl_image_extend_method  image_extend_method,
const hdrl_parameter *  mode_parameter,
double *  limiting_magnitude 
)

Computes the limiting magnitude of an image.

PRIVATE

Parameters
imageinput image
zeropointthe zero point
fwhmthe FWHM seeing [pix]
kernel_size_xX kernel size [pix]
kernel_size_yY kernel size [pix]
image_extend_methodmethod used to extend the image
mode_parameterHDRL parameter controlling the mode computation
limiting_magnitudethe computed limiting magnitude
Returns
CPL_ERROR_NONE or the appropriate error code.

Please make sure that:

  • image != NULL,
  • kernel_size_x, kernel_size_y are even numbers,
  • mode_parameter is an hdrl_parameter created by the appropriate function (hdrl_collapse_mode_parameter_create).

A 2D Gaussian kernel of (X,Y) FWHM kernel_size_x, kernel_size_y is created.

The input image is convolved with the kernel as specified by image_extend_method. If the image has bad pixels the developer is supposed to flag them in its bad pixel extension.

Then is computed the mode of the convolved image according to the parameters specified by the HDRL parameter mode_parameter.

Next are flagged all data points with intensity below the mode.

Finally it is determined the limiting magnitude as:

limiting_magnitude = -2.5 * log10(5. * noise * norm) + zeropoint

where noise is the noise = mad * 1.4826 / sqrt(1. -2. / 3.141592)

mad is the Median Absolute Deviation determined on the flagged image,

norm = 4.0 * 3.141592 * (fwhm / 2.354820045)

Definition at line 114 of file hdrl_maglim.c.

References hdrl_collapse_mode_parameter_get_bin_size(), hdrl_collapse_mode_parameter_get_histo_max(), hdrl_collapse_mode_parameter_get_histo_min(), hdrl_collapse_mode_parameter_get_method(), hdrl_collapse_parameter_is_mode(), hdrl_image_create(), hdrl_image_delete(), hdrl_image_get_image(), hdrl_image_get_image_const(), hdrl_image_get_mask(), hdrl_image_get_mode(), hdrl_image_get_stdev(), and hdrl_image_reject_from_mask().