|
X-shooter Pipeline Reference Manual 3.8.15
|
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) |
| cpl_mask * | xsh_bpm_filter (const cpl_mask *input_mask, cpl_size kernel_nx, cpl_size kernel_ny, cpl_filter_mode filter) |
| Allows the growing and shrinking of bad pixel masks. It can be used to e.g. set pixels to bad if the pixel is surrounded by other bad pixels. | |
| cpl_mask * | xsh_code_is_in_qual (cpl_image *qual, const int code) |
| cpl_mask * | xsh_qual_to_cpl_mask (cpl_image *qual, 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_badpixel_flag_rejected (cpl_image *qual, cpl_image *image) |
| 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_count_crh (xsh_pre *pre, xsh_instrument *instr, const int datancom) |
| cpl_error_code | xsh_count_satpix (xsh_pre *pre, xsh_instrument *instr, const int datancom) |
| cpl_error_code | xsh_badpixelmap_flag_saturated_pixels (xsh_pre *pre, xsh_instrument *instr, const double cor_val, const int flag, const int is_flat, 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_badpixel_flag_rejected | ( | cpl_image * | qual, |
| cpl_image * | image | ||
| ) |
Create In the rare case input image has some flagged pixel flag them in the qual
| qual | input pixel quality image |
| image | input image (with possibly flagged pixels) |
Definition at line 692 of file xsh_badpixelmap.c.
References assure, nx, ny, and QFLAG_ALL_PIX_BAD.
Referenced by xsh_remove_cosmics().
| 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 786 of file xsh_badpixelmap.c.
References assure, check, mode, 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 1518 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 1543 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 1652 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 1563 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, | ||
| const int | flag, | ||
| const int | is_flat, | ||
| int * | nsat | ||
| ) |
Definition at line 1440 of file xsh_badpixelmap.c.
References check, xsh_pre::data, xsh_pre::nx, nx, xsh_pre::ny, ny, QFLAG_ADC_SATURATION, QFLAG_NEGATIVE_DATA, QFLAG_SATURATED_DATA, xsh_pre::qual, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL_MSG, and xsh_instrument_get_arm().
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 728 of file xsh_badpixelmap.c.
References assure, check, mode, nx, and ny.
Referenced by xsh_badpixelmap_coadd(), xsh_create_master_bias2(), xsh_create_master_dark2(), xsh_frame_qual_update(), xsh_hdrl_remove_crh_single(), xsh_iml_merge_wgt(), 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().
| cpl_mask * xsh_bpm_filter | ( | const cpl_mask * | input_mask, |
| cpl_size | kernel_nx, | ||
| cpl_size | kernel_ny, | ||
| cpl_filter_mode | filter | ||
| ) |
Allows the growing and shrinking of bad pixel masks. It can be used to e.g. set pixels to bad if the pixel is surrounded by other bad pixels.
| input_mask | input mask |
| kernel_nx | size in x-direction of the filtering kernel |
| kernel_ny | size in y-direction of the filtering kernel |
| filter | filter modes as defined in cpl - see below Supported modes: CPL_FILTER_EROSION, CPL_FILTER_DILATION, CPL_FILTER_OPENING, CPL_FILTER_CLOSING |
The returned mask must be deallocated using cpl_mask_delete(). The algorithm assumes, that all pixels outside the mask are good, i.e. it enlarges the mask by the kernel size and marks this border as good. It applies on the enlarged mask the operation and extract the original-size mask at the very end.
Definition at line 178 of file xsh_badpixelmap.c.
References filter.
| void xsh_bpmap_bitwise_to_flag | ( | cpl_image * | bpmap, |
| int | flag | ||
| ) |
Definition at line 359 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 443 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 612 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 531 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 505 of file xsh_badpixelmap.c.
References assure, nx, and ny.
Referenced by verifCr(), and verify_noisy().
| void xsh_bpmap_mask_bad_pixel | ( | cpl_image * | bpmap, |
| cpl_mask * | mask, | ||
| int | flag | ||
| ) |
Definition at line 384 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 429 of file xsh_badpixelmap.c.
Referenced by flag_noisy_pixels(), and xsh_compute_linearity().
| cpl_mask * xsh_code_is_in_qual | ( | cpl_image * | qual, |
| const int | code | ||
| ) |
| cpl_error_code xsh_count_crh | ( | xsh_pre * | pre, |
| xsh_instrument * | instr, | ||
| const int | datancom | ||
| ) |
Definition at line 1367 of file xsh_badpixelmap.c.
References check, xsh_pre::data_header, xsh_pre::nx, xsh_pre::ny, QFLAG_COSMIC_RAY_REMOVED, QFLAG_COSMIC_RAY_UNREMOVED, xsh_pre::qual, size, XSH_ASSURE_NOT_NULL_MSG, xsh_msg, xsh_pfits_set_qc_ncrh(), and xsh_pfits_set_qc_ncrh_mean().
| cpl_error_code xsh_count_satpix | ( | xsh_pre * | pre, |
| xsh_instrument * | instr, | ||
| const int | datancom | ||
| ) |
Definition at line 1403 of file xsh_badpixelmap.c.
References check, xsh_pre::data_header, xsh_pre::nx, xsh_pre::ny, QFLAG_ADC_SATURATION, QFLAG_SATURATED_DATA, xsh_pre::qual, size, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL_MSG, xsh_instrument_get_arm(), xsh_msg, xsh_pfits_set_total_frac_sat(), and xsh_pfits_set_total_nsat().
Referenced by xsh_compute_qc_on_master_bias(), and xsh_create_master_dark2().
|
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 844 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 1256 of file xsh_badpixelmap.c.
|
static |
Definition at line 1288 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 323 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_mdark_get_ron(), xsh_mdark_measure_fpn(), xsh_pre_create(), and xsh_remove_cosmics().
| cpl_image * xsh_image_flag_bptype_with_crox | ( | cpl_image * | ima | ) |
Definition at line 1325 of file xsh_badpixelmap.c.
References check, xsh_free_image(), and xsh_image_coadd().
Referenced by xsh_lingain().
|
static |
Definition at line 895 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 1009 of file xsh_badpixelmap.c.
References check, instrument, 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 1134 of file xsh_badpixelmap.c.
References check, kappa, 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 1195 of file xsh_badpixelmap.c.
References check, kappa, nx, ny, QFLAG_WELL_SATURATION, XSH_BP_MAP_SP, xsh_frame_product(), xsh_instrument_arm_tostring(), and XSH_PRE_DATA_BPP.
| cpl_mask * xsh_qual_to_cpl_mask | ( | cpl_image * | qual, |
| 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 279 of file xsh_badpixelmap.c.
References assure, nx, ny, and size.
Referenced by xsh_hdrl_remove_crh_single(), and xsh_rectify_orders().
| 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 310 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().