/home/amodigli/releases/xsh/2.1.1/xsh.30433/xshp/xsh/xsh_detmon_lg.h File Reference

#include <cpl.h>

Go to the source code of this file.

Defines

#define NIR   TRUE
#define OPT   FALSE
#define DETMON_QC_COUNTS_MIN   "ESO QC COUNTS MIN"
#define DETMON_QC_COUNTS_MIN_C   "Minimum median value used in linearity test (in a user defined region) [ADU]"
#define DETMON_QC_COUNTS_MAX   "ESO QC COUNTS MAX"
#define DETMON_QC_COUNTS_MAX_C   "Maximum median value used in linearity test (in a user defined region) [ADU]"
#define DETMON_QC_CONAD   "ESO QC CONAD"
#define DETMON_QC_CONAD_C   "CONAD value [el/ADU]"
#define DETMON_QC_CONAD_CORR   "ESO QC CONAD CORR"
#define DETMON_QC_CONAD_CORR_C   "CONAD value taken QC.AUTOCORR into account [el/ADU]"
#define DETMON_QC_GAIN   "ESO QC GAIN"
#define DETMON_QC_GAIN_C   "GAIN (see QC.METHOD) [ADU/el]"
#define DETMON_QC_GAIN_MSE   "ESO QC GAIN MSE"
#define DETMON_QC_GAIN_MSE_C   "Measured Squared error in GAIN computation"
#define DETMON_QC_RON   "ESO QC RON"
#define DETMON_QC_RON_C   "RON obtained as independent term (PTC method)"
#define DETMON_QC_AUTOCORR   "ESO QC AUTOCORR"
#define DETMON_QC_AUTOCORR_C
#define DETMON_QC_GAIN_CORR   "ESO QC GAIN CORR"
#define DETMON_QC_GAIN_CORR_C   "GAIN taken QC.AUTOCORR into account [el/ADU]"
#define DETMON_QC_LAMP_FLUX   "ESO QC LAMP FLUX"
#define DETMON_QC_LAMP_FLUX_C   "Lamp flux"
#define DETMON_QC_NUM_BPM   "ESO QC NUM BPM"
#define DETMON_QC_NUM_BPM_C
#define DETMON_QC_LAMP_STAB   "ESO QC LAMP STAB"
#define DETMON_QC_LAMP_STAB_C   "Lamp stability"
#define DETMON_QC_METHOD   "ESO QC METHOD"
#define DETMON_QC_METHOD_C   "Method applied to compute GAIN"
#define DETMON_QC_LIN_EFF   "ESO QC LIN EFF"
#define DETMON_QC_LIN_EFF_C   "Effective non-linearity correction"
#define DETMON_QC_LIN_EFF_FLUX   "ESO QC LIN EFF FLUX"
#define DETMON_QC_LIN_EFF_FLUX_C   "FLux level at which effective non-linearity correction is computed"
#define DETMON_QC_LIN_COEF   "ESO QC LIN COEF"
#define DETMON_QC_LIN_COEF_C   "Linearity coefficient value"
#define DETMON_QC_LIN_COEF_ERR   "ESO QC LIN EFF ERR"
#define DETMON_QC_LIN_COEF_ERR_C   "Linearity coefficient error value"
#define DETMON_QC_LIN_COEF_MSE_ERR_C   "Linearity coefficient measured square error value"
#define DETMON_QC_ERRFIT   "ESO QC ERRFIT"
#define DETMON_QC_ERRFIT_C   "Error of fit"
#define DETMON_QC_ERRFIT_MSE_C   "Measured square error of fit"
#define DETMON_QC_CONTAM   "ESO QC CONTAM"
#define DETMON_QC_CONTAM_C   "Detector contamination in a region"
#define DETMON_QC_FPN   "ESO QC FPN"
#define DETMON_QC_FPN_C   "Flat pattern noise"
#define xsh_detmon_lg_get_description(RECIPE_NAME, PIPE_NAME,DETMON_IR_LG_ON_RAW,DETMON_IR_LG_OFF_RAW)
#define REGEXP   "ARCFILE|MJD-OBS|ESO TPL ID|DATE-OBS|ESO DET DIT|ESO DET NDIT"
#define IRPLIB_GAIN_PTC   ((irplib_gain_flag) 1 << 1)
#define IRPLIB_GAIN_MEDIAN   ((irplib_gain_flag) 1 << 2)
#define IRPLIB_GAIN_NO_COLLAPSE   ((irplib_gain_flag) 1 << 3)
#define IRPLIB_GAIN_COLLAPSE   ((irplib_gain_flag) 1 << 4)
#define IRPLIB_GAIN_WITH_AUTOCORR   ((irplib_gain_flag) 1 << 5)
#define IRPLIB_GAIN_WITH_RESCALE   ((irplib_gain_flag) 1 << 6)
#define IRPLIB_GAIN_OPT   ((irplib_gain_flag) 1 << 7)
#define IRPLIB_GAIN_NIR   ((irplib_gain_flag) 1 << 8)
#define IRPLIB_LIN_NO_COLLAPSE   ((irplib_lin_flag) 1 << 10)
#define IRPLIB_LIN_COLLAPSE   ((irplib_lin_flag) 1 << 11)
#define IRPLIB_LIN_PIX2PIX   ((irplib_lin_flag) 1 << 12)
#define IRPLIB_LIN_WITH_RESCALE   ((irplib_lin_flag) 1 << 13)
#define IRPLIB_LIN_OPT   ((irplib_lin_flag) 1 << 14)
#define IRPLIB_LIN_NIR   ((irplib_lin_flag) 1 << 15)

