/home/amodigli/releases/xsh/1.2.10/pso/xsh.26608/xshp/xsh/xsh_detmon.c File Reference

#include <complex.h>
#include <math.h>
#include <string.h>
#include <assert.h>
#include <float.h>
#include <cpl.h>
#include "xsh_detmon.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, 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, 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, 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_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 Documentation

#define CONCAT ( a,
 )     a ## _ ## b

Definition at line 1293 of file xsh_detmon.c.

#define CONCAT2X ( a,
 )     CONCAT(a,b)

Definition at line 1294 of file xsh_detmon.c.

 
#define cpl_drand (  )     ((double)rand()/(double)RAND_MAX)

Definition at line 54 of file xsh_detmon.c.

Referenced by irplib_bivector_gen_rect_poisson().

#define CPL_TYPE   int

Definition at line 1304 of file xsh_detmon.c.

#define CPL_TYPE   float

Definition at line 1304 of file xsh_detmon.c.

#define CPL_TYPE   double
#define HIST_FACT   2.354820045

Definition at line 69 of file xsh_detmon.c.

#define HORIZONTAL   TRUE

Definition at line 2960 of file xsh_detmon.c.

Referenced by xsh_detmon_pernoise_reduce().

#define insert_par ( PARNAME,
PARDESC,
PARVALUE,
PARTYPE   ) 
Value:
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 153 of file xsh_detmon.c.

#define OPT   FALSE

Definition at line 154 of file xsh_detmon.c.

#define pdist ( x1,
y1,
x2,
y2   )     (((x1-x2)*(x1-x2))+((y1-y2)*(y1-y2)))

Definition at line 52 of file xsh_detmon.c.

Referenced by irplib_bivector_gen_rect_poisson().

#define RECT_RON_HS   4

Definition at line 3195 of file xsh_detmon.c.

Referenced by xsh_flux_get_bias_window().

#define RECT_RON_SAMPLES   100

Definition at line 3196 of file xsh_detmon.c.

Referenced by xsh_flux_get_bias_window().


Enumeration Type Documentation

enum pixeltypes
Enumerator:
HOT 
DEAD 
NOISY 

Definition at line 71 of file xsh_detmon.c.

enum readouts
Enumerator:
HORIZONTAL 
VERTICAL 

Definition at line 86 of file xsh_detmon.c.

Enumerator:
MINMAX 
MEAN 
MEDIAN 
KSIGMA 

Definition at line 78 of file xsh_detmon.c.


Function Documentation

static cpl_bivector * irplib_bivector_gen_rect_poisson ( const int *  r,
const int  np,
const int  homog 
) [static]

Definition at line 3300 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.

Parameters:
imlist the input images list
Returns:
the average image or NULL on error case.
See also:
cpl_imagelist_is_uniform()

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:

  • CPL_ERROR_NULL_INPUT if (one of) the input pointer(s) is NULL
  • CPL_ERROR_ILLEGAL_INPUT if the input image list is not valid

Definition at line 5053 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_master().

double irplib_pfits_get_exptime ( const cpl_propertylist *  plist  ) 

Definition at line 882 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 
)
int xsh_detmon_compare_dits ( const cpl_frame *  frame1,
const cpl_frame *  frame2 
)

Definition at line 821 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 
)
int xsh_detmon_dark_dfs_set_groups ( cpl_frameset *  set,
const char *  tag 
)

Definition at line 4456 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 4622 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 5012 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 4663 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 433 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 4554 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 4598 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,
  ... 
)
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 3667 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 3734 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 2715 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 
)
int xsh_detmon_pernoise_dfs_set_groups ( cpl_frameset *  set,
const char *  tag 
)

Definition at line 3624 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 4022 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 2963 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]
cpl_error_code xsh_detmon_pernoise_rm_bg ( cpl_image *  image,
int  nsamples,
int  nffts 
)

Definition at line 4169 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 3828 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 4499 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 
)
int xsh_detmon_retrieve_par_int ( const char *  parn,
const char *  pipeline_name,
const char *  recipe_name,
const cpl_parameterlist *  parlist 
)
cpl_error_code xsh_detmon_rm_bpixs ( cpl_image **  image,
const double  kappa,
int  nffts,
int  nsamples 
)

Definition at line 3135 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 
)
cpl_error_code xsh_detmon_ronbias_check_defaults ( const cpl_frameset *  set,
const int  whichext 
)

Definition at line 1077 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 2744 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 2907 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 
)
cpl_error_code xsh_detmon_ronbias_fill_parlist_default ( cpl_parameterlist *  parlist,
const char *  recipe_name,
const char *  pipeline_name 
)

