CR2RE Pipeline Reference Manual 1.6.7
cr2res_qc.h
1/*
2 * This file is part of the CR2RES Pipeline
3 * Copyright (C) 2002,2003 European Southern Observatory
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 USA
18 */
19
20#ifndef CR2RES_QC_H
21#define CR2RES_QC_H
22
23/*-----------------------------------------------------------------------------
24 Includes
25 -----------------------------------------------------------------------------*/
26
27#include <cpl.h>
28#include <hdrl.h>
29
30#define CR2RES_NONLIN_LEVEL 20000
31#define CR2RES_QC_ORDER 4
32#define CR2RES_QC_TRACE 1
33#define CR2RES_QC_SIZE 100
34#define CR2RES_QC_WINDOW 20
35
36
37/*-----------------------------------------------------------------------------
38 Functions prototypes
39 -----------------------------------------------------------------------------*/
40
41/* DARK */
43 const cpl_image * ima1,
44 const cpl_image * ima2,
45 int hsize,
46 int nsamples,
47 int ndit) ;
48
49/* DETLIN */
50double cr2res_qc_detlin(
51 const hdrl_imagelist * hdrl_coeffs,
52 double bpm_thresh,
53 cpl_mask ** outmask,
54 double * min_level,
55 double * max_level) ;
57 const hdrl_imagelist * hdrl_coeffs,
58 double * meda,
59 double * medb,
60 double * medc,
61 double * meda_err) ;
62
63/* FLAT */
65 const cpl_table * trace) ;
67 const cpl_table * tw,
68 int ** order_nb,
69 double ** order_pos,
70 int * nbvals) ;
72 const cpl_table * extracted) ;
73
74/* WAVE */
76 const cpl_table * tw,
77 int order) ;
79 const cpl_table * tw,
80 int order) ;
81
82cpl_vector * cr2res_qc_lines_collect(double wmin, double wmax) ;
83
85 const cpl_bivector * spec) ;
86cpl_bivector * cr2res_qc_lines_intens_bgd(
87 const cpl_bivector * spec) ;
88
90 const cpl_bivector * spec,
91 double wl,
92 double * peak_height) ;
94 const cpl_bivector * spec,
95 double * wl) ;
96
97/* OBS */
98int cr2res_qc_numsat(const cpl_frameset * frameset) ;
100 const cpl_image * ima,
101 const cpl_table * tw,
102 int order_idx) ;
104 const cpl_table * extracted) ;
106 const cpl_table * extracted,
107 char * setting) ;
109 const cpl_table * slitfu,
110 int order_idxp,
111 int oversample) ;
112double * cr2res_qc_snr(
113 const cpl_table * tw,
114 const cpl_table * extracted,
115 int ** out_order_idx_values,
116 int * out_nb_order_idx_values) ;
117double * cr2res_qc_der_snr(
118 const cpl_table * tw,
119 const cpl_table * extracted,
120 int ** out_order_idx_values,
121 int * out_nb_order_idx_values) ;
122double cr2res_qc_compute_snr(cpl_vector *spec,
123 cpl_vector *err);
124double cr2res_qc_compute_der_snr(cpl_vector *spec,
125 cpl_vector *err);
126
127int cr2res_qc_calculate_mean_and_rmsd(
128 cpl_propertylist *** plists,
129 int size,
130 const int * sizes,
131 const char * ref_keyword,
132 cpl_propertylist * qc_main,
133 const char * result_avg_keyword,
134 const char * result_rmsd_keyword);
135
136int cr2res_qc_dup_mtrlgy_key(
137 cpl_frameset * framelist,
138 cpl_propertylist *plist);
139
140int cr2res_qc_dup_chip_idx(
141 cpl_propertylist *plist);
142#endif
double cr2res_qc_overexposed(const cpl_image *ima, const cpl_table *tw, int order_idx)
Computes the Overexposed fraction.
Definition: cr2res_qc.c:796
int cr2res_qc_numsat(const cpl_frameset *frameset)
Calculate the number of saturated pixels.
Definition: cr2res_qc.c:1290
double cr2res_qc_flat_s2n(const cpl_table *extracted)
Computes the S2N on the flat.
Definition: cr2res_qc.c:375
double cr2res_qc_wave_resol_fwhm(const cpl_bivector *spec, double *wl)
Computes the lines Fwhm and return the smallest.
Definition: cr2res_qc.c:710
double * cr2res_qc_der_snr(const cpl_table *tw, const cpl_table *extracted, int **out_order_idx_values, int *out_nb_order_idx_values)
Computes the DER SNR of several spectra.
Definition: cr2res_qc.c:1103
double cr2res_qc_wave_lamp_effic(const cpl_bivector *spec)
Computes the lamp efficiency.
Definition: cr2res_qc.c:656
double cr2res_dark_qc_ron(const cpl_image *ima1, const cpl_image *ima2, int hsize, int nsamples, int ndit)
The Read Out Noise computation.
Definition: cr2res_qc.c:74
int cr2res_qc_detlin_stat(const hdrl_imagelist *hdrl_coeffs, double *meda, double *medb, double *medc, double *meda_err)
Computes the detlin coeffs statѕ
Definition: cr2res_qc.c:111
double cr2res_qc_obs_nodding_signal(const cpl_table *extracted)
Computes the integrated flux over part of the spectrum.
Definition: cr2res_qc.c:845
double cr2res_qc_wave_central(const cpl_table *tw, int order)
Computes the central WLEN of a given order.
Definition: cr2res_qc.c:452
int cr2res_qc_flat_order_positions(const cpl_table *tw, int **order_nb, double **order_pos, int *nbvals)
Compute the central orders positions.
Definition: cr2res_qc.c:235
double cr2res_qc_wave_line_fwhm(const cpl_bivector *spec, double wl, double *peak_height)
Computes one line Fwhm.
Definition: cr2res_qc.c:546
double cr2res_qc_flat_trace_center_y(const cpl_table *trace)
Computes the mean Y coord of the central order.
Definition: cr2res_qc.c:325
double cr2res_qc_compute_der_snr(cpl_vector *spec, cpl_vector *err)
Computes the DER SNR of one spectrum.
Definition: cr2res_qc.c:1157
double cr2res_qc_wave_disp(const cpl_table *tw, int order)
Computes the dispersion of a given order.
Definition: cr2res_qc.c:480
double cr2res_qc_obs_nodding_standard_flux(const cpl_table *extracted, char *setting)
Computes the standard flux over part of the spectrum.
Definition: cr2res_qc.c:892
cpl_bivector * cr2res_qc_lines_intens_bgd(const cpl_bivector *spec)
Computes the lines intensities / background.
Definition: cr2res_qc.c:612
double * cr2res_qc_snr(const cpl_table *tw, const cpl_table *extracted, int **out_order_idx_values, int *out_nb_order_idx_values)
Computes the SNR of several spectra.
Definition: cr2res_qc.c:1010
cpl_vector * cr2res_qc_lines_collect(double wmin, double wmax)
Collect lines between 2 wavelengths.
Definition: cr2res_qc.c:512
double cr2res_qc_detlin(const hdrl_imagelist *hdrl_coeffs, double bpm_thresh, cpl_mask **outmask, double *min_level, double *max_level)
Computes the detlin median non linearity.
Definition: cr2res_qc.c:156
double cr2res_qc_compute_snr(cpl_vector *spec, cpl_vector *err)
Computes the SNR of one spectrum.
Definition: cr2res_qc.c:1065
double cr2res_qc_obs_slit_psf(const cpl_table *slitfu, int order_idxp, int oversample)
Computes the FWHM of the PSF along the slit for a given order.
Definition: cr2res_qc.c:1208