Typedefs

typedef unsigned long irplib_gain_flag
typedef unsigned long irplib_lin_flag

Functions

cpl_error_code xsh_detmon_lg (cpl_frameset *frameset, const cpl_parameterlist *parlist, const char *tag_on, const char *tag_off, const char *recipe_name, const char *pipeline_name, const char *pafregexp, const cpl_propertylist *pro_lintbl, const cpl_propertylist *pro_gaintbl, const cpl_propertylist *pro_coeffscube, const cpl_propertylist *pro_bpm, const cpl_propertylist *pro_corr, const cpl_propertylist *pro_diff, const char *package, int(*compare)(const cpl_frame *, const cpl_frame *), int(*load_fset)(const cpl_frameset *, cpl_type, cpl_imagelist *), const cpl_boolean opt_nir)
cpl_image * xsh_detmon_image_correlate (const cpl_image *, const cpl_image *, const int, const int)
cpl_error_code xsh_detmon_lg_fill_parlist_nir_default (cpl_parameterlist *, const char *, const char *)
 Parlist filling with NIR required parameters and its default values.
cpl_error_code xsh_detmon_lg_fill_parlist_opt_default (cpl_parameterlist *, const char *, const char *)
 Parlist filling with OPT required parameters and its default values.
cpl_error_code xsh_detmon_lg_fill_parlist (cpl_parameterlist *parlist, const char *recipe_name, const char *pipeline_name, const char *method, int order, double kappa, int niter, int llx, int lly, int urx, int ury, int ref_level, const char *intermediate, const char *autocorr, const char *collapse, const char *rescale, const char *pix2pix, const char *bpmbin, int filter, int m, int n, double tolerance, const char *pafgen, const char *pafname, int llx1, int lly1, int urx1, int ury1, int llx2, int lly2, int urx2, int ury2, int llx3, int lly3, int urx3, int ury3, int llx4, int lly4, int urx4, int ury4, int llx5, int lly5, int urx5, int ury5, int exts, cpl_boolean opt_nir)
 Generic parlist filling for Lin/Gain recipe.
cpl_image * xsh_detmon_autocorrelate (const cpl_image *, const int, const int)
cpl_table * xsh_detmon_gain (const cpl_imagelist *, const cpl_imagelist *, const cpl_vector *, const cpl_vector *, double, int, int, int, int, double, int, int, int, cpl_propertylist *, unsigned, cpl_imagelist **, cpl_imagelist **)
 Gain computation.
cpl_table * xsh_detmon_lin (const cpl_imagelist *, const cpl_imagelist *, const cpl_vector *, double, int, int, int, int, int, int, double, cpl_boolean, cpl_propertylist *, unsigned, cpl_imagelist **, cpl_image **)
 Linearity computation.

Define Documentation

#define DETMON_QC_AUTOCORR   "ESO QC AUTOCORR"

