.TH XSH_LINGAIN "7" "2.5.2" "xsh_lingain" "xshoo recipes"
.SH NAME
xsh_lingain \- Computes detector's gain/linearity\-map

.SH SYNOPSIS
esorex
.B xsh_lingain
[OPTIONS] FILE.sof

.SH DESCRIPTION
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.
.PP
Products : 
  \- A linearity map table, PRO.CATG = BP_MAP_LIN_NIR
  \- A gain table, PRO.CATG = GAIN_INFO
  \- A cube cointaining the linearity coefficients, PRO.CATG = COEFFS_CUBE_arm
  \- A linearity map image (RAW format), PRO.CATG = RAW_BP_MAP_NL_arm
  \- A linearity map image (PRE format), PRO.CATG = BP_MAP_NL_arm


.SH OPTIONS
.TP
\fB\-\-keep\-temp\fR \fI<str>\fR
If \'no\', temporary files are deleted. (str; default: \'no\'). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_lingain.keep\-temp\fR [default = \fIno\fR].
.TP
\fB\-\-debug\-level\fR \fI<str>\fR
Additional xshooter debug level. One of \'none\', \'low\', \'medium\',
\'high\' (str; default: \'none\'). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_lingain.debug\-level\fR [default = \fInone\fR].
.TP
\fB\-\-time\-stamp\fR \fI<bool>\fR
Add timestamp to product file name. (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_lingain.time\-stamp\fR [default = \fIFalse\fR].
.TP
\fB\-\-decode\-bp\fR \fI<long>\fR
Integer representation of the bits to be considered bad when decoding
the bad pixel mask pixel values. (long; default: 2144337919). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_lingain.decode\-bp\fR [default = \fI2144337919\fR].
.TP
\fB\-\-method\fR \fI<str>\fR
Method to be used when computing GAIN. Methods appliable: <PTC | MED>.
By default PTC method will be applied. (str; default: \'PTC\'). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.method\fR [default = \fIPTC\fR].
.TP
\fB\-\-order\fR \fI<long>\fR
Polynomial order for the fit (Linearity) (long; default: 3). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.order\fR [default = \fI3\fR].
.TP
\fB\-\-kappa\fR \fI<float>\fR
Kappa value for the kappa\-sigma clipping (Gain) (float; default: 3.0). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.kappa\fR [default = \fI3.0\fR].
.TP
\fB\-\-niter\fR \fI<long>\fR
Number of iterations to compute rms (Gain) (long; default: 5). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.niter\fR [default = \fI5\fR].
.TP
\fB\-\-llx\fR \fI<long>\fR
x coordinate of the lower\-left point of the region of interest. If not
modified, default value will be 1. (long; default: \-1). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.llx\fR [default = \fI\-1\fR].
.TP
\fB\-\-lly\fR \fI<long>\fR
y coordinate of the lower\-left point of the region of interest. If not
modified, default value will be 1. (long; default: \-1). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.lly\fR [default = \fI\-1\fR].
.TP
\fB\-\-urx\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.urx\fR [default = \fI\-1\fR].
.TP
\fB\-\-ury\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ury\fR [default = \fI\-1\fR].
.TP
\fB\-\-ref_level\fR \fI<long>\fR
User reference level (long; default: 10000). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ref_level\fR [default = \fI10000\fR].
.TP
\fB\-\-intermediate\fR \fI<bool>\fR
De\-/Activate intermediate products (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.intermediate\fR [default = \fIFalse\fR].
.TP
\fB\-\-autocorr\fR \fI<bool>\fR
De\-/Activate the autocorr option (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.autocorr\fR [default = \fIFalse\fR].
.TP
\fB\-\-collapse\fR \fI<bool>\fR
De\-/Activate the collapse option (bool; default: True). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.collapse\fR [default = \fITrue\fR].
.TP
\fB\-\-rescale\fR \fI<bool>\fR
De\-/Activate the image rescale option (bool; default: True). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.rescale\fR [default = \fITrue\fR].
.TP
\fB\-\-pix2pix\fR \fI<bool>\fR
De\-/Activate the computation with pixel to pixel accuracy (bool;
default: True). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.pix2pix\fR [default = \fITrue\fR].
.TP
\fB\-\-bpmbin\fR \fI<bool>\fR
De\-/Activate the binary bpm option (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.bpmbin\fR [default = \fIFalse\fR].
.TP
\fB\-\-m\fR \fI<long>\fR
Maximum x\-shift for the autocorr (long; default: 26). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.m\fR [default = \fI26\fR].
.TP
\fB\-\-filter\fR \fI<long>\fR
Upper limit of Median flux to be filtered (long; default: \-1). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.filter\fR [default = \fI\-1\fR].
.TP
\fB\-\-n\fR \fI<long>\fR
Maximum y\-shift for the autocorr (long; default: 26). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.n\fR [default = \fI26\fR].
.TP
\fB\-\-tolerance\fR \fI<float>\fR
Tolerance for pair discrimination (float; default: 0.1). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.tolerance\fR [default = \fI0.1\fR].
.TP
\fB\-\-pafgen\fR \fI<bool>\fR
Generate PAF file (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.pafgen\fR [default = \fIFalse\fR].
.TP
\fB\-\-pafname\fR \fI<str>\fR
Specific name for PAF file (str; default: \'xsh_lingain\'). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.pafname\fR [default = \fIxsh_lingain\fR].
.TP
\fB\-\-exts\fR \fI<long>\fR
Activate the multi\-exts option. Choose \-1 to process all extensions.
Choose an extension number to process the appropriate extension.
(long; default: 0). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.exts\fR [default = \fI0\fR].
.TP
\fB\-\-fpn_method\fR \fI<str>\fR
Method for computing Fixed Pattern Noise (SMOOTH or HISTOGRAM) (str;
default: \'HISTOGRAM\'). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.fpn_method\fR [default = \fIHISTOGRAM\fR].
.TP
\fB\-\-fpn_smooth\fR \fI<long>\fR
template size in pixels for smoothing during FPN computation (only for
SMOOTH method) (long; default: 13). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.fpn_smooth\fR [default = \fI13\fR].
.TP
\fB\-\-saturation_limit\fR \fI<float>\fR
all frames with mean saturation above the limit would not be used in
calculation (float; default: 65535.0). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.saturation_limit\fR [default = \fI65535.0\fR].
.TP
\fB\-\-coeffs_cube_split\fR \fI<bool>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.coeffs_cube_split\fR [default = \fIFalse\fR].
.TP
\fB\-\-llx1\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.llx1\fR [default = \fI\-1\fR].
.TP
\fB\-\-lly1\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.lly1\fR [default = \fI\-1\fR].
.TP
\fB\-\-urx1\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.urx1\fR [default = \fI\-1\fR].
.TP
\fB\-\-ury1\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ury1\fR [default = \fI\-1\fR].
.TP
\fB\-\-llx2\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.llx2\fR [default = \fI\-1\fR].
.TP
\fB\-\-lly2\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.lly2\fR [default = \fI\-1\fR].
.TP
\fB\-\-urx2\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.urx2\fR [default = \fI\-1\fR].
.TP
\fB\-\-ury2\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ury2\fR [default = \fI\-1\fR].
.TP
\fB\-\-llx3\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.llx3\fR [default = \fI\-1\fR].
.TP
\fB\-\-lly3\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.lly3\fR [default = \fI\-1\fR].
.TP
\fB\-\-urx3\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.urx3\fR [default = \fI\-1\fR].
.TP
\fB\-\-ury3\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ury3\fR [default = \fI\-1\fR].
.TP
\fB\-\-llx4\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.llx4\fR [default = \fI\-1\fR].
.TP
\fB\-\-lly4\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.lly4\fR [default = \fI\-1\fR].
.TP
\fB\-\-urx4\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.urx4\fR [default = \fI\-1\fR].
.TP
\fB\-\-ury4\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ury4\fR [default = \fI\-1\fR].
.TP
\fB\-\-llx5\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.llx5\fR [default = \fI\-1\fR].
.TP
\fB\-\-lly5\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.lly5\fR [default = \fI\-1\fR].
.TP
\fB\-\-urx5\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.urx5\fR [default = \fI\-1\fR].
.TP
\fB\-\-ury5\fR \fI<long>\fR
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). The full name of this option for the EsoRex configuration
file is \fBxshoo.xsh_lingain.ury5\fR [default = \fI\-1\fR].

.PP
Note that it is possible to create a configuration file containing these
options, along with suitable default values. Please refer to the details
provided by the 'esorex \-\-help' command.

.SH SEE ALSO
The full documentation for the xshoo pipeline can be downloaded as 
a PDF file using the following URL:
.IP
.B ftp://ftp.eso.org/pub/dfs/pipelines/xshoo/xshoo\-pipeline\-manual\-12.1.pdf
.PP
An overview over the existing ESO pipelines can be found on the web page
\fBhttp://www.eso.org/sci/software/pipelines/\fR.
.PP
Basic documentation about the EsoRex program can be found at the esorex (1) 
man page.
.PP
It is possible to call the pipelines from python using the python\-cpl package.
See \fBhttp://packages.python.org/python\-cpl/index.html\fR for further
information.
.PP
The other recipes of the xshoo pipeline are
.IR xsh_cfg_recover (7),
.IR xsh_geom_ifu (7),
.IR xsh_wavecal (7),
.IR xsh_scired_slit_nod (7),
.IR xsh_respon_slit_nod (7),
.IR xsh_mdark (7),
.IR xsh_respon_slit_offset (7),
.IR xsh_orderpos (7),
.IR xsh_scired_ifu_stare_drl (7),
.IR xsh_scired_ifu_stare (7),
.IR xsh_flexcomp (7),
.IR xsh_scired_ifu_offset_drl (7),
.IR xsh_util_physmod (7),
.IR xsh_respon_slit_stare (7),
.IR xsh_2dmap (7),
.IR xsh_mflat (7),
.IR xsh_mbias (7),
.IR xsh_predict (7),
.IR xsh_scired_ifu_offset (7),
.IR xsh_scired_slit_stare (7),
.IR xsh_scired_slit_offset (7)

.SH VERSION
xsh_lingain 2.5.2

.SH AUTHOR
Lander de Bilbao,A.Modigliani <amodigli@eso.org>

.SH BUG REPORTS
Please report any problems to amodigli@eso.org. Alternatively, you may send a report to the ESO User Support Department <usd\-help@eso.org>.

.SH LICENSE
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
