X-shooter Pipeline Reference Manual 3.8.15
Modules | Functions
Handle Frames in PRE Format (xsh_prepare)

Modules

 DRL check related functions
 

Functions

cpl_frame * xsh_bpmap_2pre (cpl_frame *bpmap, const char *prefix, xsh_instrument *inst)
 This function transform a BP map from raw to pre format.
 
void xsh_prepare (cpl_frameset *frames, cpl_frame *bpmap, cpl_frame *mbias, const char *prefix, xsh_instrument *instr, const int pre_overscan_corr, const bool flag_neg_and_thresh_pix)
 This function transform RAW frames dataset in PRE frames dataset attaching the default bad pixel map and an error image.
 
cpl_frame * xsh_preframe_extract (cpl_frame *frame, int xmin, int ymin, int xmax, int ymax, const char *name, xsh_instrument *instr)
 This function create a sub frame from PRE frame. the sub frame is described by a box.
 

Detailed Description

Prepare This module is a template DRL function which adds the master bias to the input frame

Function Documentation

◆ xsh_bpmap_2pre()

cpl_frame * xsh_bpmap_2pre ( cpl_frame *  bpmap,
const char *  prefix,
xsh_instrument inst 
)

This function transform a BP map from raw to pre format.

Parameters
[in]bpmapA bad pixel map in RAW format
[in]bpmap
The default bad pixel map or NULL if not
Returns
the frame corresponding to the map in PRE format.

Definition at line 81 of file xsh_prepare.c.

References xsh_pre::data, QFLAG_NON_LINEAR_PIXEL, XSH_BP_MAP_NL, xsh_bpmap_bitwise_to_flag(), XSH_FREE, xsh_instrument_arm_tostring(), xsh_pre_create(), xsh_pre_free(), and xsh_pre_save().

Referenced by xsh_check_load_master_bpmap().

◆ xsh_preframe_extract()

cpl_frame * xsh_preframe_extract ( cpl_frame *  frame,
int  xmin,
int  ymin,
int  xmax,
int  ymax,
const char *  name,
xsh_instrument instr 
)

This function create a sub frame from PRE frame. the sub frame is described by a box.

Parameters
[in]frameA pre frame
[in]xmin
The x coordinate of the low-left corner of the box
[in]yminThe y coordinate of the low-left corner of the box
[in]xmax
The x coordinate of the up-right corner of the box
[in]ymaxThe y coordinate of the up-right corner of the box
[in]nameThe name of the sub frame
[in]instrInstrument containing the arm , mode and lamp in use

Definition at line 221 of file xsh_prepare.c.

References check, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_pre_extract(), xsh_pre_free(), xsh_pre_load(), and xsh_pre_save().

Referenced by xsh_flexcomp().

◆ xsh_prepare()

void xsh_prepare ( cpl_frameset *  frames,
cpl_frame *  bpmap,
cpl_frame *  mbias,
const char *  prefix,
xsh_instrument instr,
const int  pre_overscan_corr,
const bool  flag_neg_and_thresh_pix 
)

This function transform RAW frames dataset in PRE frames dataset attaching the default bad pixel map and an error image.

Parameters
[in]framesA set of RAW frames
[in]bpmap
The default bad pixel map or NULL if not
[in]mbiasThe master bias frame to compute ERRS in PRE files or NULL if not
[in]prefixThe prefix of the resulting file name
[in]instrInstrument containing the arm , mode and lamp in use
[in]pre_overscan_corrswitch to use overscan region for bias estimation

Definition at line 122 of file xsh_prepare.c.

References check, size, XSH_ASSURE_NOT_NULL, XSH_FLAT, xsh_free_frame(), xsh_instrument_get_lamp(), XSH_LAMP_D2, XSH_LAMP_QTH, xsh_msg_dbg_medium, xsh_pre_create(), xsh_pre_free(), xsh_pre_get_data(), xsh_pre_load(), and xsh_pre_save().

Referenced by main(), xsh_2dmap(), xsh_absorp(), xsh_cfg_recover_last_step(), xsh_flexcomp(), xsh_geom_ifu(), xsh_linear(), xsh_mbias(), xsh_mdark(), xsh_mflat_combine_flats(), xsh_orderpos(), xsh_predict(), xsh_respon_slit_nod(), xsh_respon_slit_offset(), xsh_respon_slit_stare(), xsh_scired_ifu_offset(), xsh_scired_ifu_stare(), xsh_scired_slit_nod(), xsh_scired_slit_offset(), xsh_scired_slit_stare(), xsh_util_ima_arith(), and xsh_wavecal().