CR2RE Pipeline Reference Manual 1.6.7
Functions
QC related functions

Functions

double cr2res_dark_qc_ron (const cpl_image *ima1, const cpl_image *ima2, int hsize, int nsamples, int ndit)
 The Read Out Noise computation.
 
int cr2res_qc_detlin_stat (const hdrl_imagelist *hdrl_coeffs, double *meda, double *medb, double *medc, double *meda_err)
 Computes the detlin coeffs statѕ
 
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.
 
int cr2res_qc_flat_order_positions (const cpl_table *tw, int **order_nb, double **order_pos, int *nbvals)
 Compute the central orders positions.
 
double cr2res_qc_flat_trace_center_y (const cpl_table *trace)
 Computes the mean Y coord of the central order.
 
double cr2res_qc_flat_s2n (const cpl_table *extracted)
 Computes the S2N on the flat.
 
double cr2res_qc_wave_central (const cpl_table *tw, int order_idx)
 Computes the central WLEN of a given order.
 
double cr2res_qc_wave_disp (const cpl_table *tw, int order_idx)
 Computes the dispersion of a given order.
 
cpl_vector * cr2res_qc_lines_collect (double wmin, double wmax)
 Collect lines between 2 wavelengths.
 
double cr2res_qc_wave_line_fwhm (const cpl_bivector *spec, double wl, double *peak_height)
 Computes one line Fwhm.
 
cpl_bivector * cr2res_qc_lines_intens_bgd (const cpl_bivector *spec)
 Computes the lines intensities / background.
 
double cr2res_qc_wave_lamp_effic (const cpl_bivector *spec)
 Computes the lamp efficiency.
 
double cr2res_qc_wave_resol_fwhm (const cpl_bivector *spec, double *wl)
 Computes the lines Fwhm and return the smallest.
 
double cr2res_qc_overexposed (const cpl_image *ima, const cpl_table *tw, int order_idx)
 Computes the Overexposed fraction.
 
double cr2res_qc_obs_nodding_signal (const cpl_table *extracted)
 Computes the integrated flux over part of the spectrum.
 
double cr2res_qc_obs_nodding_standard_flux (const cpl_table *extracted, char *setting)
 Computes the standard flux over part of the spectrum.
 
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.
 
double cr2res_qc_compute_snr (cpl_vector *spec, cpl_vector *err)
 Computes the SNR of one spectrum.
 
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.
 
double cr2res_qc_compute_der_snr (cpl_vector *spec, cpl_vector *err)
 Computes the DER SNR of one spectrum.
 
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.
 
int cr2res_qc_numsat (const cpl_frameset *frameset)
 Calculate the number of saturated pixels.
 

Detailed Description

Function Documentation

◆ cr2res_dark_qc_ron()

double cr2res_dark_qc_ron ( const cpl_image *  ima1,
const cpl_image *  ima2,
int  hsize,
int  nsamples,
int  ndit 
)

The Read Out Noise computation.

Parameters
ima1the first input image
ima2the second input image
hsize
nsamples
nditthe NDIT
Returns
the RON or -1 in error case

Definition at line 74 of file cr2res_qc.c.

◆ cr2res_qc_compute_der_snr()

double cr2res_qc_compute_der_snr ( cpl_vector *  spec,
cpl_vector *  err 
)

Computes the DER SNR of one spectrum.

Parameters
specThe spectrum
errThe error
Returns
SNR value (double)

Definition at line 1157 of file cr2res_qc.c.

Referenced by cr2res_qc_der_snr().

◆ cr2res_qc_compute_snr()

double cr2res_qc_compute_snr ( cpl_vector *  spec,
cpl_vector *  err 
)

Computes the SNR of one spectrum.

Parameters
specThe spectrum
errThe error
Returns
SNR value (double)

Definition at line 1065 of file cr2res_qc.c.

Referenced by cr2res_qc_snr().

◆ cr2res_qc_der_snr()

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.

Parameters
twThe TW table
extractedThe Extracted table
out_order_idx_values[out] The order values
out_nb_order_idx_values[out] The number of order values
Returns
An array of size out_nb_order_idx_values with the SNRs values

Definition at line 1103 of file cr2res_qc.c.