Definition at line 65 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_gain(), and xsh_detmon_lg_reduce_all().

#define DETMON_QC_AUTOCORR_C
Value:
"Autocorrelation factor computed as sum of " \
                              "all pixels in autocorrelation image"

Definition at line 66 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_gain(), and xsh_detmon_lg_reduce_all().

#define DETMON_QC_CONAD   "ESO QC CONAD"

Definition at line 50 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_CONAD_C   "CONAD value [el/ADU]"

Definition at line 51 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_CONAD_CORR   "ESO QC CONAD CORR"

Definition at line 53 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_CONAD_CORR_C   "CONAD value taken QC.AUTOCORR into account [el/ADU]"

Definition at line 54 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_CONTAM   "ESO QC CONTAM"

Definition at line 104 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_opt_contamination().

#define DETMON_QC_CONTAM_C   "Detector contamination in a region"

Definition at line 105 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_opt_contamination().

#define DETMON_QC_COUNTS_MAX   "ESO QC COUNTS MAX"

Definition at line 47 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_COUNTS_MAX_C   "Maximum median value used in linearity test (in a user defined region) [ADU]"

Definition at line 48 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_COUNTS_MIN   "ESO QC COUNTS MIN"

Definition at line 44 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_COUNTS_MIN_C   "Minimum median value used in linearity test (in a user defined region) [ADU]"

Definition at line 45 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_ERRFIT   "ESO QC ERRFIT"

Definition at line 99 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_ERRFIT_C   "Error of fit"

Definition at line 100 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_ERRFIT_MSE_C   "Measured square error of fit"

Definition at line 101 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_FPN   "ESO QC FPN"

Definition at line 107 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_fpn_compute().

#define DETMON_QC_FPN_C   "Flat pattern noise"

Definition at line 108 of file xsh_detmon_lg.h.

#define DETMON_QC_GAIN   "ESO QC GAIN"
#define DETMON_QC_GAIN_C   "GAIN (see QC.METHOD) [ADU/el]"

Definition at line 57 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_GAIN_CORR   "ESO QC GAIN CORR"

Definition at line 68 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_GAIN_CORR_C   "GAIN taken QC.AUTOCORR into account [el/ADU]"

Definition at line 69 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med(), and xsh_detmon_lg_qc_ptc().

#define DETMON_QC_GAIN_MSE   "ESO QC GAIN MSE"

Definition at line 59 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med().

#define DETMON_QC_GAIN_MSE_C   "Measured Squared error in GAIN computation"

Definition at line 60 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_qc_med().

#define DETMON_QC_LAMP_FLUX   "ESO QC LAMP FLUX"

Definition at line 71 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_LAMP_FLUX_C   "Lamp flux"

Definition at line 72 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_LAMP_STAB   "ESO QC LAMP STAB"

Definition at line 78 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_LAMP_STAB_C   "Lamp stability"

Definition at line 79 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all().

#define DETMON_QC_LIN_COEF   "ESO QC LIN COEF"

Definition at line 90 of file xsh_detmon_lg.h.

#define DETMON_QC_LIN_COEF_C   "Linearity coefficient value"

Definition at line 91 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_LIN_COEF_ERR   "ESO QC LIN EFF ERR"

Definition at line 94 of file xsh_detmon_lg.h.

#define DETMON_QC_LIN_COEF_ERR_C   "Linearity coefficient error value"

Definition at line 95 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_LIN_COEF_MSE_ERR_C   "Linearity coefficient measured square error value"

Definition at line 96 of file xsh_detmon_lg.h.

#define DETMON_QC_LIN_EFF   "ESO QC LIN EFF"

Definition at line 84 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_lineff().

#define DETMON_QC_LIN_EFF_C   "Effective non-linearity correction"

Definition at line 85 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_lineff().

#define DETMON_QC_LIN_EFF_FLUX   "ESO QC LIN EFF FLUX"

Definition at line 87 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_lineff().

#define DETMON_QC_LIN_EFF_FLUX_C   "FLux level at which effective non-linearity correction is computed"

Definition at line 88 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_lineff().

#define DETMON_QC_METHOD   "ESO QC METHOD"

Definition at line 81 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_gain(), and xsh_detmon_lg_reduce_all().

