NACO Pipeline Reference Manual  4.4.0
Functions
Functions for calibrations

Functions

static double irplib_pfits_get_dit (const cpl_propertylist *plist)
 find out the character string associated to the DIT keyword in a propertylist More...
 
static double irplib_pfits_get_exp_time (const cpl_propertylist *plist)
 find out the character string associated to the EXPTIME keyword More...
 
static int irplib_get_clean_mean_window (cpl_image *img, const int llx, const int lly, const int urx, int ury, const int kappa, const int nclip, double *clean_mean, double *clean_stdev)
 Get clean mean and stdev of an image over a window. More...
 
cpl_table * irplib_compute_gain (cpl_frameset *son, cpl_frameset *sof, int *zone, const int kappa, const int nclip)
 Computes the detector's gain. More...
 
cpl_table * irplib_compute_linearity (cpl_frameset *son, cpl_frameset *sof)
 Computes the detector's linearity. More...
 
int irplib_detlin_correct (cpl_imagelist *ilist, const char *detlin_a, const char *detlin_b, const char *detlin_c)
 Apply the detector linearity correction. More...
 
int irplib_flat_dark_bpm_calib (cpl_imagelist *ilist, const char *flat, const char *dark, const char *bpm)
 Apply the calibration to the frames. More...
 
static cpl_vector * irplib_imagelist_get_clean_mean_levels (const cpl_imagelist *iml, const double kappa, const int nclip, const double tolerance)
 find out the character string associated to the DIT keyword in a propertylist More...
 
static cpl_error_code irplib_imagelist_subtract_values (cpl_imagelist **iml, cpl_vector *values)
 Subtract from input imagelist values specified in input vector. More...
 
static double irplib_vector_ksigma (cpl_vector *values, const double klow, const double khigh, int kiter)
 Perform kappa-sigma clip. More...
 
static cpl_image * irplib_imagelist_ksigma_stack (const cpl_imagelist *imlist, double klow, double khigh, int kiter)
 Stack images using k-sigma clipping. More...
 
cpl_image * irplib_mkmaster_mean (cpl_imagelist *images, const double kappa, const int nclip, const double tolerance, const double klow, const double khigh, const int niter)
 Computes master frame by clean stack mean of the input imagelist. More...
 
cpl_image * irplib_mkmaster_median (cpl_imagelist *images, const double kappa, const int nclip, const double tolerance)
 Computes master frame by clean stack median of the input imagelist. More...
 
static cpl_error_code irplib_mkmaster_dark_qc (const cpl_imagelist *raw_images, cpl_imagelist *preproc_images, const cpl_parameterlist *parameters, const int pr_num_x, const int pr_num_y, const int pr_box_sx, const int pr_box_sy, const char *recipe_id, cpl_table *qclog)
 
static double irplib_head_get_exptime (const cpl_propertylist *plist)
 Find out the exposure time in seconds. More...
 
static cpl_error_code irplib_head_set_exptime (cpl_propertylist *plist, double exptime)
 Write the exposure time. More...
 
static cpl_imagelist * irplib_mkmaster_dark_fill_imagelist (const cpl_imagelist *raw_images, cpl_propertylist **raw_headers, const cpl_image *master_bias, double *mean_exptime)
 
cpl_image * irplib_mdark_process_chip (const cpl_imagelist *raw_images, cpl_propertylist **raw_headers, const cpl_image *master_bias, cpl_propertylist *mdark_header, const cpl_parameterlist *parameters, const char *recipe_id, cpl_table *qclog, const int do_qc, const char *STACK_METHOD, const double STACK_KLOW, const double STACK_KHIGH, const int STACK_NITER, const int pr_num_x, const int pr_num_y, const int pr_box_sx, const int pr_box_sy)
 

Detailed Description

Function Documentation

static double irplib_pfits_get_dit ( const cpl_propertylist *  plist)
static

