Master flat determination
This recipe reduce normal raw flat fields.
The input files are a set of flat fields with tag FLAT_LAMP optionally one may have in input also several bad pixel maps to be coadded.
The main products are a master flat field (PRO.CATG=MASTER_FLAT_LAMP) image a bad pixel map (PRO.CATG=BP_MAP_NO), a master bad pixel map (PRO.CATG=MASTER_BP_MAP) resulting by the coaddition of all bad pixel maps.
Information on relevant parameters can be found with esorex –params sinfo_rec_mflat esorex –help sinfo_rec_mflat
Create an object for the recipe sinfo_rec_mflat.
import cpl
sinfo_rec_mflat = cpl.Recipe("sinfo_rec_mflat")
Overwrite DRS ini parameters: (bool; default: True) [default=True].
Correct for bad lines introduced by instrument software: (bool; default: False) [default=False].
Kappa sigma value (long; default: 18) [default=18].
Filtering radii applied during median filter. Should be small (long; default: 3) [default=3].
Density of pipeline products: 0 (low), 1 (low+skycor), 2 (med-QC), 3 (high-debug+skycor) (long; default: 2) [default=2].
Threshold Sigma Factor: to remove the column intensity tilt only pixels which lie within a defined noiselimit are used to fit a straight line (float; default: 5.0) [default=5.0].
Bad pixel Method Index1: median of nearest neighbors,2: absolute distances check, 3: mean of nearest spectral neighbors (long; default: 1) [default=1].
Factor: if |pixel - median| > factor * standard deviation -> then the pixel value is replaced by the median of the 8 nearest neighbors (float; default: 10.0) [default=10.0].
Iterations: number of iterations to of median filtering to find bad pixel clusters (long; default: 8) [default=8].
low_rejection: percentage of rejected low intensity pixels before averaging (float; default: 0.1) [default=0.1].
high_rejection: percentage of rejected high intensity pixels before averaging (float; default: 0.1) [default=0.1].
llx: to compute image statistics on a rectangularzone of the image the coordinates of the rectangle are needed:lower left x coordinate (long; default: 270) [default=270].
lly: to compute image statistics on a rectangularzone of the image the coordinates of the rectangle are needed:lower left y coordinate (long; default: 1000) [default=1000].
urx: to compute image statistics on a rectangularzone of the image the coordinates of the rectangle are needed:upper right x coordinate (long; default: 310) [default=310].
ury: to compute image statistics on a rectangularzone of the image the coordinates of the rectangle are needed:upper right y coordinate (long; default: 1200) [default=1200].
Threshold Index: indicator that indicates if the values beyond a threshold deviation from the mean are flagged as bad pixels (bool; default: True) [default=True].
Mean Factor: factor to the clean standard deviation to define the threshold deviation from the clean mean (float; default: 100.0) [default=100.0].
the minimum value of real data (float; default: 0.0) [default=0.0].
the minimum value of real data (float; default: 50000.0) [default=50000.0].
lower rejection: percentage of rejected low intensity pixels before averaging (float; default: 0.1) [default=0.1].
high rejection: percentage of rejected high intensity pixels before averaging (float; default: 0.1) [default=0.1].
Interpolation index switch: indicator if the bad pixels of the flatfield should be interpolated (bool; default: False) [default=False].
Max Rad: maximal pixel distance from bad pixel to take valid pixels (long; default: 4) [default=4].
indicator if a bad pixel mask should be generated or not (bool; default: False) [default=False].
Sigma Factor: factor of the sigma noise limit; to remove the column intensity tilt only pixels which lie within a defined noise limit are used to fit a straight line (float; default: 5.0) [default=5.0].
Factor: if |pixel - median| > factor * standard deviation -> then the pixel value is replaced by the median of the 8 nearest neighbors (float; default: 3.0) [default=3.0].
Iterations: number of iterations to of median filtering to find bad pixel clusters (long; default: 8) [default=8].
low rejection: Percentage for bad pixel low rejection (float; default: 10.0) [default=10.0].
high rejection: Percentage for bad pixel high rejection (float; default: 10.0) [default=10.0].
Lower Lext X corner (long; default: 1350) [default=1350].
Lower Lext Y corner (long; default: 1000) [default=1000].
Upper right X corner (long; default: 1390) [default=1390].
Upper right Y corner (long; default: 1200) [default=1200].
Treshold index: (bool; default: False) [default=False].
Mean Factor: factor to the clean standard deviation to define the threshold deviation from the clean mean (float; default: 10.0) [default=10.0].
qc_fpn_xmin1 (long; default: 512) [default=512].
qc_fpn_xmax1 (long; default: 1536) [default=1536].
qc_fpn_ymin1 (long; default: 512) [default=512].
qc_fpn_ymax1 (long; default: 1536) [default=1536].
qc_fpn_xmin2 (long; default: 1350) [default=1350].
qc_fpn_xmax2 (long; default: 1390) [default=1390].
qc_fpn_ymin2 (long; default: 1000) [default=1000].
qc_fpn_ymax2 (long; default: 1200) [default=1200].
qc_thresh_min (long; default: 0) [default=0].
qc_thresh_max (long; default: 49000) [default=49000].
The following code snippet shows the default settings for the available parameters.
import cpl
sinfo_rec_mflat = cpl.Recipe("sinfo_rec_mflat")
sinfo_rec_mflat.param.gen_overpar = True
sinfo_rec_mflat.param.lc_sw = False
sinfo_rec_mflat.param.lc_kappa = 18
sinfo_rec_mflat.param.lc_filt_rad = 3
sinfo_rec_mflat.param.product_density = 2
sinfo_rec_mflat.param.bp_norm_s_factor = 5.0
sinfo_rec_mflat.param.bp_norm_method_ind = 1
sinfo_rec_mflat.param.bp_norm_fct = 10.0
sinfo_rec_mflat.param.bp_norm_it = 8
sinfo_rec_mflat.param.bp_norm_lo_rej = 0.1
sinfo_rec_mflat.param.bp_norm_hi_rej = 0.1
sinfo_rec_mflat.param.bp_norm_llx = 270
sinfo_rec_mflat.param.bp_norm_lly = 1000
sinfo_rec_mflat.param.bp_norm_urx = 310
sinfo_rec_mflat.param.bp_norm_ury = 1200
sinfo_rec_mflat.param.bp_norm_thr_ind = True
sinfo_rec_mflat.param.bp_norm_mean_fct = 100.0
sinfo_rec_mflat.param.bp_norm_min_cut = 0.0
sinfo_rec_mflat.param.bp_norm_max_cut = 50000.0
sinfo_rec_mflat.param.lamp_flats_lo_rej = 0.1
sinfo_rec_mflat.param.lamp_flats_hi_rej = 0.1
sinfo_rec_mflat.param.lamp_flats_interpol_index = False
sinfo_rec_mflat.param.lamp_flats_max_rad = 4
sinfo_rec_mflat.param.lamp_flats_bad_ind = False
sinfo_rec_mflat.param.lamp_flats_sigma_factor = 5.0
sinfo_rec_mflat.param.lamp_flats_factor = 3.0
sinfo_rec_mflat.param.lamp_flats_iterations = 8
sinfo_rec_mflat.param.lamp_flats_bad_lo_rej = 10.0
sinfo_rec_mflat.param.lamp_flats_bad_hi_rej = 10.0
sinfo_rec_mflat.param.lamp_flats_llx = 1350
sinfo_rec_mflat.param.lamp_flats_lly = 1000
sinfo_rec_mflat.param.lamp_flats_rrx = 1390
sinfo_rec_mflat.param.lamp_flats_ury = 1200
sinfo_rec_mflat.param.lamp_flats_tresh_ind = False
sinfo_rec_mflat.param.lamp_flats_mean_factor = 10.0
sinfo_rec_mflat.param.lamp_flats_qc_fpn_xmin1 = 512
sinfo_rec_mflat.param.lamp_flats_qc_fpn_xmax1 = 1536
sinfo_rec_mflat.param.lamp_flats_qc_fpn_ymin1 = 512
sinfo_rec_mflat.param.lamp_flats_qc_fpn_ymax1 = 1536
sinfo_rec_mflat.param.lamp_flats_qc_fpn_xmin2 = 1350
sinfo_rec_mflat.param.lamp_flats_qc_fpn_xmax2 = 1390
sinfo_rec_mflat.param.lamp_flats_qc_fpn_ymin2 = 1000
sinfo_rec_mflat.param.lamp_flats_qc_fpn_ymax2 = 1200
sinfo_rec_mflat.param.lamp_flats_qc_thresh_min = 0
sinfo_rec_mflat.param.lamp_flats_qc_thresh_max = 49000
You may also set or overwrite some or all parameters by the recipe parameter param, as shown in the following example:
import cpl
sinfo_rec_mflat = cpl.Recipe("sinfo_rec_mflat")
[...]
res = sinfo_rec_mflat( ..., param = {"gen_overpar":True, "lc_sw":False})
See also
cpl.Recipe for more information about the recipe object.
Please report any problems to Andrea Modigliani. Alternatively, you may send a report to the ESO User Support Department.
This file is part of the SINFONI Instrument Pipeline Copyright (C) 2002,2003 European Southern Observatory
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Code author: Andrea Modigliani <Andrea.Modigliani@eso.org>