#define DETMON_QC_METHOD_C   "Method applied to compute GAIN"

Definition at line 82 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_gain(), and xsh_detmon_lg_reduce_all().

#define DETMON_QC_NUM_BPM   "ESO QC NUM BPM"

Definition at line 74 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_NUM_BPM_C
Value:
"Number of bad pixels detected according to "\
                              "polynomial information"

Definition at line 75 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_all(), and xsh_detmon_lin().

#define DETMON_QC_RON   "ESO QC RON"

Definition at line 62 of file xsh_detmon_lg.h.

#define DETMON_QC_RON_C   "RON obtained as independent term (PTC method)"

Definition at line 63 of file xsh_detmon_lg.h.

#define IRPLIB_GAIN_COLLAPSE   ((irplib_gain_flag) 1 << 4)
#define IRPLIB_GAIN_MEDIAN   ((irplib_gain_flag) 1 << 2)

Definition at line 135 of file xsh_detmon_lg.h.

#define IRPLIB_GAIN_NIR   ((irplib_gain_flag) 1 << 8)
#define IRPLIB_GAIN_NO_COLLAPSE   ((irplib_gain_flag) 1 << 3)
#define IRPLIB_GAIN_OPT   ((irplib_gain_flag) 1 << 7)
#define IRPLIB_GAIN_PTC   ((irplib_gain_flag) 1 << 1)

Definition at line 134 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_gain(), and xsh_gain().

#define IRPLIB_GAIN_WITH_AUTOCORR   ((irplib_gain_flag) 1 << 5)
#define IRPLIB_GAIN_WITH_RESCALE   ((irplib_gain_flag) 1 << 6)

Definition at line 139 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_gain(), and xsh_gain().

#define IRPLIB_LIN_COLLAPSE   ((irplib_lin_flag) 1 << 11)
#define IRPLIB_LIN_NIR   ((irplib_lin_flag) 1 << 15)

Definition at line 150 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lg_reduce_dit(), and xsh_detmon_lin_table_fill_row().

#define IRPLIB_LIN_NO_COLLAPSE   ((irplib_lin_flag) 1 << 10)
#define IRPLIB_LIN_OPT   ((irplib_lin_flag) 1 << 14)
#define IRPLIB_LIN_PIX2PIX   ((irplib_lin_flag) 1 << 12)
#define IRPLIB_LIN_WITH_RESCALE   ((irplib_lin_flag) 1 << 13)

Definition at line 148 of file xsh_detmon_lg.h.

Referenced by xsh_detmon_lin().

#define NIR   TRUE

Definition at line 41 of file xsh_detmon_lg.h.

#define OPT   FALSE

Definition at line 42 of file xsh_detmon_lg.h.

#define REGEXP   "ARCFILE|MJD-OBS|ESO TPL ID|DATE-OBS|ESO DET DIT|ESO DET NDIT"

Definition at line 130 of file xsh_detmon_lg.h.

#define xsh_detmon_lg_get_description ( RECIPE_NAME,
PIPE_NAME,
DETMON_IR_LG_ON_RAW,
DETMON_IR_LG_OFF_RAW   ) 
Value:
RECIPE_NAME " -- " PIPE_NAME " linearity/gain recipe for OPT/IR.\n"           \
    "The files listed in the Set Of Frames must be tagged:\n"                 \
    "the raw-on-file.fits  "DETMON_IR_LG_ON_RAW"  and\n"                      \
    "the raw-off-file.fits "DETMON_IR_LG_OFF_RAW"\n"                          \
    "The recipe requires at least order+1 valid pairs of ON frames\n"         \
    "and order+1 valid pairs of OFF frames, \n"                               \
    "where order is the value of the 'order' parameter.\n"                    \
    "There is no requirement for pairs of OFF frames if collapse parameter"   \
    "is set to true.\n"                                                       \
    "Frames with median flux over --filter will be excluded from the"         \
    "computation.\n"                                                          \
    "To perform a stability check you need frames with at least 2 DIT"        \
    "values\n"                                                                \
    "NOTE for multiextension cases: it is mandatory to modify the --exts"     \
    "parameter, either to -1 (all extensions) or to any valid extension nb.\n"

Definition at line 113 of file xsh_detmon_lg.h.


Typedef Documentation

