The sinfo_rec_detlin recipe
===============================================================

.. data:: sinfo_rec_detlin

Synopsis
--------

Detector's linearity & non linear bad pixels determination.

Description
-----------

This recipe computes detector non linearities and a bad pixel map.

The input files are increasing intensity raw flats
their associated tags should be LINEARITY_LAMP.

The output are: 
A table (PRO.CATG=LIN_DET_INFO) with information 
on the detector non linearities
A table (PRO.CATG=GAIN_INFO) with information on the detector gain
A cube (PRO.CATG=BP_COEFF) with the polynomial fit parameters 
of the detector non linearities
A bad pixel map (PRO.CATG=BP_MAP_NL)
Information on relevant parameters can be found with
esorex --params sinfo_rec_detlin
esorex --help sinfo_rec_detlin


Constructor
-----------

.. method:: cpl.Recipe("sinfo_rec_detlin")
   :noindex:

   Create an object for the recipe sinfo_rec_detlin.

::

   import cpl
   sinfo_rec_detlin = cpl.Recipe("sinfo_rec_detlin")

Parameters
----------

.. py:attribute:: sinfo_rec_detlin.param.gen_overpar

    Overwrite DRS ini parameters:  (bool; default: True) [default=True].
.. py:attribute:: sinfo_rec_detlin.param.lc_sw

    Correct for bad lines introduced by instrument software:  (bool;  default: False) [default=False].
.. py:attribute:: sinfo_rec_detlin.param.lc_kappa

    Kappa sigma value (long; default: 18) [default=18].
.. py:attribute:: sinfo_rec_detlin.param.lc_filt_rad

    Filtering radii applied during median filter. Should be small (long;  default: 3) [default=3].
.. py:attribute:: sinfo_rec_detlin.param.product_density

    Density of pipeline products: 0 (low), 1 (low+skycor), 2 (med-QC), 3  (high-debug+skycor) (long; default: 2) [default=2].
.. py:attribute:: sinfo_rec_detlin.param.bp_lin_order

    Order: order of the fit polynomial = number of coefficents - 1 (long;  default: 2) [default=2].
.. py:attribute:: sinfo_rec_detlin.param.bp_lin_thresh_sigma_fct

    Threshold Sigma Factor: threshold factor of the clean standard  deviation. If the deviations of the linear polynomial coefficients  exceed this threshold the corresponding pixels are declared as bad  (float; default: 10.0) [default=10.0].
.. py:attribute:: sinfo_rec_detlin.param.bp_lin_nlin_threshold

    Non Linear Threshold (float; default: 0.5) [default=0.5].
.. py:attribute:: sinfo_rec_detlin.param.bp_lin_lo_rej

    low_rejection: percentage of rejected low intensity pixels before  averaging (float; default: 10.0) [default=10.0].
.. py:attribute:: sinfo_rec_detlin.param.bp_lin_hi_rej

    high_rejection: percentage of rejected high intensity pixels before  averaging (float; default: 10.0) [default=10.0].


The following code snippet shows the default settings for the available 
parameters.

::

   import cpl
   sinfo_rec_detlin = cpl.Recipe("sinfo_rec_detlin")

   sinfo_rec_detlin.param.gen_overpar = True
   sinfo_rec_detlin.param.lc_sw = False
   sinfo_rec_detlin.param.lc_kappa = 18
   sinfo_rec_detlin.param.lc_filt_rad = 3
   sinfo_rec_detlin.param.product_density = 2
   sinfo_rec_detlin.param.bp_lin_order = 2
   sinfo_rec_detlin.param.bp_lin_thresh_sigma_fct = 10.0
   sinfo_rec_detlin.param.bp_lin_nlin_threshold = 0.5
   sinfo_rec_detlin.param.bp_lin_lo_rej = 10.0
   sinfo_rec_detlin.param.bp_lin_hi_rej = 10.0


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_detlin = cpl.Recipe("sinfo_rec_detlin")
   [...]
   res = sinfo_rec_detlin( ..., param = {"gen_overpar":True, "lc_sw":False})


.. seealso:: `cpl.Recipe <http://packages.python.org/python-cpl/recipe.html>`_
   for more information about the recipe object.

Bug reports
-----------

Please report any problems to `Andrea Modigliani <Andrea.Modigliani@eso.org>`_. Alternatively, you may 
send a report to the `ESO User Support Department <usd-help@eso.org>`_.

Copyright
---------

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

.. codeauthor:: Andrea Modigliani <Andrea.Modigliani@eso.org>