References cr2res_extract_EXTRACT1D_get_spectrum(), cr2res_qc_compute_der_snr(), and cr2res_trace_get_order_idx_values().

◆ cr2res_qc_detlin()

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.

Parameters
coeffsThe detector non linearity coefficients
min_level[out] min level
max_level[out] max level
Returns
The computed median or -1.0 in error case

Definition at line 156 of file cr2res_qc.c.

References cr2res_detlin_correct(), hdrl_image_add_scalar(), hdrl_image_delete(), hdrl_image_get_image(), hdrl_image_get_mask(), hdrl_image_get_size_x(), hdrl_image_get_size_y(), hdrl_image_new(), hdrl_image_reject_from_mask(), hdrl_image_reject_value(), and hdrl_imagelist_get().

◆ cr2res_qc_detlin_stat()

int cr2res_qc_detlin_stat ( const hdrl_imagelist *  hdrl_coeffs,
double *  meda,
double *  medb,
double *  medc,
double *  meda_err 
)

Computes the detlin coeffs statѕ

Parameters
coeffsThe detector non linearity coefficients
meda[out] median of a coeffs
medb[out] median of a coeffs
medc[out] median of a coeffs
meda_err[out] median of a coeffs errors
Returns
0 if ok

Definition at line 111 of file cr2res_qc.c.

References hdrl_image_get_error(), hdrl_image_get_image(), and hdrl_imagelist_get().

◆ cr2res_qc_flat_order_positions()

int cr2res_qc_flat_order_positions ( const cpl_table *  tw,
int **  order_nb,
double **  order_pos,
int *  nbvals 
)

Compute the central orders positions.

Parameters
twtrave Wave table
order_nb[out] Array of orders numbers
order_pos[out] Array of orders positions
nbvals[out] Size of the arrays
Returns
0 if ok, -1 otherwise

Definition at line 235 of file cr2res_qc.c.

References cr2res_trace_get_order_idx_values(), cr2res_trace_get_trace_ypos(), and cr2res_trace_slit_fraction_info().

◆ cr2res_qc_flat_s2n()

double cr2res_qc_flat_s2n ( const cpl_table *  extracted)

Computes the S2N on the flat.

Parameters
extractedThe extracted spectrum from the flat ie blaze
Returns
The S2N Compute for each spectrum of the input EXTRACT_1D table : median(snr) Return the median of the medians

Definition at line 375 of file cr2res_qc.c.

References cr2res_dfs_SPEC_colname_parse(), and cr2res_dfs_SPEC_ERR_colname().

◆ cr2res_qc_flat_trace_center_y()

double cr2res_qc_flat_trace_center_y ( const cpl_table *  trace)

Computes the mean Y coord of the central order.

Parameters
tracethe trace table
Returns
The computed Y coordinate or -1.0 in error case

Definition at line 325 of file cr2res_qc.c.

References cr2res_get_trace_numbers(), cr2res_trace_get_order_idx_values(), and cr2res_trace_get_ycen().

◆ cr2res_qc_lines_collect()

cpl_vector * cr2res_qc_lines_collect ( double  wmin,
double  wmax 
)

Collect lines between 2 wavelengths.

Parameters
wstart
wstop
Returns
the vector with the collected lines

Definition at line 512 of file cr2res_qc.c.

Referenced by cr2res_qc_lines_intens_bgd(), cr2res_qc_wave_lamp_effic(), and cr2res_qc_wave_resol_fwhm().

◆ cr2res_qc_lines_intens_bgd()

cpl_bivector * cr2res_qc_lines_intens_bgd ( const cpl_bivector *  spec)

Computes the lines intensities / background.

Parameters
extractedextracted spectrum
Returns
the bivector withe the lines intens/bgd

Definition at line 612 of file cr2res_qc.c.

References cr2res_qc_lines_collect().

◆ cr2res_qc_numsat()

int cr2res_qc_numsat ( const cpl_frameset *  frameset)

Calculate the number of saturated pixels.

Parameters
frameset- the input RAW frames
Returns
the max number of saturated pixels (over all detectors)

Definition at line 1290 of file cr2res_qc.c.