typedef unsigned long irplib_gain_flag

Definition at line 132 of file xsh_detmon_lg.h.

typedef unsigned long irplib_lin_flag

Definition at line 143 of file xsh_detmon_lg.h.


Function Documentation

cpl_image* xsh_detmon_autocorrelate ( const cpl_image *  ,
const   int,
const   int 
)

Definition at line 1219 of file xsh_detmon_lg.c.

References autocorr, nx, and ny.

Referenced by xsh_detmon_autocorr_factor().

cpl_table* xsh_detmon_gain ( const cpl_imagelist *  imlist_on,
const cpl_imagelist *  imlist_off,
const cpl_vector *  exptimes,
const cpl_vector *  ndit,
double  tolerance,
int  llx,
int  lly,
int  urx,
int  ury,
double  kappa,
int  nclip,
int  xshift,
int  yshift,
cpl_propertylist *  qclist,
unsigned  mode,
cpl_imagelist **  diff_imlist,
cpl_imagelist **  autocorr_imlist 
)

Gain computation.

Parameters:
imlist_on Input ON imagelist
imlist_off Input OFF imagelist
exptimes Vector containing EXPTIME values corresponding to input imagelists
tolerance Tolerance allowed between EXPTIME of frames in a pair
llx Region to compute
lly Region to compute
urx Region to compute
ury Region to compute
kappa Kappa used for kappa-sigma clipping
nclip Number of iterative kappa-sigma clipping
xshift Shift applied on X axis (Autocorrelation)
yshift Shift applied on Y axis (Autocorrelation)
qclist QC list
mode Possible options (combined with bitwise or)
diff_imlist Output Difference imlist or NULL
autocorr_imlist Output Autocorr imlist or NULL
Returns:
Pointer to the Gain Table or NULL on error

imlist_on must have the same size of exptimes.

imlist_off must have either the same size of exptimes or contain only 2 images. (NOTE: the first case is the usual one in IR domain, the second one, the usual in OPT domain).

This function assumes image i in imlist_on has been taken with EXPTIME equal to position i in exptimes. The same is assumed for imlist_off if it is of the same length as imlist_on.

Every different EXPTIME value in exptimes must appear at least twice within the vector; in any case, an even number of times.

The algorithm for Gain computation involves several mean and stdev which are computed through an iterative kappa-sigma clipping.

The parameters xshift and yshift are ignored if mode & IRPLIB_GAIN_WITH_AUTOCORR = 0.

For the Difference and Autocorrelation imagelists NULL indicates these products are not required. Note that even being non-null, they will be ignored if IRPLIB_GAIN_WITH_AUTOCORR is not requested.

These are these supported modes: IRPLIB_GAIN_PTC : Use PTC method for Gain computation IRPLIB_GAIN_MEDIAN : use MEDIAN method for Gain computation IRPLIB_GAIN_NO_COLLAPSE : No collapse of darks/biases (NIR) IRPLIB_GAIN_COLLAPSE : Collapse of darks/biases (OPT) IRPLIB_GAIN_OPT : Optical data (output will have EXPTIME column) IRPLIB_GAIN_NIR : Optical data (output will have NIR column) IRPLIB_GAIN_WITH_AUTOCORR : Apply autocorrelation factor IRPLIB_GAIN_WITH_RESCALE : Rescale images in each pair one to the another

It is mandatory to choose at least the collapse / no collapse and the data. By default, MEDIAN method is applied.

Example:

  int n = NEXP;

  cpl_imagelist    * my_imlist_on  = create_on_imlist(n);
  cpl_imagelist    * my_imlist_off = create_off_imlist(n);

  cpl_vector       * exptimes      = create_exptimes(n);

  cpl_propertylist * qclist        = cpl_propertylist_new();

  cpl_table * gain_table = xsh_detmon_gain(imlist_on, imlist_off, exptimes,
                                              0.0, 1, 1, IMAGESIZE, IMAGESIZE,
                          3.0, 5, 0, 0, qclist,
                          IRPLIB_GAIN_NO_COLLAPSE |
                          IRPLIB_GAIN_NIR,
                          NULL, NULL);

