Functions | |
void | xsh_badpixelmap_or (xsh_pre *self, const xsh_pre *right) |
cpl_frame * | xsh_badpixelmap_crea_master_from_bpmap (cpl_frame *bpmap, xsh_instrument *inst) |
static cpl_error_code | xsh_flag_ima_bad_pix (cpl_image **image, int *bppix, const int decode_bp) |
void | xsh_set_image_cpl_bpmap (cpl_image *image, cpl_image *bpmap, const int decode_bp) |
void | xsh_image_flag_bp (cpl_image *image, cpl_image *bpmap, xsh_instrument *inst) |
void | xsh_bpmap_bitwise_to_flag (cpl_image *bpmap, int flag) |
void | xsh_bpmap_mask_bad_pixel (cpl_image *bpmap, cpl_mask *mask, int flag) |
void | xsh_bpmap_set_bad_pixel (cpl_image *bpmap, int ix, int iy, int flag) |
cpl_image * | xsh_bpmap_collapse_bpmap_create (cpl_imagelist *liste, const int decode_bp) |
int | xsh_bpmap_count (cpl_image *bpmap, int nx, int ny) |
void | xsh_bpmap_collapse_median (cpl_image *median, cpl_imagelist *list, cpl_mask *bpmap) |
void | xsh_bpmap_collapse_mean (cpl_image *mean, cpl_imagelist *list, cpl_mask *bpmap) |
cpl_error_code | xsh_badpixelmap_image_coadd (cpl_image **self, const cpl_image *right, const int mode) |
cpl_error_code | xsh_badpixelmap_coadd (cpl_frame *self, const cpl_frame *right, const int mode) |
cpl_error_code | xsh_frame_qual_update (cpl_frame *frame, const cpl_frame *bpmap, xsh_instrument *inst) |
static cpl_error_code | xsh_image_get_hot_cold_maps (cpl_image *masterbias, const double kappa_low, const double kappa_high, const int low_niter, const int high_niter, cpl_mask **bpmhot, int *hotpix_nb, cpl_mask **bpmcold, int *coldpix_nb, cpl_propertylist **hplist, cpl_propertylist **cplist) |
cpl_error_code | xsh_image_get_hot_cold_pixs (cpl_frame *frame_image, xsh_instrument *instrument, const double ks_low, const int cold_niter, const double ks_high, const int hot_niter, cpl_frame **cpix_frm, cpl_frame **hpix_frm) |
cpl_frame * | xsh_image_local_cold_pixs (cpl_image *ima, const double kappa, const int r, xsh_instrument *instr) |
cpl_frame * | xsh_image_local_hot_pixs (cpl_image *ima, const double kappa, const int r, xsh_instrument *instr) |
cpl_error_code | xsh_image_clean_mask_pixs (cpl_image **ima, cpl_image *msk, const int r) |
static cpl_error_code | xsh_image_coadd (cpl_image **self, const cpl_image *add) |
cpl_image * | xsh_image_flag_bptype_with_crox (cpl_image *ima) |
cpl_error_code | xsh_badpixelmap_flag_saturated_pixels (xsh_pre *pre, xsh_instrument *instr, const double cor_val, int flag, int *nsat) |
cpl_error_code | xsh_badpixelmap_count_range_pixels (xsh_pre *pre, const double thresh_min, const double thresh_max, const double cor_val, int *nrange, double *frange) |
cpl_error_code | xsh_badpixelmap_count_sat_pixels (xsh_pre *pre, const double sat_thresh, const double cor_val, int *nsat, double *frac_sat) |
cpl_error_code | xsh_badpixelmap_fill_bp_pattern_holes (cpl_frame *frm) |
cpl_frame * | xsh_badpixelmap_extract (cpl_frame *frame, int xmin, int ymin, int xmax, int ymax) |
This function create a sub bad pixel map frame from input bad pixel map frame. the sub frame is described by a box. |
This module contains functions used to handle Xshooter version of Bad pixel mask (each pixel is marked with a set of bits describing why the pixel has been considered BAD).
cpl_error_code xsh_badpixelmap_coadd | ( | cpl_frame * | self, | |
const cpl_frame * | right, | |||
const int | mode | |||
) |
Create coadd a mask frame with another
self | input bp map frame | |
right | input bp map frame |
Definition at line 609 of file xsh_badpixelmap.c.
References assure, check, xsh_add_temporary_file(), xsh_badpixelmap_image_coadd(), xsh_free_image(), xsh_free_propertylist(), and xsh_msg.
Referenced by xsh_check_load_master_bpmap(), and xsh_util_bpmap_coadd().
cpl_error_code xsh_badpixelmap_count_range_pixels | ( | xsh_pre * | pre, | |
const double | thresh_min, | |||
const double | thresh_max, | |||
const double | cor_val, | |||
int * | nrange, | |||
double * | frange | |||
) |
Definition at line 1255 of file xsh_badpixelmap.c.
References xsh_pre::data, xsh_pre::nx, xsh_pre::ny, and size.
Referenced by xsh_pre_create().
cpl_error_code xsh_badpixelmap_count_sat_pixels | ( | xsh_pre * | pre, | |
const double | sat_thresh, | |||
const double | cor_val, | |||
int * | nsat, | |||
double * | frac_sat | |||
) |
Definition at line 1280 of file xsh_badpixelmap.c.
References xsh_pre::data, xsh_pre::nx, xsh_pre::ny, and size.
cpl_frame* xsh_badpixelmap_crea_master_from_bpmap | ( | cpl_frame * | bpmap, | |
xsh_instrument * | inst | |||
) |
Create the master bad pixel map (cpl format) from a Bad Pixel Map image
bpmap | XSH format bad pixel map | |
inst | XSH instrumnent (arm/ifu) setting |
Definition at line 109 of file xsh_badpixelmap.c.
References xsh_add_temporary_file(), xsh_free_image(), xsh_free_propertylist(), xsh_instrument_arm_tostring(), XSH_MASTER_BP_MAP_FLAT, xsh_pfits_set_pcatg(), and XSH_PRE_QUAL_BPP.
cpl_frame* xsh_badpixelmap_extract | ( | cpl_frame * | frame, | |
int | xmin, | |||
int | ymin, | |||
int | xmax, | |||
int | ymax | |||
) |
This function create a sub bad pixel map frame from input bad pixel map frame. the sub frame is described by a box.
[in] | frame | A bad pixel map frame |
[in] | xmin | The x coordinate of the low-left corner of the box |
[in] | ymin | The y coordinate of the low-left corner of the box |
[in] | xmax | The x coordinate of the up-right corner of the box |
[in] | ymax | The y coordinate of the up-right corner of the box |
[in] | name | The name of the sub frame |
[in] | instr | Instrument containing the arm , mode and lamp in use |
Definition at line 1389 of file xsh_badpixelmap.c.
References check, xsh_add_temporary_file(), XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_image(), xsh_free_propertylist(), and XSH_PRE_DATA_BPP.
Referenced by xsh_flexcomp().
cpl_error_code xsh_badpixelmap_fill_bp_pattern_holes | ( | cpl_frame * | frm | ) |
Definition at line 1300 of file xsh_badpixelmap.c.
References nx, ny, QFLAG_ELECTRONIC_PICKUP, xsh_free_image(), xsh_free_propertylist(), xsh_pfits_get_qc_nhpix(), xsh_pfits_set_qc_nhpix(), xsh_pfits_set_qc_noisepix(), XSH_PRE_DATA_BPP, XSH_PRE_DATA_TYPE, XSH_PRE_ERRS_BPP, XSH_PRE_ERRS_TYPE, XSH_PRE_QUAL_BPP, XSH_PRE_QUAL_TYPE, and XSH_QC_NHPIX.
Referenced by xsh_mdark().
cpl_error_code xsh_badpixelmap_flag_saturated_pixels | ( | xsh_pre * | pre, | |
xsh_instrument * | instr, | |||
const double | cor_val, | |||
int | flag, | |||
int * | nsat | |||
) |
Definition at line 1190 of file xsh_badpixelmap.c.
References check, xsh_pre::data, xsh_pre::data_header, xsh_pre::nx, xsh_pre::ny, QFLAG_ADC_SATURATION, QFLAG_NEGATIVE_DATA, QFLAG_SATURATED_DATA, xsh_pre::qual, size, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL_MSG, xsh_instrument_get_arm(), xsh_pfits_get_dit(), and xsh_pfits_get_ndit().
Referenced by xsh_pre_create().
cpl_error_code xsh_badpixelmap_image_coadd | ( | cpl_image ** | self, | |
const cpl_image * | right, | |||
const int | mode | |||
) |
Create coadd a mask frame with another
self | input bp map image | |
right | input bp map image | |
mode | Bitwise AND or Bitwise OR |
Definition at line 551 of file xsh_badpixelmap.c.
References assure, check, nx, ny, and xsh_msg.
Referenced by xsh_badpixelmap_coadd(), xsh_create_master_bias2(), xsh_create_master_dark2(), xsh_frame_qual_update(), xsh_mdark(), xsh_pre_create(), and xsh_remove_cosmics().
Make an "OR" between 2 bad QUAL images.
self | Inout bad pixel map (modified) | |
right | Secondary bpmap (unchanged) |
Definition at line 80 of file xsh_badpixelmap.c.
References check, xsh_pre::nx, xsh_pre::ny, xsh_pre::qual, XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_pre_add(), and xsh_pre_subtract().
void xsh_bpmap_bitwise_to_flag | ( | cpl_image * | bpmap, | |
int | flag | |||
) |
Definition at line 217 of file xsh_badpixelmap.c.
Referenced by xsh_bpmap_2pre(), xsh_lingain(), and xsh_util_bpmap2rp().
cpl_image* xsh_bpmap_collapse_bpmap_create | ( | cpl_imagelist * | liste, | |
const int | decode_bp | |||
) |
Create a bad pixel map image by a union of all the bpmap images of the liste.
liste | List of bpmap images | |
decode_bp | bad pixel code |
< first image is the result
Definition at line 301 of file xsh_badpixelmap.c.
References assure, nx, ny, xsh_flag_ima_bad_pix(), xsh_msg, and xsh_msg_dbg_low.
Referenced by xsh_compute_linearity().
void xsh_bpmap_collapse_mean | ( | cpl_image * | mean, | |
cpl_imagelist * | list, | |||
cpl_mask * | bpmap | |||
) |
Create a mean image from a list of images, taking into account a mask given pixel to compute
mean | the result average of the images collapse | |
list | List of images to collapse | |
bpmap | mask given pixels to compute CPL_BINARY_0 ==> compute the median for this pixel |
Definition at line 470 of file xsh_badpixelmap.c.
References assure, check, nx, ny, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, XSH_MALLOC, and xsh_unwrap_vector().
void xsh_bpmap_collapse_median | ( | cpl_image * | median, | |
cpl_imagelist * | list, | |||
cpl_mask * | bpmap | |||
) |
Create a median image from a list of images, taking into account a mask given pixel to compute
median | the result median of the images collapse | |
list | List of images to collapse | |
bpmap | mask given pixels to compute CPL_BINARY_0 ==> compute the median for this pixel |
Definition at line 389 of file xsh_badpixelmap.c.
References assure, check, nx, ny, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, XSH_MALLOC, and xsh_unwrap_vector().
Referenced by xsh_find_cosmics().
int xsh_bpmap_count | ( | cpl_image * | bpmap, | |
int | nx, | |||
int | ny | |||
) |
Count the number of bad pixels in a bad pixel map image.
bpmap | Bad pixel map image | |
nx | Number of pixels along X axis | |
ny | Number of pixels along Y axis |
Definition at line 363 of file xsh_badpixelmap.c.
References assure.
Referenced by verifCr(), and verify_noisy().
void xsh_bpmap_mask_bad_pixel | ( | cpl_image * | bpmap, | |
cpl_mask * | mask, | |||
int | flag | |||
) |
Definition at line 242 of file xsh_badpixelmap.c.
References assure, check, nx, and ny.
Referenced by xsh_get_master_dark_nir_via_noise(), and xsh_remove_cosmics().
void xsh_bpmap_set_bad_pixel | ( | cpl_image * | bpmap, | |
int | ix, | |||
int | iy, | |||
int | flag | |||
) |
Definition at line 287 of file xsh_badpixelmap.c.
Referenced by flag_noisy_pixels(), and xsh_compute_linearity().
static cpl_error_code xsh_flag_ima_bad_pix | ( | cpl_image ** | image, | |
int * | bppix, | |||
const int | decode_bp | |||
) | [static] |
Definition at line 135 of file xsh_badpixelmap.c.
Referenced by xsh_bpmap_collapse_bpmap_create(), and xsh_set_image_cpl_bpmap().
cpl_error_code xsh_frame_qual_update | ( | cpl_frame * | frame, | |
const cpl_frame * | bpmap, | |||
xsh_instrument * | inst | |||
) |
Create coadd a mask frame with another
frame | input frame | |
bpmap | bp map frame to be combined |
Definition at line 667 of file xsh_badpixelmap.c.
References assure, check, xsh_pre::qual, xsh_badpixelmap_image_coadd(), xsh_free_frame(), xsh_free_image(), xsh_pre_free(), xsh_pre_load(), and xsh_pre_save().
cpl_error_code xsh_image_clean_mask_pixs | ( | cpl_image ** | ima, | |
cpl_image * | msk, | |||
const int | r | |||
) |
Definition at line 1079 of file xsh_badpixelmap.c.
static cpl_error_code xsh_image_coadd | ( | cpl_image ** | self, | |
const cpl_image * | add | |||
) | [static] |
Definition at line 1111 of file xsh_badpixelmap.c.
References check, XSH_ASSURE_NOT_NULL, and xsh_msg.
Referenced by xsh_image_flag_bptype_with_crox().
void xsh_image_flag_bp | ( | cpl_image * | image, | |
cpl_image * | bpmap, | |||
xsh_instrument * | inst | |||
) |
Definition at line 181 of file xsh_badpixelmap.c.
References xsh_instrument::decode_bp, nx, ny, and xsh_free_mask().
Referenced by xsh_create_master_bias2(), xsh_create_master_dark2(), xsh_create_master_flat_with_mask(), xsh_find_cosmics(), xsh_pre_create(), and xsh_remove_cosmics().
cpl_image* xsh_image_flag_bptype_with_crox | ( | cpl_image * | ima | ) |
Definition at line 1148 of file xsh_badpixelmap.c.
References check, xsh_free_image(), and xsh_image_coadd().
Referenced by xsh_lingain().
static cpl_error_code xsh_image_get_hot_cold_maps | ( | cpl_image * | masterbias, | |
const double | kappa_low, | |||
const double | kappa_high, | |||
const int | low_niter, | |||
const int | high_niter, | |||
cpl_mask ** | bpmhot, | |||
int * | hotpix_nb, | |||
cpl_mask ** | bpmcold, | |||
int * | coldpix_nb, | |||
cpl_propertylist ** | hplist, | |||
cpl_propertylist ** | cplist | |||
) | [static] |
Definition at line 718 of file xsh_badpixelmap.c.
References check, check_msg, xsh_ksigma_clip(), xsh_msg_dbg_low, XSH_QC_COLD_PIX_NUM, XSH_QC_COLD_PIX_NUM_C, XSH_QC_HOT_PIX_NUM, XSH_QC_HOT_PIX_NUM_C, XSH_QC_MASTER_MEAN, XSH_QC_MASTER_MEAN_C, XSH_QC_MASTER_RMS, and XSH_QC_MASTER_RMS_C.
Referenced by xsh_image_get_hot_cold_pixs().
cpl_error_code xsh_image_get_hot_cold_pixs | ( | cpl_frame * | frame_image, | |
xsh_instrument * | instrument, | |||
const double | ks_low, | |||
const int | cold_niter, | |||
const double | ks_high, | |||
const int | hot_niter, | |||
cpl_frame ** | cpix_frm, | |||
cpl_frame ** | hpix_frm | |||
) |
Definition at line 832 of file xsh_badpixelmap.c.
References check, QFLAG_CAMERA_DEFECT, QFLAG_QUESTIONABLE_PIXEL, XSH_BP_MAP_CP, XSH_BP_MAP_HP, xsh_frame_product(), XSH_FREE, xsh_free_image(), xsh_free_mask(), xsh_free_propertylist(), XSH_GET_TAG_FROM_ARM, xsh_image_get_hot_cold_maps(), xsh_instrument_arm_tostring(), and xsh_msg.
cpl_frame* xsh_image_local_cold_pixs | ( | cpl_image * | ima, | |
const double | kappa, | |||
const int | r, | |||
xsh_instrument * | instr | |||
) |
Definition at line 957 of file xsh_badpixelmap.c.
References check, nx, ny, QFLAG_LOW_QE_PIXEL, XSH_BP_MAP_DP, xsh_frame_product(), xsh_instrument_arm_tostring(), and XSH_PRE_DATA_BPP.
cpl_frame* xsh_image_local_hot_pixs | ( | cpl_image * | ima, | |
const double | kappa, | |||
const int | r, | |||
xsh_instrument * | instr | |||
) |
Definition at line 1018 of file xsh_badpixelmap.c.
References check, nx, ny, QFLAG_WELL_SATURATION, XSH_BP_MAP_SP, xsh_frame_product(), xsh_instrument_arm_tostring(), and XSH_PRE_DATA_BPP.
void xsh_set_image_cpl_bpmap | ( | cpl_image * | image, | |
cpl_image * | bpmap, | |||
const int | decode_bp | |||
) |
Create the bad pixel map (cpl format) attached to the XSH format Bad Pixel Map image
image | the image on which attaches the cpl bpmap | |
bpmap | XSH format bad pixel map | |
decode_bp | bad pixel code to be rejected |
Definition at line 168 of file xsh_badpixelmap.c.
References assure, check, and xsh_flag_ima_bad_pix().
Referenced by xsh_compute_linearity(), xsh_compute_noise_map(), and xsh_follow_arclines().