Definition at line 383 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]
cpl_error_code xsh_detmon_ronbias_histo_reduce ( const cpl_image *  c_raw,
double *  bias,
double *  fwhm,
double *  max 
)
static cpl_image * xsh_detmon_ronbias_master ( const cpl_imagelist *  rawbiases,
cpl_mask **  bpmhot,
cpl_mask **  bpmcold,
cpl_mask **  bpmdev,
cpl_propertylist *  qclist 
) [static]
static cpl_error_code xsh_detmon_ronbias_preoverscan ( const cpl_imagelist *  rawbiases,
cpl_propertylist *  qclist,
cpl_image **  synthetic 
) [static]
static cpl_error_code xsh_detmon_ronbias_random ( const cpl_imagelist *  rawbiases,
const cpl_image *  masterbias,
cpl_propertylist *  qclist 
) [static]
static cpl_error_code xsh_detmon_ronbias_region ( const cpl_imagelist *  rawbiases,
const cpl_image *  masterbias,
cpl_propertylist *  qclist 
) [static]
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]
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 2336 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 
)
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.

Parameters:
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)
Returns:
CPL_ERROR_NONE or the relevant _cpl_error_code_ on error

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:

  • CPL_ERROR_NULL_INPUT if img or kmean is NULL
  • CPL_ERROR_ILLEGAL_INPUT if a) the window specification is illegal (llx > urx or lly > ury) b) the window specification is outside the image c) the tolerance is negative d) kappa is <= 1.0 e) nclip is <= 0.

The values of kmean and kstdev is undefined on error.

Definition at line 1215 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().

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(), xsh_my_detmon_ronbias_preoverscan(), and xsh_my_detmon_ronbias_region().

static cpl_error_code xsh_ksigma_clip_double ( const double *  pi,
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().

static cpl_error_code xsh_ksigma_clip_float ( const float *  pi,
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().

static cpl_error_code xsh_ksigma_clip_int ( const int *  pi,
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().


Variable Documentation

int criteria

Definition at line 111 of file xsh_detmon.c.

struct { ... } detmon_dark_config [static]
struct { ... } detmon_pernoise_config [static]
struct { ... } detmon_ronbias_config [static]
cpl_boolean direction

Definition at line 133 of file xsh_detmon.c.

const char* dsnu_method

Definition at line 147 of file xsh_detmon.c.

int exts

Definition at line 126 of file xsh_detmon.c.

int kappa
int llx
int lly

Definition at line 120 of file xsh_detmon.c.

Definition at line 121 of file xsh_detmon.c.

const char* method

Definition at line 98 of file xsh_detmon.c.

int mode

Definition at line 127 of file xsh_detmon.c.

Referenced by xsh_detmon_dark(), and xsh_detmon_pernoise().

cpl_boolean opt_nir

Definition at line 150 of file xsh_detmon.c.

Referenced by xsh_detmon_gain(), xsh_detmon_lg_split_onoff(), and xsh_detmon_lin().

Definition at line 103 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 104 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 105 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 106 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

const char* pmethod

Definition at line 97 of file xsh_detmon.c.

Definition at line 107 of file xsh_detmon.c.

Definition at line 99 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 100 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 101 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 102 of file xsh_detmon.c.

Referenced by xsh_detmon_ronbias_preoverscan().

Definition at line 108 of file xsh_detmon.c.

Referenced by xsh_compute_ron_mbias().

Definition at line 109 of file xsh_detmon.c.

Referenced by xsh_compute_ron_mbias().

Definition at line 110 of file xsh_detmon.c.

int ref_llx
int ref_lly
int ref_urx
int ref_ury
int ron_llx

Definition at line 122 of file xsh_detmon.c.

Referenced by set_masterdark_qc().

int ron_lly

Definition at line 123 of file xsh_detmon.c.

Referenced by set_masterdark_qc().

const char* ron_method

Definition at line 146 of file xsh_detmon.c.

Referenced by xsh_compute_ron_mbias().

int ron_urx

Definition at line 124 of file xsh_detmon.c.

Referenced by set_masterdark_qc().

int ron_ury

Definition at line 125 of file xsh_detmon.c.

Referenced by set_masterdark_qc().

double speed

Definition at line 134 of file xsh_detmon.c.

Definition at line 118 of file xsh_detmon.c.

const char* stacking_method

Definition at line 116 of file xsh_detmon.c.

int urx
int ury

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