As said above, a minimum of 2 bitwise options must be passed to mode. In the example, IRPLIB_GAIN_NO_COLLAPSE can be replaced with IRPLIB_GAIN_COLLAPSE, IRPLIB_GAIN_NIR with IRPLIB_GAIN_OPT or both. Of course, other options can be added bitwise as well to the mode.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input const pointer(s) is NULL

Definition at line 5494 of file xsh_detmon_lg.c.

References autocorr, DETMON_QC_AUTOCORR, DETMON_QC_AUTOCORR_C, DETMON_QC_METHOD, DETMON_QC_METHOD_C, end_skip, IRPLIB_GAIN_COLLAPSE, IRPLIB_GAIN_NO_COLLAPSE, IRPLIB_GAIN_OPT, IRPLIB_GAIN_PTC, IRPLIB_GAIN_WITH_AUTOCORR, IRPLIB_GAIN_WITH_RESCALE, method, NIR, OPT, opt_nir, skip_if, xsh_detmon_gain_table_create(), xsh_detmon_gain_table_fill_row(), xsh_detmon_lg_find_dits_ndits(), xsh_detmon_lg_qc_med(), xsh_detmon_lg_qc_ptc(), and xsh_detmon_lg_rescale().

Referenced by xsh_gain().

cpl_image* xsh_detmon_image_correlate ( const cpl_image *  ,
const cpl_image *  ,
const   int,
const   int 
)

Definition at line 1049 of file xsh_detmon_lg.c.

References nx, and ny.

Referenced by xsh_detmon_autocorr_factor().

cpl_error_code xsh_detmon_lg ( cpl_frameset *  frameset,
const cpl_parameterlist *  parlist,
const char *  tag_on,
const char *  tag_off,
const char *  recipe_name,
const char *  pipeline_name,
const char *  pafregexp,
const cpl_propertylist *  pro_lintbl,
const cpl_propertylist *  pro_gaintbl,
const cpl_propertylist *  pro_coeffscube,
const cpl_propertylist *  pro_bpm,
const cpl_propertylist *  pro_corr,
const cpl_propertylist *  pro_diff,
const char *  package,
int(*)(const cpl_frame *, const cpl_frame *)  compare,
int(*)(const cpl_frameset *, cpl_type, cpl_imagelist *)  load_fset,
const cpl_boolean  opt_nir 
)
cpl_error_code xsh_detmon_lg_fill_parlist ( cpl_parameterlist *  parlist,
const char *  recipe_name,
const char *  pipeline_name,
const char *  method,
int  order,
double  kappa,
int  niter,
int  llx,
int  lly,
int  urx,
int  ury,
int  ref_level,
const char *  intermediate,
const char *  autocorr,
const char *  collapse,
const char *  rescale,
const char *  pix2pix,
const char *  bpmbin,
int  filter,
int  m,
int  n,
double  tolerance,
const char *  pafgen,
const char *  pafname,
int  llx1,
int  lly1,
int  urx1,
int  ury1,
int  llx2,
int  lly2,
int  urx2,
int  ury2,
int  llx3,
int  lly3,
int  urx3,
int  ury3,
int  llx4,
int  lly4,
int  urx4,
int  ury4,
int  llx5,
int  lly5,
int  urx5,
int  ury5,
int  exts,
cpl_boolean  opt_nir 
)

Generic parlist filling for Lin/Gain recipe.