References cr2res_io_load_image(), hdrl_image_delete(), and hdrl_image_get_image().

◆ cr2res_qc_obs_nodding_signal()

double cr2res_qc_obs_nodding_signal ( const cpl_table *  extracted)

Computes the integrated flux over part of the spectrum.

Parameters
extractedExtracted spectrum table
Returns
the computed signal

Definition at line 845 of file cr2res_qc.c.

References cr2res_dfs_SPEC_colname().

◆ cr2res_qc_obs_nodding_standard_flux()

double cr2res_qc_obs_nodding_standard_flux ( const cpl_table *  extracted,
char *  setting 
)

Computes the standard flux over part of the spectrum.

Parameters
extractedExtracted spectrum table
settingThe setting
Returns
the computed standard flux

Definition at line 892 of file cr2res_qc.c.

References cr2res_dfs_SPEC_colname(), and cr2res_dfs_WAVELENGTH_colname().

◆ cr2res_qc_obs_slit_psf()

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.

Parameters
slitfuSlit func table
order_idxpOrder index
Returns
The computed FWHM for this order

Definition at line 1208 of file cr2res_qc.c.

References cr2res_dfs_SLIT_FUNC_colname().

◆ cr2res_qc_overexposed()

double cr2res_qc_overexposed ( const cpl_image *  ima,
const cpl_table *  tw,
int  order_idx 
)

Computes the Overexposed fraction.

Parameters
imathe image (with BPM)
twthe TW table
order_idxthe order index
Returns
the computed overexposed value

Definition at line 796 of file cr2res_qc.c.

References cr2res_trace_gen_image().

◆ cr2res_qc_snr()

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.

Parameters
twThe TW table
extractedThe Extracted table
out_order_idx_values[out] The order values
out_nb_order_idx_values[out] The number of order values
Returns
An array of size out_nb_order_idx_values with the SNRs values

Definition at line 1010 of file cr2res_qc.c.

References cr2res_extract_EXTRACT1D_get_spectrum(), cr2res_qc_compute_snr(), and cr2res_trace_get_order_idx_values().

◆ cr2res_qc_wave_central()

double cr2res_qc_wave_central ( const cpl_table *  tw,
int  order_idx 
)

Computes the central WLEN of a given order.

Parameters
twthe TW table
orderthe order index
Returns
the computed number or -1.0 in error case

Definition at line 452 of file cr2res_qc.c.

References cr2res_trace_get_wl().

Referenced by cr2res_wave_apply().

◆ cr2res_qc_wave_disp()

double cr2res_qc_wave_disp ( const cpl_table *  tw,
int  order_idx 
)

Computes the dispersion of a given order.

Parameters
twthe TW table
orderthe order index
Returns
the computed number or -1.0 in error case

Definition at line 480 of file cr2res_qc.c.

References cr2res_trace_get_wl().

Referenced by cr2res_wave_apply().

◆ cr2res_qc_wave_lamp_effic()

double cr2res_qc_wave_lamp_effic ( const cpl_bivector *  spec)

Computes the lamp efficiency.

Parameters
extractedextracted spectrum
Returns
the computed resolution

Definition at line 656 of file cr2res_qc.c.

References cr2res_qc_lines_collect().

Referenced by cr2res_wave_1d().

◆ cr2res_qc_wave_line_fwhm()

double cr2res_qc_wave_line_fwhm ( const cpl_bivector *  spec,
double  wl,
double *  peak_height 
)

Computes one line Fwhm.

Parameters
specspectrum
wlline position
peak_height[out] Fitted Peak height
Returns
the computed fwhm

Definition at line 546 of file cr2res_qc.c.

Referenced by cr2res_qc_wave_resol_fwhm().

◆ cr2res_qc_wave_resol_fwhm()

double cr2res_qc_wave_resol_fwhm ( const cpl_bivector *  spec,
double *  wl 
)

Computes the lines Fwhm and return the smallest.

Parameters
extractedextracted spectrum
wl[out] the wavelength of the thinnest line
Returns
the thinnest fwhm

Definition at line 710 of file cr2res_qc.c.

References cr2res_qc_lines_collect(), and cr2res_qc_wave_line_fwhm().

Referenced by cr2res_wave_1d().