The vmdet recipe
===============================================================

.. data:: vmdet

Synopsis
--------

Determine RON, gain, and bad pixels from a set of flat field exposures.

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

This recipe is used to estimate the read-out-noise (RON) and the
gain of the CCD, and to determine the positions of the bad pixels.

The input SOF should contain at least five pairs of flat field
exposures, all belonging to the same quadrant, each pair corresponding
to a different exposure time. The flat fields can be produced either
in imaging or in MOS mode. In MOS mode a HR grism is used, in order to
illuminate the CCD also beyond the central region used in direct
imaging mode, but no mask is inserted at the telescope focal plane.

This type of exposure cannot really be considered a spectral flat
field, because the CCD is exposed to white light (i.e., without
a wavelength dependency along the dispersion direction). The flat
fields generated for the purpose of determining the detector properties
are assigned the DO category DETECTOR_PROPERTIES, to distinguish them
from the more common IMG_SCREEN_FLAT or MOS_SCREEN_FLAT that are used
to produce master calibrations.


Input files
^^^^^^^^^^^^
::

  DO category:          Type:         Explanation:  Required:
  DETECTOR_PROPERTIES   Raw           Flat field       Y
  MASTER_BIAS           Calib         Master bias      Y

Output files
^^^^^^^^^^^^
::

  DO category:          Data type:    Explanation:
  CCD_TABLE             FITS table    Bad pixel table
  (none)                FITS image    Bad pixel image
  (none)                FITS image    Error image

Only the primary product, the bad pixel table, is copied (or moved)
to the product directory. Other products are generated only on request
(typically for debug purposes) and are not assigned a DO category as
they would not be used anywhere in further data processing steps.


For more details, please refer to the VIMOS Pipeline User's Guide.


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

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

   Create an object for the recipe vmdet.

::

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

Parameters
----------

.. py:attribute:: vmdet.param.CreateBadPixelMap

    Bad pixel map creation (bool; default: True) [default=True].
.. py:attribute:: vmdet.param.CreateErrorImage

    Response slope uncertainty map creation (bool; default: False) [default=False].
.. py:attribute:: vmdet.param.DetectionThreshold

    Threshold in determination of bad pixels (float; default: 5.0) [default=5.0].
.. py:attribute:: vmdet.param.DetectionMode

    Bad pixel detection method (str; default: 'Intolerant') [default="Intolerant"].
.. py:attribute:: vmdet.param.ComputeQC

    Compute QC1 parameters. (bool; default: True) [default=True].


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

::

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

   vmdet.param.CreateBadPixelMap = True
   vmdet.param.CreateErrorImage = False
   vmdet.param.DetectionThreshold = 5.0
   vmdet.param.DetectionMode = "Intolerant"
   vmdet.param.ComputeQC = True


You may also set or overwrite some or all parameters by the recipe 
parameter `param`, as shown in the following example:

::

   import cpl
   vmdet = cpl.Recipe("vmdet")
   [...]
   res = vmdet( ..., param = {"CreateBadPixelMap":True, "CreateErrorImage":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 `ESO VIMOS Pipeline Team <usd-help@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 VIMOS Instrument Pipeline
Copyright (C) 2002-2005 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., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA


.. codeauthor:: ESO VIMOS Pipeline Team <usd-help@eso.org>