Parameters:
parlist Pointer to parlist where parameters will be inserted
recipe_name Recipe name (used for parameter name construction)
pipeline_name Pipeline name (used for parameter name construction)
method Method to be used for Gain computation
order Order of the polynomial linearity fitting
kappa Kappa value for kappa-sigma clipping (used for Gain)
niter Number of iterations in kappa-sigma clipping
threshold_min Minimum threshold (not used now)
threshold_max Maximum threshold (not used now)
llx Lower left point of the ROI, x-coordinate
lly Lower left point of the POI, y-coordinate
urx Upper right point of the ROI, x-coordinate
ury Upper right point of the POI, y-coordinate
ref_level Reference level to compute Linearity Correction
threshold Threshold (not used now)
intermediate String. Must be <"CPL_FALSE"|"CPL_TRUE">
autocorr String. Must be <"CPL_FALSE"|"CPL_TRUE">
collapse String. Must be <"CPL_FALSE"|"CPL_TRUE">
rescale String. Must be <"CPL_FALSE"|"CPL_TRUE">
pix2pix String. Must be <"CPL_FALSE"|"CPL_TRUE">
filter Level to filter saturated frames
m X-axis shift of the autocorrelation
n Y-axis shift of the autocorrelation
llx1 llx for contamination - 1. region (OPT only)
lly1 lly for contamination - 1. region (OPT only)
urx1 urx for contamination - 1. region (OPT only)
ury1 ury for contamination - 1. region (OPT only)
llx2 llx for contamination - 2. region (OPT only)
lly2 lly for contamination - 2. region (OPT only)
urx2 urx for contamination - 2. region (OPT only)
ury2 ury for contamination - 2. region (OPT only)
llx3 llx for contamination - 3. region (OPT only)
lly3 lly for contamination - 3. region (OPT only)
urx3 urx for contamination - 3. region (OPT only)
ury3 ury for contamination - 3. region (OPT only)
llx4 llx for contamination - 4. region (OPT only)
lly4 lly for contamination - 4. region (OPT only)
urx4 urx for contamination - 4. region (OPT only)
ury4 ury for contamination - 4. region (OPT only)
llx5 llx for contamination - 5. region (OPT only)
lly5 lly for contamination - 5. region (OPT only)
urx5 urx for contamination - 5. region (OPT only)
ury5 ury for contamination - 5. region (OPT only)
exts Extension to be computed
opt_nir Controls insertion of llx{1,...} only in OPT case
Returns:
CPL_ERROR_NONE or corresponding cpl_error_code() on error.
Note:
This function is not used inside the main function xsh_detmon_lg(). It is used for testing purposes and offered for use, for example, at recipe plugin creation. It is also called from xsh_detmon_lg_fill_parlist_{opt,nir}_default().

Definition at line 1539 of file xsh_detmon_lg.c.

References xsh_detmon_fill_parlist().

Referenced by xsh_detmon_lg_fill_parlist_nir_default(), and xsh_detmon_lg_fill_parlist_opt_default().

cpl_error_code xsh_detmon_lg_fill_parlist_nir_default ( cpl_parameterlist *  parlist,
const char *  recipe_name,
const char *  pipeline_name 
)

Parlist filling with NIR required parameters and its default values.

Parameters:
parlist Pointer to parlist where parameters will be inserted
recipe_name Recipe name (used for parameter name construction)
pipeline_name Pipeline name (used for parameter name construction)
Returns:
CPL_ERROR_NONE or corresponding cpl_error_code() on error.
Note:
This function is not used inside the main function xsh_detmon_lg(). It is used for testing purposed and offered for use, for example, at recipe plugin creation.

Definition at line 1359 of file xsh_detmon_lg.c.

References NIR, and xsh_detmon_lg_fill_parlist().

Referenced by xsh_lingain_fill_parlist_default_nir().

cpl_error_code xsh_detmon_lg_fill_parlist_opt_default ( cpl_parameterlist *  parlist,
const char *  recipe_name,
const char *  pipeline_name 
)

Parlist filling with OPT required parameters and its default values.

Parameters:
parlist Pointer to parlist where parameters will be inserted
recipe_name Recipe name (used for parameter name construction)
pipeline_name Pipeline name (used for parameter name construction)
Returns:
CPL_ERROR_NONE or corresponding cpl_error_code() on error.
Note:
This function is not used inside the main function xsh_detmon_lg(). It is used for testing purposed and offered for use, for example, at recipe plugin creation.

Definition at line 1428 of file xsh_detmon_lg.c.

References OPT, and xsh_detmon_lg_fill_parlist().

Referenced by xsh_lingain_fill_parlist_default_opt().

cpl_table* xsh_detmon_lin ( const cpl_imagelist *  imlist_on,
const cpl_imagelist *  imlist_off,
const cpl_vector *  exptimes,
double  tolerance,
int  llx,
int  lly,
int  urx,
int  ury,
int  order,
int  ref_level,
double  kappa,
cpl_boolean  bpmbin,
cpl_propertylist *  qclist,
unsigned  mode,
cpl_imagelist **  coeffs_cube,
cpl_image **  bpm 
)

Linearity computation.

