Defines | |
#define | RECIPE_ID "xsh_mbias" |
#define | HIST_FACT 2.354820045 |
Functions | |
static cpl_error_code | xsh_compute_ron_mbias (cpl_frameset *raws, xsh_pre *master, cpl_parameterlist *parameters) |
static cpl_error_code | xsh_compute_fpn_mbias (cpl_frameset *raws, xsh_pre *master, xsh_instrument *instrument, cpl_parameterlist *parameters) |
static cpl_error_code | xsh_mbias_get_fpn (const cpl_image *ima, cpl_parameterlist *parameters, double *fpn) |
static cpl_error_code | xsh_my_detmon_ronbias_random (const cpl_imagelist *rawbiases, const cpl_image *masterbias, cpl_propertylist *qclist, const char *method, const int random_sizex, const int random_nsamples) |
static cpl_error_code | xsh_my_detmon_ronbias_histo (const cpl_imagelist *rawbiases, const cpl_image *masterbias, cpl_propertylist *qclist, const char *method) |
static cpl_error_code | xsh_my_detmon_ronbias_region (const cpl_imagelist *rawbiases, const cpl_image *masterbias, cpl_propertylist *qclist, const char *pmethod, const int ref_llx, const int ref_lly, const int ref_urx, const int ref_ury, const int stacking_ks_low, const int stacking_ks_iter) |
static cpl_error_code | xsh_my_detmon_ronbias_preoverscan (const cpl_imagelist *rawbiases, cpl_propertylist *qclist, cpl_image **synthetic, const int prescan_llx, const int prescan_lly, const int prescan_urx, const int prescan_ury, const int overscan_llx, const int overscan_lly, const int overscan_urx, const int overscan_ury, const int stacking_ks_low, const int stacking_ks_iter) |
static double | xsh_mdark_get_contam (xsh_pre *pre, cpl_parameterlist *drs_params, xsh_instrument *instr) |
static void | set_masterdark_qc (xsh_pre *preFrame, xsh_instrument *instrument, cpl_parameterlist *drs_params, cpl_parameterlist *parameters, double exptime, cpl_frame *crh_frm, cpl_frame *bpm_frm) |
cpl_frame * | xsh_create_master_dark (cpl_frame *medFrame, xsh_instrument *instr, cpl_parameterlist *parameters, cpl_parameterlist *drs_params, cpl_frame *crh_frm, cpl_frame *bpm_frm) |
static void | reject_lo_hi (cpl_image *image, double min, double max) |
Reject outlier pixels. | |
static int | count_good (const cpl_image *image) |
static double | get_masterbias_qc_structure_row_region (cpl_image *tima) |
static double | get_masterbias_qc_structure_col_region (cpl_image *tima) |
static void | set_masterbias_qc_uves_structure_region (xsh_pre *master, const int llx, const int lly, const int urx, const int ury, const int ref_x, const int ref_y, const int reg_id, const int dlevel) |
static void | set_masterbias_qc_structure_region (xsh_pre *master, const int llx, const int lly, const int urx, const int ury, const int ref_x, const int ref_y, const int reg_id, const int dlevel) |
static void | set_masterbias_qc_structure (xsh_pre *master, cpl_parameterlist *parameters) |
cpl_frame * | xsh_create_master_bias (cpl_frameset *raws, cpl_frame *frame, xsh_instrument *instr, cpl_parameterlist *parameters) |
Creates a master bias frame. | |
cpl_frame * | xsh_create_master_flat (cpl_frame *frame, xsh_instrument *instr) |
cpl_frame * | xsh_create_master_bpmap (cpl_frame *mdarkFrame, xsh_instrument *instr) |
#define HIST_FACT 2.354820045 |
Definition at line 70 of file xsh_create_master.c.
Referenced by xsh_detmon_ronbias_histo(), and xsh_my_detmon_ronbias_histo().
#define RECIPE_ID "xsh_mbias" |
Definition at line 69 of file xsh_create_master.c.
static int count_good | ( | const cpl_image * | image | ) | [static] |
Definition at line 631 of file xsh_create_master.c.
Referenced by get_masterbias_qc_structure_col_region(), and get_masterbias_qc_structure_row_region().
static double get_masterbias_qc_structure_col_region | ( | cpl_image * | tima | ) | [static] |
Definition at line 683 of file xsh_create_master.c.
References check, count_good(), reject_lo_hi(), xsh_free_image(), and xsh_msg_warning.
Referenced by set_masterbias_qc_uves_structure_region().
static double get_masterbias_qc_structure_row_region | ( | cpl_image * | tima | ) | [static] |
Definition at line 639 of file xsh_create_master.c.
References check, count_good(), reject_lo_hi(), xsh_free_image(), and xsh_msg_warning.
Referenced by set_masterbias_qc_uves_structure_region().
static void reject_lo_hi | ( | cpl_image * | image, | |
double | min, | |||
double | max | |||
) | [static] |
Reject outlier pixels.
image | image with pixels | |
min | reject pixels below this value | |
max | reject pixels abouve this value |
Definition at line 610 of file xsh_create_master.c.
References assure_mem, and xsh_free_mask().
Referenced by get_masterbias_qc_structure_col_region(), and get_masterbias_qc_structure_row_region().
static void set_masterbias_qc_structure | ( | xsh_pre * | master, | |
cpl_parameterlist * | parameters | |||
) | [static] |
Calculates and sets QC parameters: Median, Average, Stdev and Slope, for primary image AND qual.
master | Master Bias Frame (PRE format) | |
parameters | Recipe input parameters |
Definition at line 936 of file xsh_create_master.c.
References check, xsh_pre::data, ref_llx, ref_lly, ref_urx, ref_ury, set_masterbias_qc_structure_region(), and xsh_parameters_debug_level_get().
Referenced by xsh_create_master_bias().
static void set_masterbias_qc_structure_region | ( | xsh_pre * | master, | |
const int | llx, | |||
const int | lly, | |||
const int | urx, | |||
const int | ury, | |||
const int | ref_x, | |||
const int | ref_y, | |||
const int | reg_id, | |||
const int | dlevel | |||
) | [static] |
Calculates and sets QC parameters: Median, Average, Stdev and Slope, for primary image AND qual.
master | Master Bias Frame (PRE format) | |
llx | lower left X | |
lly | lower left Y | |
urx | upper right X | |
ury | upper right Y | |
ref_x | reference X | |
ref_y | reference Y | |
reg_id | region id | |
dlevel | debug level |
Definition at line 902 of file xsh_create_master.c.
References check, and set_masterbias_qc_uves_structure_region().
Referenced by set_masterbias_qc_structure().
static void set_masterbias_qc_uves_structure_region | ( | xsh_pre * | master, | |
const int | llx, | |||
const int | lly, | |||
const int | urx, | |||
const int | ury, | |||
const int | ref_x, | |||
const int | ref_y, | |||
const int | reg_id, | |||
const int | dlevel | |||
) | [static] |
Calculates and sets QC parameters: Median, Average, Stdev and Slope, for primary image AND qual.
master | Master Bias Frame (PRE format) | |
llx | lower left X | |
lly | lower left Y | |
urx | upper right X | |
ury | upper right Y | |
ref_x | reference X | |
ref_y | reference Y | |
reg_id | region id | |
dlevel | debug level |
master | Master Bias Frame (PRE format) | |
llx | lower left X | |
lly | lower left Y | |
urx | upper right X | |
ury | upper right Y | |
ref_x | reference X | |
ref_y | reference Y | |
reg_id | region id | |
dlevel | debug level |
Definition at line 797 of file xsh_create_master.c.
References check, xsh_pre::data, xsh_pre::data_header, get_masterbias_qc_structure_col_region(), get_masterbias_qc_structure_row_region(), xsh_free_image(), xsh_pfits_get_datancom(), xsh_pfits_set_qc_mbiasavg(), xsh_pfits_set_qc_mbiasmed(), xsh_pfits_set_qc_mbiasrms(), xsh_pfits_set_qc_reg1_structx(), xsh_pfits_set_qc_reg1_structy(), xsh_pfits_set_qc_reg2_structx(), xsh_pfits_set_qc_reg2_structy(), and xsh_pre_median_mean_stdev_window().
Referenced by set_masterbias_qc_structure_region().
static void set_masterdark_qc | ( | xsh_pre * | preFrame, | |
xsh_instrument * | instrument, | |||
cpl_parameterlist * | drs_params, | |||
cpl_parameterlist * | parameters, | |||
double | exptime, | |||
cpl_frame * | crh_frm, | |||
cpl_frame * | bpm_frm | |||
) | [static] |
Calculates and sets QC parameters: Median, Average, Stdev and Slope, for primary image AND qual.
preFrame | Master Dark Frame (PRE format) | |
instrument | Pointer to the instrument description structure | |
parameters | parameters of recipe | |
drs_params | parameters specified by DRS setup table | |
crh_frm | CRH frame | |
bpm_frm | BPM frame |
Definition at line 222 of file xsh_create_master.c.
References assure, check, check_msg, xsh_pre::data, xsh_pre::data_header, xsh_pre::nx, nx, xsh_pre::ny, ny, xsh_pre::qual, xsh_pre::qual_header, ref_llx, ref_lly, ref_urx, ref_ury, ron_llx, ron_lly, ron_urx, ron_ury, xsh_free_image(), XSH_GOOD_PIXEL_LEVEL, xsh_mdark_get_contam(), xsh_parameters_get_int(), xsh_pfits_set_qc_contamination(), xsh_pfits_set_qc_fpn(), xsh_pfits_set_qc_mdarkavg(), xsh_pfits_set_qc_mdarkmed(), xsh_pfits_set_qc_mdarkrms(), xsh_pfits_set_qc_norm_fpn(), xsh_pfits_set_qc_norm_fpn_err(), xsh_pre_duplicate(), xsh_pre_free(), xsh_pre_get_nx(), xsh_pre_get_ny(), xsh_pre_median_mean_stdev_window(), and XSH_PRE_QUAL_TYPE.
Referenced by xsh_create_master_dark().
static cpl_error_code xsh_compute_fpn_mbias | ( | cpl_frameset * | raws, | |
xsh_pre * | master, | |||
xsh_instrument * | instrument, | |||
cpl_parameterlist * | parameters | |||
) | [static] |
Definition at line 1321 of file xsh_create_master.c.
References check, xsh_pre::data, xsh_pre::data_header, XSH_ARM_NIR, xsh_fixed_pattern_noise_bias(), xsh_free_image(), xsh_image_get_stdev_clean(), xsh_instrument_get_arm(), xsh_mbias_get_fpn(), xsh_msg, xsh_pfits_set_qc_fpn_master(), and xsh_pfits_set_qc_ron_master().
Referenced by xsh_create_master_bias().
static cpl_error_code xsh_compute_ron_mbias | ( | cpl_frameset * | raws, | |
xsh_pre * | master, | |||
cpl_parameterlist * | parameters | |||
) | [static] |
Definition at line 1204 of file xsh_create_master.c.
References check, xsh_pre::data_header, random_nsamples, random_sizex, ref_llx, ref_lly, ref_urx, ref_ury, ron_method, xsh_compute_ron(), xsh_pfits_set_qc_ron1(), xsh_pfits_set_qc_ron1_err(), xsh_pfits_set_qc_ron2(), and xsh_pfits_set_qc_ron2_err().
Referenced by xsh_create_master_bias().
cpl_frame* xsh_create_master_bias | ( | cpl_frameset * | raws, | |
cpl_frame * | frame, | |||
xsh_instrument * | instr, | |||
cpl_parameterlist * | parameters | |||
) |
Creates a master bias frame.
raws | The raw frames | |
frame | The median frame | |
instr | The instrument containing the arm in use | |
parameters | The instrument recipe parameters |
Definition at line 1018 of file xsh_create_master.c.
References binx, biny, check, xsh_pre::data_header, set_masterbias_qc_structure(), XSH_ASSURE_NOT_NULL, xsh_compute_fpn_mbias(), xsh_compute_ron_mbias(), XSH_GET_TAG_FROM_ARM, xsh_instrument_arm_tostring(), XSH_MASTER_BIAS, xsh_msg, xsh_pfits_get_binx(), xsh_pfits_get_biny(), xsh_pfits_set_pcatg(), xsh_pre_free(), xsh_pre_load(), and xsh_pre_save().
Referenced by main(), and xsh_mbias().
cpl_frame* xsh_create_master_bpmap | ( | cpl_frame * | mdarkFrame, | |
xsh_instrument * | instr | |||
) |
Definition at line 1112 of file xsh_create_master.c.
References check, check_msg, nx, ny, xsh_pre::qual, xsh_pre::qual_header, XSH_ARM_NIR, XSH_ASSURE_NOT_NULL, xsh_frame_product(), XSH_FREE, xsh_free_frame(), XSH_GET_TAG_FROM_ARM, xsh_instrument_arm_tostring(), xsh_instrument_get_arm(), XSH_MASTER_BP_MAP, xsh_pfits_set_qc_bp_map_ntotal(), xsh_pfits_set_qc_multi(), XSH_PRE_DATA_BPP, xsh_pre_free(), xsh_pre_load(), and XSH_QC_BP_MAP_NFLAGi.
Referenced by xsh_mdark().
cpl_frame* xsh_create_master_dark | ( | cpl_frame * | medFrame, | |
xsh_instrument * | instr, | |||
cpl_parameterlist * | parameters, | |||
cpl_parameterlist * | drs_params, | |||
cpl_frame * | crh_frm, | |||
cpl_frame * | bpm_frm | |||
) |
PELIMINARY: Creates a master dark frame from input frame. Input frame is in PRE format: medianFrame, errsFrame, bpmapFrame. Divide median frame by exposure time and calculate QC params.
medFrame | Frame in PRE format | |
instr | instrument containing the arm in use | |
parameters | of the recipe | |
drs_params | parameters specified by DRS setup table | |
crh_frm | CRH frame | |
bpm_frm | BPM frame |
Definition at line 520 of file xsh_create_master.c.
References xsh_instrument::arm, assure, check, check_msg, xsh_pre::data, xsh_pre::data_header, xsh_pre::errs, xsh_pre::errs_header, xsh_pre::exptime, exptime, set_masterdark_qc(), XSH_ARM_NIR, XSH_ASSURE_NOT_NULL, xsh_free_frame(), XSH_GET_TAG_FROM_ARM, xsh_instrument_arm_tostring(), xsh_instrument_get_arm(), XSH_MASTER_DARK, xsh_msg_dbg_high, xsh_pfits_set_exptime(), xsh_pre_free(), xsh_pre_load(), and xsh_pre_save().
Referenced by xsh_mdark().
cpl_frame* xsh_create_master_flat | ( | cpl_frame * | frame, | |
xsh_instrument * | instr | |||
) |
Definition at line 1067 of file xsh_create_master.c.
References check, xsh_pre::data, xsh_pre::data_header, XSH_ASSURE_NOT_NULL, XSH_FREE, XSH_GET_TAG_FROM_LAMP, XSH_MASTER_FLAT, xsh_msg, XSH_NAME_LAMP_MODE_ARM, xsh_pfits_set_pcatg(), xsh_pre_free(), xsh_pre_load(), xsh_pre_normalize(), and xsh_pre_save().
Referenced by xsh_mflat_recipe_main().
static cpl_error_code xsh_mbias_get_fpn | ( | const cpl_image * | ima, | |
cpl_parameterlist * | parameters, | |||
double * | fpn | |||
) | [static] |
Definition at line 1668 of file xsh_create_master.c.
References check, and check_msg.
Referenced by xsh_compute_fpn_mbias().
static double xsh_mdark_get_contam | ( | xsh_pre * | pre, | |
cpl_parameterlist * | drs_params, | |||
xsh_instrument * | instr | |||
) | [static] |
Definition at line 146 of file xsh_create_master.c.
References xsh_pre::binx, xsh_pre::biny, check, xsh_pre::data, XSH_ARM_NIR, XSH_ARM_UVB, XSH_ARM_VIS, xsh_instrument_get_arm(), xsh_parameters_find(), and xsh_parameters_get_int().
Referenced by set_masterdark_qc().
static cpl_error_code xsh_my_detmon_ronbias_histo | ( | const cpl_imagelist * | rawbiases, | |
const cpl_image * | masterbias, | |||
cpl_propertylist * | qclist, | |||
const char * | method | |||
) | [static] |
Definition at line 1461 of file xsh_create_master.c.
References end_skip, HIST_FACT, skip_if, and xsh_detmon_ronbias_histo_reduce().
static cpl_error_code xsh_my_detmon_ronbias_preoverscan | ( | const cpl_imagelist * | rawbiases, | |
cpl_propertylist * | qclist, | |||
cpl_image ** | synthetic, | |||
const int | prescan_llx, | |||
const int | prescan_lly, | |||
const int | prescan_urx, | |||
const int | prescan_ury, | |||
const int | overscan_llx, | |||
const int | overscan_lly, | |||
const int | overscan_urx, | |||
const int | overscan_ury, | |||
const int | stacking_ks_low, | |||
const int | stacking_ks_iter | |||
) | [static] |
Definition at line 1741 of file xsh_create_master.c.
References nx, ny, xsh_detmon_build_synthetic(), and xsh_ksigma_clip().
static cpl_error_code xsh_my_detmon_ronbias_random | ( | const cpl_imagelist * | rawbiases, | |
const cpl_image * | masterbias, | |||
cpl_propertylist * | qclist, | |||
const char * | method, | |||
const int | random_sizex, | |||
const int | random_nsamples | |||
) | [static] |
Definition at line 1384 of file xsh_create_master.c.
References xsh_flux_get_bias_window().
static cpl_error_code xsh_my_detmon_ronbias_region | ( | const cpl_imagelist * | rawbiases, | |
const cpl_image * | masterbias, | |||
cpl_propertylist * | qclist, | |||
const char * | pmethod, | |||
const int | ref_llx, | |||
const int | ref_lly, | |||
const int | ref_urx, | |||
const int | ref_ury, | |||
const int | stacking_ks_low, | |||
const int | stacking_ks_iter | |||
) | [static] |
Definition at line 1562 of file xsh_create_master.c.
References nx, ny, and xsh_ksigma_clip().