The sinfo_rec_mdark recipe
===============================================================

.. data:: sinfo_rec_mdark

Synopsis
--------

Master dark and hot pixels mask generation.

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

This recipe perform raw sinfo_dark data reduction.

The input files are raw sinfo_dark images
Their associated tags should be DARK.

The output are a master sinfo_dark (PRO.CATG=MASTER_DARK) and
a hot pixels bad pixel map (PRO.CATG=BP_MAP_HP)
Information on relevant parameters may be found with
esorex --params sinfo_rec_mdark
esorex --help sinfo_rec_mdark


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

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

   Create an object for the recipe sinfo_rec_mdark.

::

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

Parameters
----------

.. py:attribute:: sinfo_rec_mdark.param.gen_overpar

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

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

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

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

    Threshold Sigma Factor: If the mean noise exceeds this threshold times  the clean standard deviation of the clean mean the corresponding  pixels are declared as bad  (float; default: 10.0) [default=10.0].
.. py:attribute:: sinfo_rec_mdark.param.bp_noise_lo_rej

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

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

    lower rejection (float; default: 0.1) [default=0.1].
.. py:attribute:: sinfo_rec_mdark.param.dark_hi_rej

    higher rejection (float; default: 0.1) [default=0.1].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_ron_xmin

    qc_ron_xmin (long; default: 1) [default=1].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_ron_xmax

    qc_ron_xmax (long; default: 2048) [default=2048].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_ron_ymin

    qc_ron_ymin (long; default: 1) [default=1].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_ron_ymax

    qc_ron_ymax (long; default: 2048) [default=2048].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_ron_hsize

    qc_ron_hsize (long; default: 4) [default=4].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_ron_nsamp

    qc_ron_nsamp (long; default: 100) [default=100].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_fpn_xmin

    qc_fpn_xmin (long; default: 1) [default=1].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_fpn_xmax

    qc_fpn_xmax (long; default: 2047) [default=2047].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_fpn_ymin

    qc_fpn_ymin (long; default: 1) [default=1].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_fpn_ymax

    qc_fpn_ymax (long; default: 2047) [default=2047].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_fpn_hsize

    qc_fpn_hsize (long; default: 2) [default=2].
.. py:attribute:: sinfo_rec_mdark.param.dark_qc_fpn_nsamp

    qc_fpn_nsamp (long; default: 1000) [default=1000].


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

::

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

   sinfo_rec_mdark.param.gen_overpar = True
   sinfo_rec_mdark.param.lc_sw = False
   sinfo_rec_mdark.param.lc_kappa = 18
   sinfo_rec_mdark.param.lc_filt_rad = 3
   sinfo_rec_mdark.param.bp_noise_thresh_sigma_fct = 10.0
   sinfo_rec_mdark.param.bp_noise_lo_rej = 10.0
   sinfo_rec_mdark.param.bp_noise_hi_rej = 10.0
   sinfo_rec_mdark.param.dark_lo_rej = 0.1
   sinfo_rec_mdark.param.dark_hi_rej = 0.1
   sinfo_rec_mdark.param.dark_qc_ron_xmin = 1
   sinfo_rec_mdark.param.dark_qc_ron_xmax = 2048
   sinfo_rec_mdark.param.dark_qc_ron_ymin = 1
   sinfo_rec_mdark.param.dark_qc_ron_ymax = 2048
   sinfo_rec_mdark.param.dark_qc_ron_hsize = 4
   sinfo_rec_mdark.param.dark_qc_ron_nsamp = 100
   sinfo_rec_mdark.param.dark_qc_fpn_xmin = 1
   sinfo_rec_mdark.param.dark_qc_fpn_xmax = 2047
   sinfo_rec_mdark.param.dark_qc_fpn_ymin = 1
   sinfo_rec_mdark.param.dark_qc_fpn_ymax = 2047
   sinfo_rec_mdark.param.dark_qc_fpn_hsize = 2
   sinfo_rec_mdark.param.dark_qc_fpn_nsamp = 1000


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_mdark = cpl.Recipe("sinfo_rec_mdark")
   [...]
   res = sinfo_rec_mdark( ..., 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>
