CR2RE Pipeline Reference Manual 1.6.7
Functions
Cr2res_calib

Functions

hdrl_imagelist * cr2res_calib_imagelist (const hdrl_imagelist *in, int chip, int clean_bad, int subtract_nolight_rows, int subtract_interorder_column, int cosmics_corr, const cpl_frame *flat, const cpl_frame *dark, const cpl_frame *bpm, const cpl_frame *detlin, const cpl_vector *dits, const cpl_vector *ndits)
 The images calibration routine for a given chip on a list.
 
hdrl_image * cr2res_calib_image (const hdrl_image *in, int chip, int clean_bad, int subtract_nolight_rows, int subtract_interorder_column, int cosmics_corr, const cpl_frame *flat, const cpl_frame *dark, const cpl_frame *bpm, const cpl_frame *detlin, double dit, int ndit)
 The images calibration routine for a given chip.
 
int cr2res_add_shotnoise (hdrl_image *in, double dit, int ndit, int chip)
 Add shot-noise to errors in HDRL-image.
 
int cr2res_calib_subtract_interorder_column (hdrl_image *in, const hdrl_image *flat, cpl_size degree)
 Remove background column by column.
 

Detailed Description

Function Documentation

◆ cr2res_add_shotnoise()

int cr2res_add_shotnoise ( hdrl_image *  in,
double  dit,
int  ndit,
int  chip 
)

Add shot-noise to errors in HDRL-image.

Parameters
inthe input hdrl image, gets modified
Returns
0 if ok, -1 in error case

Definition at line 342 of file cr2res_calib.c.

References hdrl_image_get_error(), and hdrl_image_get_image().

Referenced by cr2res_calib_image().

◆ cr2res_calib_image()

hdrl_image * cr2res_calib_image ( const hdrl_image *  in,
int  chip,
int  clean_bad,
int  subtract_nolight_rows,
int  subtract_interorder_column,
int  cosmics_corr,
const cpl_frame *  flat,
const cpl_frame *  dark,
const cpl_frame *  bpm,
const cpl_frame *  detlin,
double  dit,
int  ndit 
)

The images calibration routine for a given chip.

Parameters
inthe input hdrl image
chipthe chip to calibrate (1 to CR2RES_NB_DETECTORS)
clean_badFlag to activate the cleaning of the bad pixels
subtract_nolight_rows
cosmics_corrFlag to correct for cosmics
flatthe flat frame or NULL
darkthe dark frame or NULL
bpmthe bpm frame or NULL
detlinthe detlin frame or NULL
ditthe DIT for the dark correction The flat, dark and bpm must have the same size as the input in. In the case of detlin, data are only taken in normal mode.
Returns
the newly allocated image or NULL in error case

Definition at line 148 of file cr2res_calib.c.

References cr2res_add_shotnoise(), cr2res_bpm_set_and_correct_image(), cr2res_calib_subtract_interorder_column(), cr2res_detlin_correct(), cr2res_io_load_DETLIN_COEFFS(), cr2res_io_load_MASTER_DARK(), cr2res_io_load_MASTER_FLAT(), cr2res_pfits_get_dit(), hdrl_image_delete(), hdrl_image_div_image(), hdrl_image_duplicate(), hdrl_image_get_image(), hdrl_image_get_mask(), hdrl_image_insert(), hdrl_image_mul_scalar(), hdrl_image_new(), hdrl_image_sub_image(), hdrl_imagelist_delete(), hdrl_lacosmic_edgedetect(), hdrl_lacosmic_parameter_create(), hdrl_lacosmic_parameter_verify(), and hdrl_parameter_delete().

Referenced by cr2res_calib_imagelist().

◆ cr2res_calib_imagelist()

hdrl_imagelist * cr2res_calib_imagelist ( const hdrl_imagelist *  in,
int  chip,
int  clean_bad,
int  subtract_nolight_rows,
int  subtract_interorder_column,
int  cosmics_corr,
const cpl_frame *  flat,
const cpl_frame *  dark,
const cpl_frame *  bpm,
const cpl_frame *  detlin,
const cpl_vector *  dits,
const cpl_vector *  ndits 
)

The images calibration routine for a given chip on a list.

Parameters
inthe input hdrl image list
chipthe chip to calibrate (1 to CR2RES_NB_DETECTORS)
clean_badFlag to activate the cleaning of the bad pixels
subtract_nolight_rows
cosmics_corrFlag to correct for cosmics
flatthe flat frame or NULL
darkthe dark frame or NULL
bpmthe bpm frame or NULL
detlinthe detlin frame or NULL
ditsthe DITs of the images for the dark correction The flat, dark and bpm must have the same size as the input in. In the case of detlin, data are only taken in normal mode.
Returns
the newly allocated imagelist or NULL in error case

Definition at line 71 of file cr2res_calib.c.

References cr2res_calib_image(), hdrl_imagelist_delete(), hdrl_imagelist_get(), hdrl_imagelist_get_size(), hdrl_imagelist_new(), and hdrl_imagelist_set().

◆ cr2res_calib_subtract_interorder_column()

int cr2res_calib_subtract_interorder_column ( hdrl_image *  in,
const hdrl_image *  flat,
cpl_size  degree 
)

Remove background column by column.

Parameters
inthe input hdrl image, gets modified
Returns
0 if ok, -1 in error case

Fits the background in each column, using a 1d polynomial with given degree to the out of order pixels.

Here the orders are defined by the flat-field.

Definition at line 420 of file cr2res_calib.c.

References cr2res_vector_get_mad(), hdrl_image_get_image(), hdrl_image_get_image_const(), hdrl_image_get_size_x(), and hdrl_image_get_size_y().

Referenced by cr2res_calib_image().