High-Level Data Reduction Library: Limiting Magnitude Module

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
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

  image | input image
  zeropoint | the zero point
  fwhm | the FWHM seeing [pix]
  kernel_size_x | X kernel size [pix]
  kernel_size_y | Y kernel size [pix]
  image_extend_method | method used to extend the image
  mode_parameter | HDRL parameter controlling the mode computation
  limiting_magnitude | the 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)