find out the character string associated to the DIT keyword in a propertylist

Parameters
plistpropertylist
Returns
dit value

Definition at line 80 of file irplib_calib.c.

Referenced by irplib_compute_gain(), and irplib_compute_linearity().

static double irplib_pfits_get_exp_time ( const cpl_propertylist *  plist)
static

find out the character string associated to the EXPTIME keyword

Parameters
plistpropertylist
Returns
keyword value

Definition at line 92 of file irplib_calib.c.

Referenced by irplib_compute_gain().

static int irplib_get_clean_mean_window ( cpl_image *  img,
const int  llx,
const int  lly,
const int  urx,
int  ury,
const int  kappa,
const int  nclip,
double *  clean_mean,
double *  clean_stdev 
)
static

Get clean mean and stdev of an image over a window.

Parameters
imginput image
llxinput lower left x image's window coordinate
llyinput lower left y image's window coordinate
urxinput upper right y image's window coordinate
uryinput upper right y image's window coordinate
kappainput kappa of kappa-sigma clip
nclipinput max no of kappa-sigma clip iterations
clean_meanoutput upper right y image's window coordinate
clean_stdevoutput upper right y image's window coordinate
Returns
pixel scale

Definition at line 116 of file irplib_calib.c.

Referenced by irplib_compute_gain().

cpl_table* irplib_compute_gain ( cpl_frameset *  son,
cpl_frameset *  sof,
int *  zone,
const int  kappa,
const int  nclip 
)

Computes the detector's gain.

Parameters
sonthe input frameset of linearity on-flat fields
softhe input frameset of linearity off-flat fields
zonepointer to an integer array with locations (llx,lly,urx,ury) of region where a clean mean and noise are computed
kappavalue of kappa in kappa-sigma clipping
nclipnumber of kappa-sigma clipping iterations
Returns
pointer to a table containing single gain evaluations
Note
: #1 input frames need to have defined FITS keyword EXPTIME #2 input frames need to have defined FITS keyword DIT

Definition at line 191 of file irplib_calib.c.

References irplib_get_clean_mean_window(), irplib_pfits_get_dit(), and irplib_pfits_get_exp_time().

cpl_table* irplib_compute_linearity ( cpl_frameset *  son,
cpl_frameset *  sof 
)

Computes the detector's linearity.

Parameters
sonthe input frameset of linearity on flat fields
softhe input frameset of linearity off flat fields
Returns
pointer to a table containing linearity evaluations
Note
: #2 input frames need to have defined FITS keyword EXPTIME #3 input frames need to have defined FITS keyword DIT

Definition at line 372 of file irplib_calib.c.

References irplib_pfits_get_dit().

int irplib_detlin_correct ( cpl_imagelist *  ilist,
const char *  detlin_a,
const char *  detlin_b,
const char *  detlin_c 
)

Apply the detector linearity correction.

Parameters
ilistthe input image list
detlin_athe a coeffs
detlin_bthe b coeffs
detlin_cthe c coeffs
Returns
0 if everything is ok, -1 otherwise

Definition at line 493 of file irplib_calib.c.

int irplib_flat_dark_bpm_calib ( cpl_imagelist *  ilist,
const char *  flat,
const char *  dark,
const char *  bpm 
)

Apply the calibration to the frames.

Parameters
ilistthe input image list
flatthe flat field
darkthe dark
bpmthe bad pixels map
Returns
0 if everything is ok, -1 otherwise

Definition at line 578 of file irplib_calib.c.

static cpl_vector* irplib_imagelist_get_clean_mean_levels ( const cpl_imagelist *  iml,
const double  kappa,
const int  nclip,
const double  tolerance 
)
static

find out the character string associated to the DIT keyword in a propertylist

Parameters
plistpropertylist
Returns
dit value Computes kappa-sigma clean mean (free bad pixels) for each input image of the input imagelist.
Parameters
imlinput imagelist
kappavalue for kappa-sigma clip
nclipNumber of clipping iterations
tolerancetolerance on range between two successive clip iterations
Returns
vector with computed values for each image of the list

