.TH XSH_CFG_RECOVER "7" "2.5.2" "xsh_cfg_recover" "xshoo recipes"
.SH NAME
xsh_cfg_recover \- Optimizes a model configuration to match data taken after a major format change

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

.SH DESCRIPTION
This recipe creates a wavelength solution and an order table.
.PP
  Input Frames :
    \- [UVB, VIS] A RAW frame (Format = RAW, Tag = FMTCHK_arm)
    \- [NIR] Two RAW frames (Format = RAW, Tag = FMTCHK_arm_ON,FMTCHK_arm_OFF)
    \- The old model cfg table (Format = TABLE, Tag = XSH_MOD_CFG_TAB_arm)
    \- A ref. line list. The model computes corresponding positions 
      (Format = TABLE, Tag = ARC_LINE_LIST_arm)
    \- [UVB,VIS,OPTIONAL] A master bias (Format = PRE, Tag = MASTER_BIAS_arm)
    \- [UVB,VIS,OPTIONAL] A master dark (Format = PRE, Tag = MASTER_DARK_arm)
    \- [OPTIONAL\-Required if method=pm,peaks] 
     An order table (Format = TABLE, Tag = ORDER_TAB_CENTR_arm)
    \- [OPTIONAL\-Required if first\-anneal=TRUE] 
      A table with measured line positions (Format = TABLE, Tag = XSH_MEASCOORD_arm)
  Products : 
    \- if first\-anneal=FALSE & last\-step=FALSE
      nothing
    \- if first\-anneal=TRUE & last\-step=FALSE
      an optimized model configuration, PRO.CATG=XSH_MOD_CFG_arm
    \- if last\-step=TRUE
      an optimized model configuration, PRO.CATG=XSH_MOD_FAN_arm
      an optimized model configuration, PRO.CATG=XSH_MOD_CFG_OPT_arm
      an quality control table, PRO.CATG=MODEL_GUESS_XY_arm
      the model theoretical map corresponding to the optimized model config,
      PRO.CATG=THEO_TAB_MULT_arm, THEO_TAB_IFU_arm, and THEO_TAB_SING_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_cfg_recover.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_cfg_recover.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_cfg_recover.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_cfg_recover.decode\-bp\fR [default = \fI2144337919\fR].
.TP
\fB\-\-first\-anneal\fR \fI<bool>\fR
Run first annealing (TRUE) or not (FALSE)See recipe man\-page % Input
frames (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.first\-anneal\fR [default = \fIFalse\fR].
.TP
\fB\-\-arm\fR \fI<str>\fR
Arm setting:  (str; default: \'vis\'). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_model_compute.arm\fR [default = \fIvis\fR].
.TP
\fB\-\-name_i\fR \fI<str>\fR
Filename with wavelength,x,y,order:  (str; default: \'line_xy_ord.txt\'). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_model_compute.name_i\fR [default = \fIline_xy_ord.txt\fR].
.TP
\fB\-\-niter\fR \fI<long>\fR
No of iterations for first anneal (long; default: 100000). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_model_compute.niter\fR [default = \fI100000\fR].
.TP
\fB\-\-coord_frame\fR \fI<long>\fR
Co\-ordinate frame for centroids (0=raw,1=pre) (long; default: 1). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_model_compute.coord_frame\fR [default = \fI1\fR].
.TP
\fB\-\-last\-step\fR \fI<bool>\fR
Run last step (TRUE) or not (FALSE)See recipe man\-page % Input frames
(bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.last\-step\fR [default = \fIFalse\fR].
.TP
\fB\-\-plot\fR \fI<bool>\fR
Display plot (TRUE) or not (FALSE) (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.plot\fR [default = \fIFalse\fR].
.TP
\fB\-\-ima_tresh_min\fR \fI<float>\fR
Min thresh raw image. (float; default: 40.0). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.ima_thresh_min\fR [default = \fI40.0\fR].
.TP
\fB\-\-cor_prescan\fR \fI<bool>\fR
Correct for prescan (bool; default: False). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.cor_prescan\fR [default = \fIFalse\fR].
.TP
\fB\-\-method\fR \fI<str>\fR
Model predictions correction method. safefit: safe fitgfit: 2D
Gaussian line fitpeaks: line peaks detectionpm: line peaks detection &
pattern match (str; default: \'safefit\'). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.method\fR [default = \fIsafefit\fR].
.TP
\fB\-\-offx\fR \fI<float>\fR
X offset to model predictions (float; default: 0.0). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.offx\fR [default = \fI0.0\fR].
.TP
\fB\-\-offy\fR \fI<float>\fR
Y offset to model predictions (float; default: 0.0). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.offy\fR [default = \fI0.0\fR].
.TP
\fB\-\-slit\fR \fI<long>\fR
Extraction slit (long; default: 5). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.slit\fR [default = \fI5\fR].
.TP
\fB\-\-gfit_box_sy\fR \fI<long>\fR
Gauss fit Y search box size for lines on actual frame (long; default:
20). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.gfit_box_sy\fR [default = \fI20\fR].
.TP
\fB\-\-peak_line_fwhm\fR \fI<long>\fR
The FWHM used in line convolution, in pixel units (long; default: 4). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.peak_line_fwhm\fR [default = \fI4\fR].
.TP
\fB\-\-peak_kappa\fR \fI<float>\fR
The kappa value, used to identify line peaks if
max>kappa*stdev+median, max is a valid peak where max, stdev,median
are computed on the extracted spectrum (float; default: 5.0). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.peak_kappa\fR [default = \fI5.0\fR].
.TP
\fB\-\-peak_factor\fR \fI<float>\fR
Relative Intensity threshold factor for line peaks detection (float;
default: 10.0). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.peak_factor\fR [default = \fI10.0\fR].
.TP
\fB\-\-peak_match_x\fR \fI<long>\fR
Radii for line peaks matches (long; default: 10). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.peak_match_x\fR [default = \fI10\fR].
.TP
\fB\-\-peak_match_y\fR \fI<long>\fR
Radii for line peaks matches (long; default: 20). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.peak_match_y\fR [default = \fI20\fR].
.TP
\fB\-\-pm_ord_sel\fR \fI<long>\fR
From guess line and peaks positions are extracted the ones in the
range [ord_min,ord_min+pm_ord_sel]  (long; default: 1). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.pm_ord_sel\fR [default = \fI1\fR].
.TP
\fB\-\-pm_radius\fR \fI<float>\fR
Search radius applied in final pattern matching (data units). (float;
default: 20.0). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.pm_radius\fR [default = \fI20.0\fR].
.TP
\fB\-\-pm_tolerance\fR \fI<float>\fR
Max relative difference of angles and scales from their median value
for match acceptance. (float; default: 0.1). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.pm_tolerance\fR [default = \fI0.1\fR].
.TP
\fB\-\-anneal_niter\fR \fI<long>\fR
Simulated annealing iterations (long; default: 1000). The full name of this option for the EsoRex configuration
file is \fBxsh.xsh_cfg_recover.anneal_niter\fR [default = \fI1000\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_lingain (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_cfg_recover 2.5.2

.SH AUTHOR
A. Modigliani, P. Bristow <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
