Computes detector’s gain/linearity-map
This recipe computes detector linearity coefficients and gain Input Frames :
arm = UVB-VIS: - A set of n RAW linearity frames (Format=RAW, n >=8, Tag = LINEARITY_arm_ON) - A set of n RAW bias frames (Format=RAW, n >=1, Tag = LINEARITY_arm_OFF) arm = NIR: - A set of n RAW linearity on frames (Format=RAW, n >=8, Tag = LINEARITY_arm_ON) - A set of n RAW linearity off frames (Format=RAW, n >=8, Tag = LINEARITY_arm_OFF) - [OPTIONAL] a static bad pixel map (PRO.CATG=BP_MAP_RP_arm) Note: on and off frames are taken in pairs sequence: OFF-ON-ON-OFF, at least 16 frames.
Create an object for the recipe xsh_lingain.
import cpl
xsh_lingain = cpl.Recipe("xsh_lingain")
If ‘no’, temporary files are deleted. (str; default: ‘no’) [default=”no”].
Additional xshooter debug level. One of ‘none’, ‘low’, ‘medium’, ‘high’ (str; default: ‘none’) [default=”none”].
Add timestamp to product file name. (bool; default: False) [default=False].
Integer representation of the bits to be considered bad when decoding the bad pixel mask pixel values. (long; default: 2144337919) [default=2144337919].
Method to be used when computing GAIN. Methods appliable: <PTC | MED>. By default PTC method will be applied. (str; default: ‘PTC’) [default=”PTC”].
Polynomial order for the fit (Linearity) (long; default: 3) [default=3].
Kappa value for the kappa-sigma clipping (Gain) (float; default: 3.0) [default=3.0].
Number of iterations to compute rms (Gain) (long; default: 5) [default=5].
x coordinate of the lower-left point of the region of interest. If not modified, default value will be 1. (long; default: -1) [default=-1].
y coordinate of the lower-left point of the region of interest. If not modified, default value will be 1. (long; default: -1) [default=-1].
x coordinate of the upper-right point of the region of interest. If not modified, default value will be X dimension of the input image. (long; default: -1) [default=-1].
y coordinate of the upper-right point of the region of interest. If not modified, default value will be Y dimension of the input image. (long; default: -1) [default=-1].
User reference level (long; default: 10000) [default=10000].
De-/Activate intermediate products (bool; default: False) [default=False].
De-/Activate the autocorr option (bool; default: False) [default=False].
De-/Activate the collapse option (bool; default: True) [default=True].
De-/Activate the image rescale option (bool; default: True) [default=True].
De-/Activate the computation with pixel to pixel accuracy (bool; default: True) [default=True].
De-/Activate the binary bpm option (bool; default: False) [default=False].
Maximum x-shift for the autocorr (long; default: 26) [default=26].
Upper limit of Median flux to be filtered (long; default: -1) [default=-1].
Maximum y-shift for the autocorr (long; default: 26) [default=26].
Tolerance for pair discrimination (float; default: 0.1) [default=0.1].
Generate PAF file (bool; default: False) [default=False].
Specific name for PAF file (str; default: ‘xsh_lingain’) [default=”xsh_lingain”].
Activate the multi-exts option. Choose -1 to process all extensions. Choose an extension number to process the appropriate extension. (long; default: 0) [default=0].
Method for computing Fixed Pattern Noise (SMOOTH or HISTOGRAM) (str; default: ‘HISTOGRAM’) [default=”HISTOGRAM”].
template size in pixels for smoothing during FPN computation (only for SMOOTH method) (long; default: 13) [default=13].
all frames with mean saturation above the limit would not be used in calculation (float; default: 65535.0) [default=65535.0].
if TRUE, the recipe writes as many COEFFS_CUBE_Pi (i=0..order) as the value of the order parameter in a separate file (bool; default: False) [default=False].
x coord of the lower-left point of the first field used for contamination measurement. If not modified, default value will be 1. (long; default: -1) [default=-1].
y coord of the lower-left point of the first field used for contamination measurement. If not modified, default value will be 1. (long; default: -1) [default=-1].
x coord of the upper-right point of the first field used for contamination measurement. If not modified, default value will be X dimension of the input image. (long; default: -1) [default=-1].
y coord of the upper-right point of the first field used for contamination measurement. If not modified, default value will be Y dimension of the input image. (long; default: -1) [default=-1].
x coord of the lower-left point of the second field used for contamination measurement. If not modified, default value will be 1. (long; default: -1) [default=-1].
y coord of the lower-left point of the second field used for contamination measurement. If not modified, default value will be 1. (long; default: -1) [default=-1].
x coord of the upper-right point of the second field used for contamination measurement. If not modified, default value will be half of the X dimension of the input image. (long; default: -1) [default=-1].
y coord of the upper-right point of the second field used for contamination measurement. If not modified, default value will be half of the Y dimension of the input image. (long; default: -1) [default=-1].
x coord of the lower-left point of the third field used for contamination measurement. If not modified, default value will be 1. (long; default: -1) [default=-1].
y coord of the lower-left point of the third field used for contamination measurement. If not modified, default value will be half of the Y dimension of the input image. (long; default: -1) [default=-1].
x coord of the upper-right point of the third field used for contamination measurement. If not modified, default value will be half of X dimension of the image. (long; default: -1) [default=-1].
y coord of the upper-right point of the third field used for contamination measurement. If not modified, default value will be Y dimension of the image. (long; default: -1) [default=-1].
x coord of the lower-left point of the fourth field used for contamination measurement. If not modified, default value will be half of X dimension of the image. (long; default: -1) [default=-1].
y coord of the lower-left point of the fourth field used for contamination measurement. If not modified, default value will be half of the Y dimension of the input image. (long; default: -1) [default=-1].
x coord of the upper-right point of the fourth field used for contamination measurement. If not modified, default value will be X dimension of the image. (long; default: -1) [default=-1].
y coord of the upper-right point of the fourth field used for contamination measurement. If not modified, default value will be Y dimension of the input image. (long; default: -1) [default=-1].
x coord of the lower-left point of the fifth field used for contamination measurement. If not modified, default value will be half of the X dimension of the input image. (long; default: -1) [default=-1].
y coord of the lower-left point of the fifth field used for contamination measurement. If not modified, default value will be 1. (long; default: -1) [default=-1].
x coord of the upper-right point of the fifth field used for contamination measurement. If not modified, default value will be X dimension of the image. (long; default: -1) [default=-1].
y coord of the upper-right point of the fifth field used for contamination measurement. If not modified, default value will be half of Y dimension of the input image. (long; default: -1) [default=-1].
The following code snippet shows the default settings for the available parameters.
import cpl
xsh_lingain = cpl.Recipe("xsh_lingain")
xsh_lingain.param.keep_temp = "no"
xsh_lingain.param.debug_level = "none"
xsh_lingain.param.time_stamp = False
xsh_lingain.param.decode_bp = 2144337919
xsh_lingain.param.method = "PTC"
xsh_lingain.param.order = 3
xsh_lingain.param.kappa = 3.0
xsh_lingain.param.niter = 5
xsh_lingain.param.llx = -1
xsh_lingain.param.lly = -1
xsh_lingain.param.urx = -1
xsh_lingain.param.ury = -1
xsh_lingain.param.ref_level = 10000
xsh_lingain.param.intermediate = False
xsh_lingain.param.autocorr = False
xsh_lingain.param.collapse = True
xsh_lingain.param.rescale = True
xsh_lingain.param.pix2pix = True
xsh_lingain.param.bpmbin = False
xsh_lingain.param.m = 26
xsh_lingain.param.filter = -1
xsh_lingain.param.n = 26
xsh_lingain.param.tolerance = 0.1
xsh_lingain.param.pafgen = False
xsh_lingain.param.pafname = "xsh_lingain"
xsh_lingain.param.exts = 0
xsh_lingain.param.fpn_method = "HISTOGRAM"
xsh_lingain.param.fpn_smooth = 13
xsh_lingain.param.saturation_limit = 65535.0
xsh_lingain.param.coeffs_cube_split = False
xsh_lingain.param.llx1 = -1
xsh_lingain.param.lly1 = -1
xsh_lingain.param.urx1 = -1
xsh_lingain.param.ury1 = -1
xsh_lingain.param.llx2 = -1
xsh_lingain.param.lly2 = -1
xsh_lingain.param.urx2 = -1
xsh_lingain.param.ury2 = -1
xsh_lingain.param.llx3 = -1
xsh_lingain.param.lly3 = -1
xsh_lingain.param.urx3 = -1
xsh_lingain.param.ury3 = -1
xsh_lingain.param.llx4 = -1
xsh_lingain.param.lly4 = -1
xsh_lingain.param.urx4 = -1
xsh_lingain.param.ury4 = -1
xsh_lingain.param.llx5 = -1
xsh_lingain.param.lly5 = -1
xsh_lingain.param.urx5 = -1
xsh_lingain.param.ury5 = -1
You may also set or overwrite some or all parameters by the recipe parameter param, as shown in the following example:
import cpl
xsh_lingain = cpl.Recipe("xsh_lingain")
[...]
res = xsh_lingain( ..., param = {"keep_temp":"no", "debug_level":"none"})
See also
cpl.Recipe for more information about the recipe object.
Please report any problems to Lander de Bilbao,A.Modigliani. Alternatively, you may send a report to the ESO User Support Department.
This file is part of the X-shooter Instrument Pipeline Copyright (C) 2006 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: Lander de Bilbao,A.Modigliani <amodigli@eso.org>