The returned vector must be deallocated.

Definition at line 70 of file irplib_mkmaster.c.

Referenced by irplib_mkmaster_mean(), and irplib_mkmaster_median().

static cpl_error_code irplib_imagelist_subtract_values ( cpl_imagelist **  iml,
cpl_vector *  values 
)
static

Subtract from input imagelist values specified in input vector.

Parameters
imlinput imagelist
valuesvalue to be subtracted
Returns
corrected imagelist

Definition at line 118 of file irplib_mkmaster.c.

Referenced by irplib_mkmaster_mean(), and irplib_mkmaster_median().

static double irplib_vector_ksigma ( cpl_vector *  values,
const double  klow,
const double  khigh,
int  kiter 
)
static

Perform kappa-sigma clip.

Author
C. Izzo
Parameters
valuesvalues to be checked
klowkappa to clip too low level values
khighkappa to clip too high values
kiternumber of iterations
Note
In first iteration a median is the reference value for robustness
Returns

Definition at line 153 of file irplib_mkmaster.c.

Referenced by irplib_imagelist_ksigma_stack().

static cpl_image* irplib_imagelist_ksigma_stack ( const cpl_imagelist *  imlist,
double  klow,
double  khigh,
int  kiter 
)
static

Stack images using k-sigma clipping.

Parameters
imlistList of images to stack
klowNumber of sigmas for rejection of lowest values
khighNumber of sigmas for rejection of highest values
kiterMax number of iterations
Returns
Stacked image.

At the first iteration the value of sigma is computed relatively to the median value of all pixels at a given image position. For the next iterations the sigma is computed in the standard way. If at some iteration all points would be rejected, the mean computed at the previous iteration is returned.

Definition at line 232 of file irplib_mkmaster.c.

References irplib_vector_ksigma().

Referenced by irplib_mkmaster_mean().

cpl_image* irplib_mkmaster_mean ( cpl_imagelist *  images,
const double  kappa,
const int  nclip,
const double  tolerance,
const double  klow,
const double  khigh,
const int  niter 
)

Computes master frame by clean stack mean of the input imagelist.

Parameters
imagesinput imagelist
kappavalue for kappa-sigma clip
nclipNumber of clipping iterations
tolerancetolerance on range between two successive clip iterations
Returns
master image

The returned image must be deallocated.

Definition at line 313 of file irplib_mkmaster.c.

References irplib_imagelist_get_clean_mean_levels(), irplib_imagelist_ksigma_stack(), and irplib_imagelist_subtract_values().

cpl_image* irplib_mkmaster_median ( cpl_imagelist *  images,
const double  kappa,
const int  nclip,
const double  tolerance 
)

Computes master frame by clean stack median of the input imagelist.

Parameters
imagesinput imagelist
kappavalue for kappa-sigma clip
nclipNumber of clipping iterations
tolerancetolerance on range between two successive clip iterations
Returns
master image

The returned image must be deallocated.

Definition at line 352 of file irplib_mkmaster.c.

References irplib_imagelist_get_clean_mean_levels(), and irplib_imagelist_subtract_values().

static double irplib_head_get_exptime ( const cpl_propertylist *  plist)
static

Find out the exposure time in seconds.

Parameters
plistHeader to read from
Returns
The requested value, or undefined on error

An error is set if the exposure time is negative. In that case this negative value is returned.

Definition at line 424 of file irplib_mkmaster.c.

static cpl_error_code irplib_head_set_exptime ( cpl_propertylist *  plist,
double  exptime 
)
static

Write the exposure time.

Parameters
plistProperty list to write to
exptimeThe value to write
Returns
CPL_ERROR_NONE iff okay.

Definition at line 443 of file irplib_mkmaster.c.