Remove Cosmic Rays Multiple (xsh_remove_crh_multiple)
[DRL Functions]

Functions

static void xsh_collapse_errs (cpl_image *errs, cpl_imagelist *list, cpl_mask *mask)
static int xsh_remove_cr (cpl_imagelist *datalist, cpl_imagelist *errslist, cpl_image *median, cpl_image *errs, cpl_mask *mask, xsh_clipping_param *crh_clipping)
static void add_qc_crh (xsh_pre *pre, int nbcrh, int nframes, xsh_instrument *instrument)
static cpl_frame * xsh_remove_cosmics (cpl_frameset *rawFrames, const char *result_tag, xsh_clipping_param *crh_clipping, xsh_instrument *instr, cpl_imagelist **list, cpl_image **crh_ima, int median_mean)
 Creates median, error and bad pixel map images from a set of frames.
cpl_frame * xsh_create_master_bias2 (cpl_frameset *rawFrames, xsh_instrument *instr, const char *result_tag)
 Creates master bias.
cpl_frame * xsh_remove_crh_multiple (cpl_frameset *rawFrames, const char *result_tag, xsh_clipping_param *crh_clipping, xsh_instrument *instrument, cpl_imagelist **list, cpl_image **crh_ima)
cpl_frame * xsh_combine_offset (cpl_frameset *rawFrames, const char *result_tag, xsh_clipping_param *crh_clipping, xsh_instrument *instrument, cpl_imagelist **list, cpl_image **crh_ima)

Detailed Description

Suppress Cosmic Rays by analysing multiple files.


Function Documentation

static void add_qc_crh ( xsh_pre pre,
int  nbcrh,
int  nframes,
xsh_instrument instrument 
) [static]

Calculates and set the QC parameters relevant for Cosmic Rays.

Parameters:
pre Pointer to XSH_PRE Structure
nbcrh Total umber of cosmics found
nframes Number of frames used to remove cosmics
instrument Pointer to indstrument description structure

< Average of cosmics per frame

Definition at line 252 of file xsh_remove_crh_multi.c.

References check, xsh_pre::data_header, xsh_pre::exptime, xsh_pre::nx, xsh_pre::ny, xsh_pre::pszx, xsh_pre::pszy, xsh_pre::qual_header, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_msg_dbg_medium, xsh_pfits_set_qc_crrate(), xsh_pfits_set_qc_ncrh(), and xsh_pfits_set_qc_ncrh_mean().

Referenced by xsh_remove_cosmics().

static void xsh_collapse_errs ( cpl_image *  errs,
cpl_imagelist *  list,
cpl_mask *  mask 
) [static]

Create an error image from an image list and a "valid pixels" mask

Parameters:
errs [OUTPUT] The errs image result
list error images list to collapse
mask mask given pixel to compute in error image
Returns:
Pointer to error image

Definition at line 78 of file xsh_remove_crh_multi.c.

References assure, check, M_PI, nx, and ny.

Referenced by xsh_create_master_bias2(), and xsh_remove_cosmics().

cpl_frame* xsh_combine_offset ( cpl_frameset *  rawFrames,
const char *  result_tag,
xsh_clipping_param crh_clipping,
xsh_instrument instrument,
cpl_imagelist **  list,
cpl_image **  crh_ima 
)

Definition at line 640 of file xsh_remove_crh_multi.c.

References check, XSH_ASSURE_NOT_NULL, and xsh_remove_cosmics().

Referenced by xsh_scired_ifu_offset().

cpl_frame* xsh_create_master_bias2 ( cpl_frameset *  rawFrames,
xsh_instrument instr,
const char *  result_tag 
)

Creates master bias.

Parameters:
rawFrames Pointer to the frameset
instr instrument containing the arm , mode and lamp in use
result_tag product catg
Returns:
the clean mean frame newly allocated

Definition at line 525 of file xsh_remove_crh_multi.c.

References assure, check, check_msg, xsh_pre::data, xsh_pre::data_header, xsh_pre::errs, size, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_bpmap_collapse_median(), xsh_collapse_errs(), xsh_free_frame(), xsh_free_imagelist(), xsh_free_mask(), xsh_msg, xsh_pfits_set_datancom(), xsh_pre_free(), xsh_pre_get_bpmap(), xsh_pre_load(), and xsh_pre_save().

Referenced by xsh_mbias().

static cpl_frame* xsh_remove_cosmics ( cpl_frameset *  rawFrames,
const char *  result_tag,
xsh_clipping_param crh_clipping,
xsh_instrument instr,
cpl_imagelist **  list,
cpl_image **  crh_ima,
int  median_mean 
) [static]

Creates median, error and bad pixel map images from a set of frames.

Parameters:
rawFrames Pointer to the frameset (returned from xsh_prepare)
result_tag Tag of resulting file
crh_clipping Pointer to parameters for sigma clipping
instr instrument containing the arm , mode and lamp in use
list Pointer to created image list
crh_ima Pointer to created crh image map
median_mean 
Returns:
the median frame newly allocated where cosmic rays are removed

Definition at line 301 of file xsh_remove_crh_multi.c.

References add_qc_crh(), assure, check, check_msg, xsh_pre::data, xsh_pre::data_header, xsh_pre::errs, xsh_pre::exptime, xsh_clipping_param::frac, xsh_clipping_param::niter, niter, xsh_pre::nx, xsh_pre::ny, QFLAG_COSMIC_RAY_REMOVED, size, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_bpmap_collapse_mean(), xsh_bpmap_collapse_median(), xsh_bpmap_mask_bad_pixel(), xsh_collapse_errs(), XSH_CRH_MAP, xsh_debug_level_get(), XSH_DEBUG_LEVEL_MEDIUM, xsh_free_frame(), xsh_free_image(), xsh_free_imagelist(), xsh_free_mask(), XSH_GET_TAG_FROM_ARM, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_medium, xsh_pfits_set_datancom(), xsh_pre_free(), xsh_pre_get_bpmap(), xsh_pre_load(), xsh_pre_save(), and xsh_remove_cr().

Referenced by xsh_combine_offset(), and xsh_remove_crh_multiple().

static int xsh_remove_cr ( cpl_imagelist *  datalist,
cpl_imagelist *  errslist,
cpl_image *  median,
cpl_image *  errs,
cpl_mask *  mask,
xsh_clipping_param crh_clipping 
) [static]
cpl_frame* xsh_remove_crh_multiple ( cpl_frameset *  rawFrames,
const char *  result_tag,
xsh_clipping_param crh_clipping,
xsh_instrument instrument,
cpl_imagelist **  list,
cpl_image **  crh_ima 
)

Generated on 9 Mar 2011 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1