#include <complex.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <float.h>
#include <cpl.h>
#include "xsh_detmon.h"
#include "xsh_error.h"
#include "xsh_hist.h"
#include "xsh_irplib_utils.h"
#include "xsh_detmon_body.h"
Go to the source code of this file.
Defines | |
#define | pdist(x1, y1, x2, y2) (((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2))) |
#define | cpl_drand() ((double)rand()/(double)RAND_MAX) |
#define | HIST_FACT 2.354820045 |
#define | NIR TRUE |
#define | OPT FALSE |
#define | insert_par(PARNAME, PARDESC, PARVALUE, PARTYPE) |
#define | CONCAT(a, b) a ## _ ## b |
#define | CONCAT2X(a, b) CONCAT(a,b) |
#define | CPL_TYPE double |
#define | CPL_TYPE float |
#define | CPL_TYPE int |
#define | HORIZONTAL TRUE |
#define | RECT_RON_HS 4 |
#define | RECT_RON_SAMPLES 100 |
Enumerations | |
enum | pixeltypes { HOT = 0, DEAD = 1, NOISY = 2 } |
enum | stackingtypes { MINMAX = 0, MEAN = 1, MEDIAN = 2, KSIGMA = 3 } |
enum | readouts { HORIZONTAL = 1, VERTICAL = 2 } |
Functions | |
static cpl_error_code | xsh_ksigma_clip_double (const double *pi, cpl_binary *pm, int llx, int lly, int urx, int ury, int nx, double var_sum, int npixs, double kappa, int nclip, double tolerance, double *mean, double *stdev) |
static cpl_error_code | xsh_ksigma_clip_float (const float *pi, cpl_binary *pm, int llx, int lly, int urx, int ury, int nx, double var_sum, int npixs, double kappa, int nclip, double tolerance, double *mean, double *stdev) |
static cpl_error_code | xsh_ksigma_clip_int (const int *pi, cpl_binary *pm, int llx, int lly, int urx, int ury, int nx, double var_sum, int npixs, double kappa, int nclip, double tolerance, double *mean, double *stdev) |
static cpl_error_code | xsh_detmon_ronbias_retrieve_parlist (const char *, const char *, const cpl_parameterlist *, cpl_boolean) |
static cpl_error_code | xsh_detmon_ronbias_random (const cpl_imagelist *, const cpl_image *, cpl_propertylist *) |
static cpl_error_code | xsh_detmon_ronbias_histo (const cpl_imagelist *, const cpl_image *, cpl_propertylist *) |
static cpl_error_code | xsh_detmon_ronbias_preoverscan (const cpl_imagelist *, cpl_propertylist *, cpl_image **) |
static cpl_error_code | xsh_detmon_ronbias_region (const cpl_imagelist *, const cpl_image *, cpl_propertylist *) |
static cpl_image * | xsh_detmon_ronbias_master (const cpl_imagelist *, cpl_mask **, cpl_mask **, cpl_mask **, cpl_propertylist *) |
static cpl_error_code | xsh_detmon_ronbias_save (const cpl_parameterlist *, cpl_frameset *, const char *, const char *, const char *, const cpl_propertylist *, const cpl_propertylist *, const cpl_propertylist *, const cpl_propertylist *, const cpl_propertylist *, const cpl_propertylist *, const cpl_propertylist *, const char *, const cpl_image *, const cpl_image *, const cpl_mask *, const cpl_mask *, const cpl_mask *, cpl_propertylist *, const int, const int, cpl_frameset *, int) |
int | xsh_detmon_ronbias_dfs_set_groups (cpl_frameset *, const char *) |
static cpl_error_code | xsh_detmon_ronbias_dutycycl (const cpl_frameset *, cpl_propertylist *) |
cpl_error_code | xsh_detmon_rm_bpixs (cpl_image **, const double, int, int) |
static cpl_bivector * | irplib_bivector_gen_rect_poisson (const int *r, const int np, const int homog) |
cpl_error_code | xsh_detmon_ronbias_check_defaults (const cpl_frameset *, const int whichext) |
int | xsh_detmon_pernoise_dfs_set_groups (cpl_frameset *, const char *) |
static cpl_error_code | xsh_detmon_pernoise_retrieve_parlist (const char *, const char *, const cpl_parameterlist *) |
static cpl_error_code | xsh_detmon_pernoise_qc (cpl_propertylist *, cpl_table *, int) |
static cpl_error_code | xsh_detmon_pernoise_save (const cpl_parameterlist *, cpl_frameset *, const char *, const char *, const char *, const char *, cpl_table **, cpl_propertylist **, const int, const int, const cpl_frameset *) |
cpl_error_code | xsh_detmon_pernoise_rm_bg (cpl_image *, int, int) |
int | xsh_detmon_dark_dfs_set_groups (cpl_frameset *, const char *) |
cpl_error_code | xsh_detmon_dark_dsnu (cpl_frameset *, cpl_imagelist *, cpl_table *, cpl_image *, int pos) |
static cpl_error_code | xsh_detmon_dark_save (const cpl_parameterlist *, cpl_frameset *, const char *, const char *, const char *, const char *, const char *, const char *, cpl_imagelist **, cpl_table **, cpl_imagelist **, cpl_propertylist **, const int, const int, const cpl_frameset *) |
static cpl_error_code | xsh_detmon_retrieve_dark_params (const char *, const char *, const cpl_parameterlist *) |
cpl_error_code | xsh_detmon_dark_qc (cpl_propertylist *, cpl_image *) |
cpl_error_code | xsh_detmon_ronbias_fill_parlist_default (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name) |
cpl_error_code | xsh_detmon_darkron_fill_parlist_default (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name) |
cpl_error_code | xsh_detmon_ronbias_fill_parlist (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name, const char *method, const char *pmethod, const int preoverscan_degree, const int random_nsamples, const int random_sizex, const int random_sizey, const int criteria, const int ref_llx, const int ref_lly, const int ref_urx, const int ref_ury, const char *stacking_method, const int stacking_ks_low, const int stacking_ks_high, const int stacking_ks_iter, const int master_shift_x, const int master_shift_y, const int ron_llx, const int ron_lly, const int ron_urx, const int ron_ury, const int exts, cpl_boolean opt_nir) |
cpl_error_code | xsh_detmon_fill_parlist (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name, int npars,...) |
int | xsh_detmon_retrieve_par_int (const char *parn, const char *pipeline_name, const char *recipe_name, const cpl_parameterlist *parlist) |
double | xsh_detmon_retrieve_par_double (const char *parn, const char *pipeline_name, const char *recipe_name, const cpl_parameterlist *parlist) |
int | xsh_detmon_compare_dits (const cpl_frame *frame1, const cpl_frame *frame2) |
double | irplib_pfits_get_exptime (const cpl_propertylist *plist) |
cpl_error_code | xsh_ksigma_clip (const cpl_image *img, int llx, int lly, int urx, int ury, double kappa, int nclip, double tolerance, double *kmean, double *kstdev) |
Apply kappa-sigma clipping on input image. | |
cpl_error_code | xsh_ksigma_clip_old (const cpl_image *img, int llx, int lly, int urx, int ury, double kappa, int nclip, double tolerance, double *kmean, double *kstdev) |
cpl_error_code | xsh_detmon_ronbias (cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *tag, const char *recipe_name, const char *pipeline_name, const char *pafregexp, const cpl_propertylist *pro_master, const cpl_propertylist *pro_xstr, const cpl_propertylist *pro_ystr, const cpl_propertylist *pro_synth, const cpl_propertylist *pro_bpmhot, const cpl_propertylist *pro_bpmcold, const cpl_propertylist *pro_bpmdev, const char *package, int(*compare)(const cpl_frame *, const cpl_frame *), cpl_boolean opt_nir) |
cpl_error_code | xsh_detmon_ronbias_histo_reduce (const cpl_image *c_raw, double *bias, double *fwhm, double *max) |
cpl_propertylist * | xsh_detmon_fill_prolist (const char *procatg, const char *protype, const char *protech, cpl_boolean proscience) |
cpl_image * | xsh_detmon_build_synthetic (cpl_image *prescan, cpl_image *overscan) |
cpl_table * | xsh_detmon_pernoise_reduce (cpl_image *image) |
cpl_error_code | xsh_flux_get_bias_window (const cpl_image *diff, const int *zone_def, int ron_hsize, int ron_nsamp, double *bias, double *error) |
cpl_error_code | xsh_detmon_pernoise (cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *tag, const char *recipe_name, const char *pipeline_name, const char *procatg_tbl, const char *package, int(*compare)(const cpl_frame *, const cpl_frame *)) |
cpl_error_code | xsh_detmon_fill_pernoise_params (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name, int mode, const char *direction, double speed, int llx, int lly, int urx, int ury, double kappa, int exts) |
int | xsh_detmon_fill_pernoise_params_default (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name) |
cpl_error_code | xsh_detmon_dark (cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *tag, const char *recipe_name, const char *pipeline_name, const char *procatg_master, const char *procatg_dsnu, const char *procatg_tbl, const char *package, int(*compare)(const cpl_frame *, const cpl_frame *)) |
cpl_error_code | xsh_detmon_fill_dark_params (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name, const char *ron_method, const char *dsnu_method, const char *opt_nir, int exts) |
int | xsh_detmon_fill_dark_params_default (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name) |
cpl_image * | irplib_imagelist_collapse_stdev_create (const cpl_imagelist *imlist) |
Collapse an imagelist to the stdev of each pixel position. | |
Variables | |
struct { | |
const char * method | |
const char * pmethod | |
irplib_ronbias_method method_bitmask | |
int prescan_llx | |
int prescan_lly | |
int prescan_urx | |
int prescan_ury | |
int overscan_llx | |
int overscan_lly | |
int overscan_urx | |
int overscan_ury | |
int preoverscan_degree | |
int random_nsamples | |
int random_sizex | |
int random_sizey | |
int criteria | |
int ref_llx | |
int ref_lly | |
int ref_urx | |
int ref_ury | |
const char * stacking_method | |
int stacking_ks_low | |
int stacking_ks_high | |
int stacking_ks_iter | |
int master_shift_x | |
int master_shift_y | |
int ron_llx | |
int ron_lly | |
int ron_urx | |
int ron_ury | |
int exts | |
int nb_extensions | |
} | detmon_ronbias_config |
struct { | |
int mode | |
cpl_boolean direction | |
double speed | |
int llx | |
int lly | |
int urx | |
int ury | |
int kappa | |
int exts | |
int nb_extensions | |
} | detmon_pernoise_config |
struct { | |
const char * ron_method | |
const char * dsnu_method | |
int exts | |
int nb_extensions | |
cpl_boolean opt_nir | |
} | detmon_dark_config |
#define CONCAT | ( | a, | |||
b | ) | a ## _ ## b |
Definition at line 1384 of file xsh_detmon.c.
#define CONCAT2X | ( | a, | |||
b | ) | CONCAT(a,b) |
Definition at line 1385 of file xsh_detmon.c.
#define cpl_drand | ( | ) | ((double)rand()/(double)RAND_MAX) |
Definition at line 55 of file xsh_detmon.c.
Referenced by irplib_bivector_gen_rect_poisson().
#define CPL_TYPE int |
Definition at line 1395 of file xsh_detmon.c.
#define CPL_TYPE float |
Definition at line 1395 of file xsh_detmon.c.
#define CPL_TYPE double |
Definition at line 1395 of file xsh_detmon.c.
Referenced by irplib_fit_imagelist_polynomial(), irplib_fit_imagelist_residual(), and xsh_imagelist_collapse_sigclip_iter_create().
#define HIST_FACT 2.354820045 |
Definition at line 70 of file xsh_detmon.c.
#define HORIZONTAL TRUE |
Definition at line 3051 of file xsh_detmon.c.
Referenced by xsh_detmon_pernoise_reduce().
#define insert_par | ( | PARNAME, | |||
PARDESC, | |||||
PARVALUE, | |||||
PARTYPE | ) |
do { \ char * par_name = cpl_sprintf("%s.%s", group_name, PARNAME); \ cpl_parameter * p; \ assert(par_name != NULL); \ p = cpl_parameter_new_value(par_name, PARTYPE, \ PARDESC, group_name, PARVALUE); \ cpl_parameter_set_alias(p, CPL_PARAMETER_MODE_CLI, PARNAME); \ cpl_parameter_disable(p, CPL_PARAMETER_MODE_ENV); \ cpl_parameterlist_append(parlist, p); \ cpl_free(par_name); \ } while(0);
Referenced by xsh_detmon_fill_parlist().
#define NIR TRUE |
Definition at line 154 of file xsh_detmon.c.
#define OPT FALSE |
Definition at line 155 of file xsh_detmon.c.
#define pdist | ( | x1, | |||
y1, | |||||
x2, | |||||
y2 | ) | (((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2))) |
Definition at line 53 of file xsh_detmon.c.
Referenced by irplib_bivector_gen_rect_poisson().
#define RECT_RON_HS 4 |
Definition at line 3286 of file xsh_detmon.c.
Referenced by xsh_flux_get_bias_window().
#define RECT_RON_SAMPLES 100 |
Definition at line 3287 of file xsh_detmon.c.
Referenced by xsh_flux_get_bias_window().
enum pixeltypes |
Definition at line 72 of file xsh_detmon.c.
enum readouts |
Definition at line 87 of file xsh_detmon.c.
enum stackingtypes |
Definition at line 79 of file xsh_detmon.c.
static cpl_bivector * irplib_bivector_gen_rect_poisson | ( | const int * | r, | |
const int | np, | |||
const int | homog | |||
) | [static] |
Definition at line 3391 of file xsh_detmon.c.
References cpl_drand, and pdist.
Referenced by xsh_flux_get_bias_window().
cpl_image* irplib_imagelist_collapse_stdev_create | ( | const cpl_imagelist * | imlist | ) |
Collapse an imagelist to the stdev of each pixel position.
imlist | the input images list |
The returned image has to be deallocated with cpl_image_delete().
The bad pixel maps of the images in the input list are taken into account, the result image pixels are flagged as rejected for those where there were no good pixel at the same position in the input image list.
Possible _cpl_error_code_ set in this function:
Definition at line 5144 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_master().
double irplib_pfits_get_exptime | ( | const cpl_propertylist * | plist | ) |
Definition at line 886 of file xsh_detmon.c.
References exptime.
Referenced by xsh_detmon_compare_dits(), xsh_detmon_dark_dsnu(), and xsh_detmon_lg_reduce_dit().
cpl_image* xsh_detmon_build_synthetic | ( | cpl_image * | prescan, | |
cpl_image * | overscan | |||
) |
Definition at line 2878 of file xsh_detmon.c.
References detmon_ronbias_config, gauss_res::mse, x, and y.
Referenced by xsh_detmon_ronbias_preoverscan().
int xsh_detmon_compare_dits | ( | const cpl_frame * | frame1, | |
const cpl_frame * | frame2 | |||
) |
Definition at line 825 of file xsh_detmon.c.
References irplib_pfits_get_exptime().
Referenced by xsh_detmon_dark().
cpl_error_code xsh_detmon_dark | ( | cpl_frameset * | frameset, | |
const cpl_parameterlist * | parlist, | |||
const char * | tag, | |||
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | procatg_master, | |||
const char * | procatg_dsnu, | |||
const char * | procatg_tbl, | |||
const char * | package, | |||
int(*)(const cpl_frame *, const cpl_frame *) | compare | |||
) |
Definition at line 4342 of file xsh_detmon.c.
References detmon_dark_config, nb_extensions, OPT, xsh_detmon_compare_dits(), xsh_detmon_dark_dfs_set_groups(), xsh_detmon_dark_dsnu(), xsh_detmon_dark_qc(), xsh_detmon_dark_save(), and xsh_detmon_retrieve_dark_params().
int xsh_detmon_dark_dfs_set_groups | ( | cpl_frameset * | set, | |
const char * | tag | |||
) |
Definition at line 4547 of file xsh_detmon.c.
Referenced by xsh_detmon_dark().
cpl_error_code xsh_detmon_dark_dsnu | ( | cpl_frameset * | cur_fdit, | |
cpl_imagelist * | dsnu, | |||
cpl_table * | dsnu_table, | |||
cpl_image * | collapsed, | |||
int | pos | |||
) |
Definition at line 4713 of file xsh_detmon.c.
References first, and irplib_pfits_get_exptime().
Referenced by xsh_detmon_dark().
cpl_error_code xsh_detmon_dark_qc | ( | cpl_propertylist * | qclist, | |
cpl_image * | collapsed | |||
) |
Definition at line 5103 of file xsh_detmon.c.
References DETMON_QC_DARK, DETMON_QC_DARK_C, DETMON_QC_DARK_STDEV, and DETMON_QC_DARK_STDEV_C.
Referenced by xsh_detmon_dark().
static cpl_error_code xsh_detmon_dark_save | ( | const cpl_parameterlist * | parlist, | |
cpl_frameset * | frameset, | |||
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | procatg_master, | |||
const char * | procatg_tbl, | |||
const char * | procatg_dsnu, | |||
const char * | package, | |||
cpl_imagelist ** | masters, | |||
cpl_table ** | dsnu_table, | |||
cpl_imagelist ** | dsnu, | |||
cpl_propertylist ** | qclist, | |||
const int | flag_sets, | |||
const int | which_set, | |||
const cpl_frameset * | usedframes | |||
) | [static] |
Definition at line 4754 of file xsh_detmon.c.
References detmon_dark_config, and OPT.
Referenced by xsh_detmon_dark().
cpl_error_code xsh_detmon_darkron_fill_parlist_default | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name | |||
) |
Definition at line 437 of file xsh_detmon.c.
References NIR, and xsh_detmon_ronbias_fill_parlist().
cpl_error_code xsh_detmon_fill_dark_params | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | ron_method, | |||
const char * | dsnu_method, | |||
const char * | opt_nir, | |||
int | exts | |||
) |
Definition at line 4645 of file xsh_detmon.c.
References xsh_detmon_fill_parlist().
Referenced by xsh_detmon_fill_dark_params_default().
int xsh_detmon_fill_dark_params_default | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name | |||
) |
Definition at line 4689 of file xsh_detmon.c.
References xsh_detmon_fill_dark_params().
cpl_error_code xsh_detmon_fill_parlist | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
int | npars, | |||
... | ||||
) |
Definition at line 686 of file xsh_detmon.c.
References insert_par.
Referenced by xsh_detmon_fill_dark_params(), xsh_detmon_fill_pernoise_params(), xsh_detmon_lg_fill_parlist(), and xsh_detmon_ronbias_fill_parlist().
cpl_error_code xsh_detmon_fill_pernoise_params | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
int | mode, | |||
const char * | direction, | |||
double | speed, | |||
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
double | kappa, | |||
int | exts | |||
) |
Definition at line 3758 of file xsh_detmon.c.
References xsh_detmon_fill_parlist().
Referenced by xsh_detmon_fill_pernoise_params_default().
int xsh_detmon_fill_pernoise_params_default | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name | |||
) |
Definition at line 3825 of file xsh_detmon.c.
References xsh_detmon_fill_pernoise_params().
cpl_propertylist* xsh_detmon_fill_prolist | ( | const char * | procatg, | |
const char * | protype, | |||
const char * | protech, | |||
cpl_boolean | proscience | |||
) |
Definition at line 2806 of file xsh_detmon.c.
Referenced by xsh_lingain().
cpl_error_code xsh_detmon_pernoise | ( | cpl_frameset * | frameset, | |
const cpl_parameterlist * | parlist, | |||
const char * | tag, | |||
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | procatg_tbl, | |||
const char * | package, | |||
int(*)(const cpl_frame *, const cpl_frame *) | compare | |||
) |
Definition at line 3521 of file xsh_detmon.c.
References detmon_pernoise_config, nb_extensions, nx, ny, xsh_detmon_pernoise_dfs_set_groups(), xsh_detmon_pernoise_qc(), xsh_detmon_pernoise_reduce(), xsh_detmon_pernoise_retrieve_parlist(), and xsh_detmon_pernoise_save().
int xsh_detmon_pernoise_dfs_set_groups | ( | cpl_frameset * | set, | |
const char * | tag | |||
) |
Definition at line 3715 of file xsh_detmon.c.
Referenced by xsh_detmon_pernoise().
static cpl_error_code xsh_detmon_pernoise_qc | ( | cpl_propertylist * | qclist, | |
cpl_table * | table, | |||
int | iquad | |||
) | [static] |
Definition at line 4113 of file xsh_detmon.c.
References detmon_pernoise_config, DETMON_QC_FREQ_C, and DETMON_QC_POW_C.
Referenced by xsh_detmon_pernoise().
cpl_table* xsh_detmon_pernoise_reduce | ( | cpl_image * | image | ) |
Definition at line 3054 of file xsh_detmon.c.
References detmon_pernoise_config, HORIZONTAL, and xsh_detmon_pernoise_rm_bg().
Referenced by xsh_detmon_pernoise().
static cpl_error_code xsh_detmon_pernoise_retrieve_parlist | ( | const char * | pipeline_name, | |
const char * | recipe_name, | |||
const cpl_parameterlist * | parlist | |||
) | [static] |
Definition at line 3846 of file xsh_detmon.c.
References detmon_pernoise_config, xsh_detmon_retrieve_par_double(), and xsh_detmon_retrieve_par_int().
Referenced by xsh_detmon_pernoise().
cpl_error_code xsh_detmon_pernoise_rm_bg | ( | cpl_image * | image, | |
int | nsamples, | |||
int | nffts | |||
) |
Definition at line 4260 of file xsh_detmon.c.
References degree, and gauss_res::mse.
Referenced by xsh_detmon_pernoise_reduce().
static cpl_error_code xsh_detmon_pernoise_save | ( | const cpl_parameterlist * | parlist, | |
cpl_frameset * | frameset, | |||
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | procatg_tbl, | |||
const char * | package, | |||
cpl_table ** | freq_table, | |||
cpl_propertylist ** | qclist, | |||
const int | flag_sets, | |||
const int | which_set, | |||
const cpl_frameset * | usedframes | |||
) | [static] |
Definition at line 3919 of file xsh_detmon.c.
References detmon_pernoise_config.
Referenced by xsh_detmon_pernoise().
static cpl_error_code xsh_detmon_retrieve_dark_params | ( | const char * | pipeline_name, | |
const char * | recipe_name, | |||
const cpl_parameterlist * | parlist | |||
) | [static] |
Definition at line 4590 of file xsh_detmon.c.
References detmon_dark_config, and xsh_detmon_retrieve_par_int().
Referenced by xsh_detmon_dark().
double xsh_detmon_retrieve_par_double | ( | const char * | parn, | |
const char * | pipeline_name, | |||
const char * | recipe_name, | |||
const cpl_parameterlist * | parlist | |||
) |
Definition at line 795 of file xsh_detmon.c.
Referenced by xsh_detmon_lg_retrieve_parlist(), and xsh_detmon_pernoise_retrieve_parlist().
int xsh_detmon_retrieve_par_int | ( | const char * | parn, | |
const char * | pipeline_name, | |||
const char * | recipe_name, | |||
const cpl_parameterlist * | parlist | |||
) |
Definition at line 765 of file xsh_detmon.c.
Referenced by xsh_detmon_lg_retrieve_parlist(), xsh_detmon_pernoise_retrieve_parlist(), xsh_detmon_retrieve_dark_params(), and xsh_detmon_ronbias_retrieve_parlist().
cpl_error_code xsh_detmon_rm_bpixs | ( | cpl_image ** | image, | |
const double | kappa, | |||
int | nffts, | |||
int | nsamples | |||
) |
Definition at line 3226 of file xsh_detmon.c.
cpl_error_code xsh_detmon_ronbias | ( | cpl_frameset * | frameset, | |
const cpl_parameterlist * | parlist, | |||
const char * | tag, | |||
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | pafregexp, | |||
const cpl_propertylist * | pro_master, | |||
const cpl_propertylist * | pro_xstr, | |||
const cpl_propertylist * | pro_ystr, | |||
const cpl_propertylist * | pro_synth, | |||
const cpl_propertylist * | pro_bpmhot, | |||
const cpl_propertylist * | pro_bpmcold, | |||
const cpl_propertylist * | pro_bpmdev, | |||
const char * | package, | |||
int(*)(const cpl_frame *, const cpl_frame *) | compare, | |||
cpl_boolean | opt_nir | |||
) |
Definition at line 1411 of file xsh_detmon.c.
References detmon_ronbias_config, end_skip, HISTO, PREOVERSCAN, RANDOM, REGION, skip_if, xsh_detmon_ronbias_check_defaults(), xsh_detmon_ronbias_dfs_set_groups(), xsh_detmon_ronbias_dutycycl(), xsh_detmon_ronbias_histo(), xsh_detmon_ronbias_master(), xsh_detmon_ronbias_preoverscan(), xsh_detmon_ronbias_random(), xsh_detmon_ronbias_region(), xsh_detmon_ronbias_retrieve_parlist(), and xsh_detmon_ronbias_save().
cpl_error_code xsh_detmon_ronbias_check_defaults | ( | const cpl_frameset * | set, | |
const int | whichext | |||
) |
Definition at line 1081 of file xsh_detmon.c.
References detmon_ronbias_config, nx, ny, and PREOVERSCAN.
Referenced by xsh_detmon_ronbias().
int xsh_detmon_ronbias_dfs_set_groups | ( | cpl_frameset * | set, | |
const char * | tag | |||
) |
Definition at line 2835 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias().
static cpl_error_code xsh_detmon_ronbias_dutycycl | ( | const cpl_frameset * | frameset, | |
cpl_propertylist * | qclist | |||
) | [static] |
Definition at line 2998 of file xsh_detmon.c.
References DETMON_QC_DUTYCYCL, DETMON_QC_DUTYCYCL_C, first, and last.
Referenced by xsh_detmon_ronbias().
cpl_error_code xsh_detmon_ronbias_fill_parlist | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | method, | |||
const char * | pmethod, | |||
const int | preoverscan_degree, | |||
const int | random_nsamples, | |||
const int | random_sizex, | |||
const int | random_sizey, | |||
const int | criteria, | |||
const int | ref_llx, | |||
const int | ref_lly, | |||
const int | ref_urx, | |||
const int | ref_ury, | |||
const char * | stacking_method, | |||
const int | stacking_ks_low, | |||
const int | stacking_ks_high, | |||
const int | stacking_ks_iter, | |||
const int | master_shift_x, | |||
const int | master_shift_y, | |||
const int | ron_llx, | |||
const int | ron_lly, | |||
const int | ron_urx, | |||
const int | ron_ury, | |||
const int | exts, | |||
cpl_boolean | opt_nir | |||
) |
Definition at line 510 of file xsh_detmon.c.
References OPT, and xsh_detmon_fill_parlist().
Referenced by xsh_detmon_darkron_fill_parlist_default(), and xsh_detmon_ronbias_fill_parlist_default().
cpl_error_code xsh_detmon_ronbias_fill_parlist_default | ( | cpl_parameterlist * | parlist, | |
const char * | recipe_name, | |||
const char * | pipeline_name | |||
) |
Definition at line 387 of file xsh_detmon.c.
References OPT, and xsh_detmon_ronbias_fill_parlist().
static cpl_error_code xsh_detmon_ronbias_histo | ( | const cpl_imagelist * | rawbiases, | |
const cpl_image * | masterbias, | |||
cpl_propertylist * | qclist | |||
) | [static] |
Definition at line 1760 of file xsh_detmon.c.
References DETMON_QC_BIAS_HISTO_RON, DETMON_QC_BIAS_HISTO_RON_C, DETMON_QC_BIAS_HISTO_VAL, DETMON_QC_BIAS_HISTO_VAL_C, detmon_ronbias_config, end_skip, HIST_FACT, skip_if, and xsh_detmon_ronbias_histo_reduce().
Referenced by xsh_detmon_ronbias().
cpl_error_code xsh_detmon_ronbias_histo_reduce | ( | const cpl_image * | c_raw, | |
double * | bias, | |||
double * | fwhm, | |||
double * | max | |||
) |
Definition at line 1838 of file xsh_detmon.c.
References xsh_hist_delete(), xsh_hist_fill(), xsh_hist_get_bin_size(), xsh_hist_get_max(), xsh_hist_get_nbins(), xsh_hist_get_start(), xsh_hist_get_value(), and xsh_hist_new().
Referenced by xsh_detmon_ronbias_histo().
static cpl_image * xsh_detmon_ronbias_master | ( | const cpl_imagelist * | rawbiases, | |
cpl_mask ** | bpmhot, | |||
cpl_mask ** | bpmcold, | |||
cpl_mask ** | bpmdev, | |||
cpl_propertylist * | qclist | |||
) | [static] |
Definition at line 2289 of file xsh_detmon.c.
References DETMON_QC_MASTER_MEAN, DETMON_QC_MASTER_MEAN_C, DETMON_QC_MASTER_RMS, DETMON_QC_MASTER_RMS_C, DETMON_QC_NBCOLDPIX, DETMON_QC_NBCOLDPIX_C, DETMON_QC_NBDEVPIX, DETMON_QC_NBDEVPIX_C, DETMON_QC_NBHOTPIX, DETMON_QC_NBHOTPIX_C, detmon_ronbias_config, end_skip, irplib_check, irplib_imagelist_collapse_stdev_create(), irplib_isnan(), skip_if, stacking_ks_iter, stacking_ks_low, and xsh_ksigma_clip().
Referenced by xsh_detmon_ronbias().
static cpl_error_code xsh_detmon_ronbias_preoverscan | ( | const cpl_imagelist * | rawbiases, | |
cpl_propertylist * | qclist, | |||
cpl_image ** | synthetic | |||
) | [static] |
Definition at line 1945 of file xsh_detmon.c.
References DETMON_QC_BIAS_OVERSCAN_MEAN, DETMON_QC_BIAS_OVERSCAN_MEAN_C, DETMON_QC_BIAS_OVERSCAN_MED, DETMON_QC_BIAS_OVERSCAN_MED_C, DETMON_QC_BIAS_OVERSCAN_RON, DETMON_QC_BIAS_OVERSCAN_RON_C, DETMON_QC_BIAS_PRESCAN_MEAN, DETMON_QC_BIAS_PRESCAN_MEAN_C, DETMON_QC_BIAS_PRESCAN_MED, DETMON_QC_BIAS_PRESCAN_MED_C, DETMON_QC_BIAS_PRESCAN_RON, DETMON_QC_BIAS_PRESCAN_RON_C, detmon_ronbias_config, nx, ny, overscan_llx, overscan_lly, overscan_urx, overscan_ury, prescan_llx, prescan_lly, prescan_urx, prescan_ury, stacking_ks_iter, stacking_ks_low, xsh_detmon_build_synthetic(), and xsh_ksigma_clip().
Referenced by xsh_detmon_ronbias().
static cpl_error_code xsh_detmon_ronbias_random | ( | const cpl_imagelist * | rawbiases, | |
const cpl_image * | masterbias, | |||
cpl_propertylist * | qclist | |||
) | [static] |
Definition at line 1654 of file xsh_detmon.c.
References DETMON_QC_BIAS_RANDOM_RON, DETMON_QC_BIAS_RANDOM_RON_C, DETMON_QC_BIAS_RANDOM_VAL, DETMON_QC_BIAS_RANDOM_VAL_C, detmon_ronbias_config, end_skip, skip_if, and xsh_flux_get_bias_window().
Referenced by xsh_detmon_ronbias().
static cpl_error_code xsh_detmon_ronbias_region | ( | const cpl_imagelist * | rawbiases, | |
const cpl_image * | masterbias, | |||
cpl_propertylist * | qclist | |||
) | [static] |
Definition at line 2171 of file xsh_detmon.c.
References DETMON_QC_BIAS_REGION_MED, DETMON_QC_BIAS_REGION_MED_C, DETMON_QC_BIAS_REGION_RON, DETMON_QC_BIAS_REGION_RON_C, DETMON_QC_BIAS_REGION_VAL, DETMON_QC_BIAS_REGION_VAL_C, detmon_ronbias_config, nx, ny, stacking_ks_iter, stacking_ks_low, and xsh_ksigma_clip().
Referenced by xsh_detmon_ronbias().
static cpl_error_code xsh_detmon_ronbias_retrieve_parlist | ( | const char * | pipeline_name, | |
const char * | recipe_name, | |||
const cpl_parameterlist * | parlist, | |||
cpl_boolean | opt_nir | |||
) | [static] |
Definition at line 908 of file xsh_detmon.c.
References detmon_ronbias_config, HISTO, NIR, OPT, PREOVERSCAN, RANDOM, REGION, and xsh_detmon_retrieve_par_int().
Referenced by xsh_detmon_ronbias().
static cpl_error_code xsh_detmon_ronbias_save | ( | const cpl_parameterlist * | parlist, | |
cpl_frameset * | frameset, | |||
const char * | recipe_name, | |||
const char * | pipeline_name, | |||
const char * | pafregexp, | |||
const cpl_propertylist * | pro_master, | |||
const cpl_propertylist * | pro_xstr, | |||
const cpl_propertylist * | pro_ystr, | |||
const cpl_propertylist * | pro_synth, | |||
const cpl_propertylist * | pro_bpmhot, | |||
const cpl_propertylist * | pro_bpmcold, | |||
const cpl_propertylist * | pro_bpmdev, | |||
const char * | package, | |||
const cpl_image * | masterbias, | |||
const cpl_image * | synthetic, | |||
const cpl_mask * | bpmhot, | |||
const cpl_mask * | bpmcold, | |||
const cpl_mask * | bpmdev, | |||
cpl_propertylist * | qclist, | |||
const int | flag_sets, | |||
const int | which_set, | |||
cpl_frameset * | usedframes, | |||
int | whichext | |||
) | [static] |
Definition at line 2427 of file xsh_detmon.c.
References detmon_ronbias_config, end_skip, PREOVERSCAN, and skip_if.
Referenced by xsh_detmon_ronbias().
cpl_error_code xsh_flux_get_bias_window | ( | const cpl_image * | diff, | |
const int * | zone_def, | |||
int | ron_hsize, | |||
int | ron_nsamp, | |||
double * | bias, | |||
double * | error | |||
) |
Definition at line 3301 of file xsh_detmon.c.
References irplib_bivector_gen_rect_poisson(), RECT_RON_HS, and RECT_RON_SAMPLES.
Referenced by xsh_detmon_ronbias_random().
cpl_error_code xsh_ksigma_clip | ( | const cpl_image * | img, | |
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
double | kappa, | |||
int | nclip, | |||
double | tolerance, | |||
double * | kmean, | |||
double * | kstdev | |||
) |
Apply kappa-sigma clipping on input image.
img | Input image | |
llx | Lower left x position (FITS convention) | |
lly | Lower left y position (FITS convention) | |
urx | Upper right x position (FITS convention) | |
ury | Upper right y position (FITS convention) | |
kappa | Kappa value for the clipping | |
nclip | Number of clipping iterations | |
kmean | Mean after clipping (output) | |
kstdev | Stdev after clipping (output) |
This function applies an iterative kappa-sigma clipping on the image and returns mean and stdev after the clipping.
The function takes as a starting point the "standard" values of mean and stdev from cpl_stats.
On each iteration, the contribution of pixels outside the range [mean - kappa * stdev, mean + kappa * stdev] is removed, the values of mean and stdev are updated, and so are the limits of the range to be used in the next iteration as well.
The algorithm stops after nclip iterations or when the variation of the range between two consecutive iterations is smaller (absolute value) than the tolerance.
The effectiveness of this function resides on the way the update of the values of mean and stdev is done.
The contribution of a single pixel in variance can be removed as follows:
{i=1}^{N-1} (x_i - {x}_{n-1})^2 = {i=1}^ N (x_i - {x}_n )^2 - {N}{N-1} \,( \, {x}_n - x_{n} )^2
For further details on the mathematical aspects, please refer to DFS05126.
Possible _cpl_error_code_ set in this function:
The values of kmean and kstdev is undefined on error.
Definition at line 1219 of file xsh_detmon.c.
Referenced by xsh_detmon_gain_table_fill_row(), xsh_detmon_ronbias_master(), xsh_detmon_ronbias_preoverscan(), xsh_detmon_ronbias_region(), xsh_image_get_hot_cold_maps(), and xsh_irplib_imagelist_get_clean_mean_levels().
static cpl_error_code xsh_ksigma_clip_double | ( | const double * | pi, | |
cpl_binary * | pm, | |||
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
int | nx, | |||
double | var_sum, | |||
int | npixs, | |||
double | kappa, | |||
int | nclip, | |||
double | tolerance, | |||
double * | mean, | |||
double * | stdev | |||
) | [static] |
Referenced by xsh_ksigma_clip_old().
static cpl_error_code xsh_ksigma_clip_float | ( | const float * | pi, | |
cpl_binary * | pm, | |||
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
int | nx, | |||
double | var_sum, | |||
int | npixs, | |||
double | kappa, | |||
int | nclip, | |||
double | tolerance, | |||
double * | mean, | |||
double * | stdev | |||
) | [static] |
Referenced by xsh_ksigma_clip_old().
static cpl_error_code xsh_ksigma_clip_int | ( | const int * | pi, | |
cpl_binary * | pm, | |||
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
int | nx, | |||
double | var_sum, | |||
int | npixs, | |||
double | kappa, | |||
int | nclip, | |||
double | tolerance, | |||
double * | mean, | |||
double * | stdev | |||
) | [static] |
Referenced by xsh_ksigma_clip_old().
cpl_error_code xsh_ksigma_clip_old | ( | const cpl_image * | img, | |
int | llx, | |||
int | lly, | |||
int | urx, | |||
int | ury, | |||
double | kappa, | |||
int | nclip, | |||
double | tolerance, | |||
double * | kmean, | |||
double * | kstdev | |||
) |
Definition at line 1302 of file xsh_detmon.c.
References end_skip, nx, ny, skip_if, xsh_ksigma_clip_double(), xsh_ksigma_clip_float(), and xsh_ksigma_clip_int().
int criteria |
Definition at line 112 of file xsh_detmon.c.
struct { ... } detmon_dark_config [static] |
Referenced by xsh_detmon_dark(), xsh_detmon_dark_save(), and xsh_detmon_retrieve_dark_params().
struct { ... } detmon_pernoise_config [static] |
struct { ... } detmon_ronbias_config [static] |
Referenced by xsh_detmon_build_synthetic(), xsh_detmon_ronbias(), xsh_detmon_ronbias_check_defaults(), xsh_detmon_ronbias_histo(), xsh_detmon_ronbias_master(), xsh_detmon_ronbias_preoverscan(), xsh_detmon_ronbias_random(), xsh_detmon_ronbias_region(), xsh_detmon_ronbias_retrieve_parlist(), and xsh_detmon_ronbias_save().
cpl_boolean direction |
Definition at line 134 of file xsh_detmon.c.
const char* dsnu_method |
Definition at line 148 of file xsh_detmon.c.
int exts |
Definition at line 127 of file xsh_detmon.c.
int kappa |
Definition at line 140 of file xsh_detmon.c.
Referenced by xsh_background_poly(), xsh_cfg_recover_measure_tab_xy_peaks(), xsh_create_master_dark2(), xsh_gain(), xsh_image_get_stdev_clean(), xsh_image_mflat_detect_blemishes(), xsh_ksigma_clip(), xsh_localize_obj_auto(), xsh_opt_extract_orders(), xsh_pre_median_mean_stdev_window(), and xsh_utils_efficiency_internal().
int llx |
Definition at line 136 of file xsh_detmon.c.
Referenced by xsh_combine_flats(), xsh_compute_flat_edges(), xsh_cube_qc_trace_window(), xsh_gain(), xsh_get_master_dark_nir_via_noise(), xsh_ifu_trace_object_calibrate(), xsh_image_find_barycenter(), xsh_image_qc_trace_window(), xsh_ksigma_clip(), and xsh_util_ronbias().
int lly |
Definition at line 137 of file xsh_detmon.c.
Referenced by xsh_combine_flats(), xsh_gain(), xsh_get_master_dark_nir_via_noise(), xsh_ifu_trace_object_calibrate(), xsh_image_find_barycenter(), xsh_image_qc_trace_window(), xsh_ksigma_clip(), and xsh_util_ronbias().
int master_shift_x |
Definition at line 121 of file xsh_detmon.c.
int master_shift_y |
Definition at line 122 of file xsh_detmon.c.
const char* method |
Definition at line 97 of file xsh_detmon.c.
Referenced by xsh_build_ifu_cube(), xsh_cfg_recover_last_step(), xsh_detect_order_edge(), xsh_detmon_gain(), xsh_geom_ifu(), and xsh_util_ifu_build_cube().
Definition at line 99 of file xsh_detmon.c.
int mode |
Definition at line 133 of file xsh_detmon.c.
Referenced by HandleOptions(), main(), xsh_detmon_lg_reduce_all(), xsh_detmon_lg_reduce_dit(), xsh_gain(), xsh_instrument_parse_tag(), xsh_model_maps_create(), xsh_opt_extract_orders(), xsh_rec_list_save(), xsh_rec_list_save2(), xsh_rec_list_save_table(), xsh_shift_tab_create(), and xsh_shift_tab_load().
int nb_extensions |
Definition at line 128 of file xsh_detmon.c.
Referenced by xsh_detmon_dark(), and xsh_detmon_pernoise().
cpl_boolean opt_nir |
Definition at line 151 of file xsh_detmon.c.
Referenced by xsh_detmon_gain(), xsh_detmon_lg_split_onoff(), and xsh_detmon_lin().
int overscan_llx |
Definition at line 104 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int overscan_lly |
Definition at line 105 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int overscan_urx |
Definition at line 106 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int overscan_ury |
Definition at line 107 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
const char* pmethod |
Definition at line 98 of file xsh_detmon.c.
Definition at line 108 of file xsh_detmon.c.
int prescan_llx |
Definition at line 100 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int prescan_lly |
Definition at line 101 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int prescan_urx |
Definition at line 102 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int prescan_ury |
Definition at line 103 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_preoverscan().
int random_nsamples |
Definition at line 109 of file xsh_detmon.c.
Referenced by xsh_compute_ron_mbias().
int random_sizex |
Definition at line 110 of file xsh_detmon.c.
Referenced by xsh_compute_ron_mbias().
int random_sizey |
Definition at line 111 of file xsh_detmon.c.
int ref_llx |
Definition at line 113 of file xsh_detmon.c.
Referenced by set_masterbias_qc_structure(), xsh_compute_ron_mbias(), and xsh_mdark_get_median_stdev().
int ref_lly |
Definition at line 114 of file xsh_detmon.c.
Referenced by set_masterbias_qc_structure(), xsh_compute_ron_mbias(), and xsh_mdark_get_median_stdev().
int ref_urx |
Definition at line 115 of file xsh_detmon.c.
Referenced by set_masterbias_qc_structure(), xsh_compute_ron_mbias(), and xsh_mdark_get_median_stdev().
int ref_ury |
Definition at line 116 of file xsh_detmon.c.
Referenced by set_masterbias_qc_structure(), xsh_compute_ron_mbias(), and xsh_mdark_get_median_stdev().
int ron_llx |
Definition at line 123 of file xsh_detmon.c.
Referenced by xsh_mdark_measure_ron().
int ron_lly |
Definition at line 124 of file xsh_detmon.c.
Referenced by xsh_mdark_measure_ron().
const char* ron_method |
Definition at line 147 of file xsh_detmon.c.
int ron_urx |
Definition at line 125 of file xsh_detmon.c.
Referenced by xsh_mdark_measure_ron().
int ron_ury |
Definition at line 126 of file xsh_detmon.c.
Referenced by xsh_mdark_measure_ron().
double speed |
Definition at line 135 of file xsh_detmon.c.
int stacking_ks_high |
Definition at line 119 of file xsh_detmon.c.
int stacking_ks_iter |
Definition at line 120 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_master(), xsh_detmon_ronbias_preoverscan(), and xsh_detmon_ronbias_region().
int stacking_ks_low |
Definition at line 118 of file xsh_detmon.c.
Referenced by xsh_detmon_ronbias_master(), xsh_detmon_ronbias_preoverscan(), and xsh_detmon_ronbias_region().
const char* stacking_method |
Definition at line 117 of file xsh_detmon.c.
int urx |
Definition at line 138 of file xsh_detmon.c.
Referenced by xsh_combine_flats(), xsh_compute_flat_edges(), xsh_cube_qc_trace_window(), xsh_gain(), xsh_get_master_dark_nir_via_noise(), xsh_ifu_trace_object_calibrate(), xsh_image_find_barycenter(), xsh_ksigma_clip(), and xsh_util_ronbias().
int ury |
Definition at line 139 of file xsh_detmon.c.
Referenced by xsh_combine_flats(), xsh_gain(), xsh_get_master_dark_nir_via_noise(), xsh_ifu_trace_object_calibrate(), xsh_image_find_barycenter(), xsh_image_qc_trace_window(), xsh_ksigma_clip(), and xsh_util_ronbias().