Compute Linearity (xsh_compute_linearity)
[DRL Functions]

Defines

#define USE_CPL_POLYNOMIAL
#define OPTIMIZE_IMAGE_HANDLING

Functions

static int orderCompare (const void *one, const void *two)
static int onoffCompare (const void *one, const void *two)
cpl_frameset * xsh_subtract_on_off (cpl_frameset *set, xsh_instrument *instrument)
int xsh_linear_group_by_exptime (cpl_frameset *raws, xsh_instrument *instrument, double exp_toler, cpl_frameset **groupSet)
cpl_frame * xsh_compute_linearity (cpl_frameset *medSet, xsh_instrument *instrument, xsh_clipping_param *lin_clipping, const int decode_bp)

Detailed Description

Functions used to compute the linearity bad pixel mask (recipe xsh_linear)


Define Documentation

#define OPTIMIZE_IMAGE_HANDLING

Definition at line 62 of file xsh_compute_linearity.c.

#define USE_CPL_POLYNOMIAL

Definition at line 61 of file xsh_compute_linearity.c.


Function Documentation

static int onoffCompare ( const void *  one,
const void *  two 
) [static]

Function used by qsort to order frames by ON/OFF Lamp keyword.

Parameters:
one Pointer to first item to be compared
two Pointer to second item ...
Returns:
1 if first on_off flag is > than second, -1 otherwise

Definition at line 101 of file xsh_compute_linearity.c.

References TIME_FRAME::on_off.

Referenced by xsh_linear_group_by_exptime().

static int orderCompare ( const void *  one,
const void *  two 
) [static]

Function used by qsort to order frames by increasing exptime.

Parameters:
one Pointer to first item to be compared
two Pointer to second item ...
Returns:
1 if first exptime is > than second, -1 otherwise

Definition at line 81 of file xsh_compute_linearity.c.

References TIME_FRAME::exptime.

Referenced by xsh_linear_group_by_exptime().

cpl_frame* xsh_compute_linearity ( cpl_frameset *  medSet,
xsh_instrument instrument,
xsh_clipping_param lin_clipping,
const int  decode_bp 
)

Computes the linearity bad pixel mask from median frames with increasing exposure times.

Parameters:
medSet The frameset of median frames (as returned by remove_crh)
instrument Pointer to the instrument description structure
lin_clipping Parameters of linearity sigma clipping
Returns:
The linearity bad pixel mask

< The final result bad pixel map image

< The final frame

< Temporary image list (to be freed)

< Temporary image list (to be freed)

< Temporary propertylist (to be freed)

< Temporary image list (to be freed)

< List of Bad pixel maps

Definition at line 550 of file xsh_compute_linearity.c.

References xsh_instrument::arm, assure, check, check_msg, LINEAR_POLYNOMIAL_DEGREE, xsh_clipping_param::niter, QFLAG_NON_LINEAR_PIXEL, xsh_clipping_param::sigma, XSH_ARM_NIR, XSH_BP_MAP_LIN, xsh_bpmap_collapse_bpmap_create(), xsh_bpmap_set_bad_pixel(), xsh_fit_imagelist_polynomial(), xsh_frame_product(), xsh_free_image(), xsh_free_imagelist(), xsh_free_propertylist(), XSH_GET_TAG_FROM_ARM, xsh_instrument_arm_tostring(), xsh_msg, xsh_msg_dbg_low, xsh_pfits_get_dit(), xsh_pfits_get_exptime(), xsh_pfits_set_qc(), xsh_pfits_set_qc_multi(), xsh_polynomial_fit_1d_create(), XSH_PRE_DATA_TYPE, XSH_QC_BP_MAP_LINi_MEAN, XSH_QC_BP_MAP_LINi_MED, XSH_QC_BP_MAP_LINi_RMS, XSH_QC_BP_MAP_NBADPIX, and xsh_set_image_cpl_bpmap().

Referenced by xsh_linear().

int xsh_linear_group_by_exptime ( cpl_frameset *  raws,
xsh_instrument instrument,
double  exp_toler,
cpl_frameset **  groupSet 
)

Create a list of framesets, each frameset containing frames with the same exposure time (+- tolerance). One should find at least 3 groups, each group with 3 frames. If arm is NIR, also spread ON and OFF frames into different framesets.

Parameters:
raws Frameset of raw frames (LINEARITY)
instrument Pointer to instrument description structure
exp_toler Tolerance on same exposure time in a group
groupSet Pointer to list of framesets, one frameset per group
Returns:
Number of groups of same exposure time

Definition at line 213 of file xsh_compute_linearity.c.

References xsh_instrument::arm, assure, check, check_msg, TIME_FRAME::exptime, first, TIME_FRAME::frame, TIME_FRAME::on_off, onoffCompare(), orderCompare(), XSH_ARM_NIR, xsh_free_propertylist(), xsh_msg, xsh_msg_dbg_low, xsh_pfits_get_dit(), xsh_pfits_get_exptime(), and xsh_pfits_get_lamp_on_off().

Referenced by xsh_linear().

cpl_frameset* xsh_subtract_on_off ( cpl_frameset *  set,
xsh_instrument instrument 
)

Subtracts OFF frames from ON frames with same DIT (NIR only)

Parameters:
set Frameset of all the frames at same DIT
instrument Pointer to instrument structure
Returns:
Frameset of the subtracted frames

Definition at line 120 of file xsh_compute_linearity.c.

References assure, check_msg, xsh_free_frameset(), XSH_LINEARITY_NIR, xsh_msg, xsh_msg_dbg_low, xsh_pre_duplicate(), xsh_pre_free(), xsh_pre_load(), xsh_pre_save(), and xsh_pre_subtract().

Referenced by xsh_linear().


Generated on 13 Mar 2013 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1