Parameters:
imlist_on Input ON imagelist
imlist_off Input OFF imagelist
exptimes Vector containing EXPTIME values corresponding to input imagelists
tolerance Tolerance allowed between EXPTIME of frames in a pair
llx Region to compute
lly Region to compute
urx Region to compute
ury Region to compute
order polynomial order used to fit linearity relation
ref_level reference level used in the construction of the polynomial F_m(F_r) from F_m(t), using F_r = a_1 * t
kappa kappa used in kappa-sigma clipping
bpmbin switch to De-/Activate the binary bpm option
qclist QC list
mode Possible options (combined with bitwise or)
coeffs_cube Output Coefficients Cube (only if IRPLIB_LIN_PIX2PIX)
bpm Bad pixel map (only if IRPLIB_LIN_PIX2PIX)
Returns:
Pointer to the Linearity Table or NULL on error

imlist_on must have the same size of exptimes.

imlist_off must have either the same size of exptimes only if using mode IRPLIB_LIN_NO_COLLAPSE. (NOTE: this is usual case in IR domain). Otherwise (OPT domain) any size is accepted (as all images will be collapse to a MASTERBIAS).

This function assumes image i in imlist_on has been taken with EXPTIME equal to position i in exptimes. The same is assumed for imlist_off if it is of the same length as imlist_on.

Every different EXPTIME value in exptimes must appear at least twice within the vector; in any case, an even number of times.

These are these supported modes: IRPLIB_LIN_PIX2PIX : Fit for each pixel position IRPLIB_LIN_WITH_RESCALE : Rescale images in each pair one to the another IRPLIB_LIN_NO_COLLAPSE : No collapse of darks/biases (NIR) IRPLIB_LIN_COLLAPSE : Collapse of darks/biases (OPT) IRPLIB_LIN_OPT : Optical data (output will have EXPTIME column) IRPLIB_LIN_NIR : Optical data (output will have NIR column)

It is mandatory to choose at least the collapse / no collapse and the data. By default, MEDIAN method is applied.

Example:

  int n = NEXP;

  cpl_imagelist    * my_imlist_on  = create_on_imlist(n);
  cpl_imagelist    * my_imlist_off = create_off_imlist(n);

  cpl_vector       * exptimes      = create_exptimes(n);

  cpl_propertylist * qclist        = cpl_propertylist_new();

  cpl_table * lin_table = xsh_detmon_lin(imlist_on, imlist_off, exptimes,
                                            0.0, 1, 1, IMAGESIZE, IMAGESIZE,
                        3, 10000, 3, FALSE, qclist,
                        IRPLIB_LIN_NO_COLLAPSE |
                        IRPLIB_LIN_NIR,
                        NULL, NULL);

As said above, a minimum of 2 bitwise options must be passed to mode. In the example, IRPLIB_LIN_NO_COLLAPSE can be replaced with IRPLIB_LIN_COLLAPSE, IRPLIB_LIN_NIR with IRPLIB_LIN_OPT or both. Of course, other options can be added bitwise as well to the mode.

Possible _cpl_error_code_ set in this function:

  • CPL_ERROR_NULL_INPUT if (one of) the input const pointer(s) is NULL

Definition at line 5923 of file xsh_detmon_lg.c.

References collapse, DETMON_QC_ERRFIT, DETMON_QC_ERRFIT_C, DETMON_QC_ERRFIT_MSE_C, DETMON_QC_LIN_COEF_C, DETMON_QC_LIN_COEF_ERR_C, DETMON_QC_NUM_BPM, DETMON_QC_NUM_BPM_C, end_skip, first, irplib_ensure, IRPLIB_LIN_COLLAPSE, IRPLIB_LIN_NO_COLLAPSE, IRPLIB_LIN_OPT, IRPLIB_LIN_PIX2PIX, IRPLIB_LIN_WITH_RESCALE, irplib_polynomial_fit_1d_create_chiq(), gauss_res::mse, NIR, OPT, opt_nir, skip_if, x, xsh_detmon_add_adl_column(), xsh_detmon_bpixs(), xsh_detmon_lg_find_dits(), xsh_detmon_lg_lineff(), xsh_detmon_lg_rescale(), xsh_detmon_lin_table_create(), xsh_detmon_lin_table_fill_row(), and y.


Generated on 13 Mar 2013 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1