The vmimflatscreen recipe
===============================================================

.. data:: vmimflatscreen

Synopsis
--------

Create a master screen flat field from set of raw screen flat field frames.

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

This recipe is used to create a master screen flat field from a set
of raw screen flat fields. The master screen flat field is not used
directly in the flat field correction of scientific data, but it is
optionally used just in the creation of a master sky flat field by
the recipe vmimflatsky.


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

  DO category:              Type:       Explanation:         Required:
  IMG_SCREEN_FLAT           Raw         Screen flat exposure    Y
  MASTER_BIAS               Calib       Master bias             Y
  MASTER_DARK               Calib       Master dark             .

  CCD_TABLE                 Calib       Bad pixel table         .


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

  DO category:              Data type:  Explanation:
  IMG_MASTER_SCREEN_FLAT    FITS image  Master screen flat field
  IMG_COMBINED_SCREEN_FLAT  FITS image  Combined screen flat field

The primary product is the normalised master screen flat field.

A secondary product is the combined screen flat field, that is the
result of the combination of all inputs but without any normalisation
applied, and is just used for data quality control. A CCD table must
be specified in input only if a bad pixel cleaning is requested.


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


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

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

   Create an object for the recipe vmimflatscreen.

::

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

Parameters
----------

.. py:attribute:: vmimflatscreen.param.SmoothBoxSize

    Size of running box used for smoothing (long; default: 7) [default=7].
.. py:attribute:: vmimflatscreen.param.SmoothMethod

    Smooth method for image trends removal (str; default: 'Median') [default="Median"].
.. py:attribute:: vmimflatscreen.param.AllowSingleFrames

    Frame combination method is ignored. (bool; default: True) [default=True].
.. py:attribute:: vmimflatscreen.param.StackMethod

    Frames combination method (str; default: 'Average') [default="Average"].
.. py:attribute:: vmimflatscreen.param.KSigmaLow

    Low threshold for K-sigma clipping method (float; default: 5.0) [default=5.0].
.. py:attribute:: vmimflatscreen.param.KSigmaHigh

    High threshold for K-sigma clipping method (float; default: 5.0) [default=5.0].
.. py:attribute:: vmimflatscreen.param.MinRejection

    Number of lowest rejected values for rejection method (long; default:  1) [default=1].
.. py:attribute:: vmimflatscreen.param.MaxRejection

    Number of highest rejected values for rejection method (long; default:  1) [default=1].
.. py:attribute:: vmimflatscreen.param.BiasMethod

    Bias removal method (str; default: 'Zmaster') [default="Zmaster"].
.. py:attribute:: vmimflatscreen.param.CleanBadPixel

    Bad pixel correction on master flat (bool; default: False) [default=False].
.. py:attribute:: vmimflatscreen.param.CleanCosmic

    Cosmic ray events cleaning from raw flats (bool; default: False) [default=False].
.. py:attribute:: vmimflatscreen.param.CosmicThreshold

    Threshold to identify cosmic rays candidates. (float; default: 4.0) [default=4.0].
.. py:attribute:: vmimflatscreen.param.CosmicRatio

    Min ratio between peak and nearby pixels for a cosmic ray. (float;  default: 2.0) [default=2.0].
.. py:attribute:: vmimflatscreen.param.ComputeQC

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


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

::

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

   vmimflatscreen.param.SmoothBoxSize = 7
   vmimflatscreen.param.SmoothMethod = "Median"
   vmimflatscreen.param.AllowSingleFrames = True
   vmimflatscreen.param.StackMethod = "Average"
   vmimflatscreen.param.KSigmaLow = 5.0
   vmimflatscreen.param.KSigmaHigh = 5.0
   vmimflatscreen.param.MinRejection = 1
   vmimflatscreen.param.MaxRejection = 1
   vmimflatscreen.param.BiasMethod = "Zmaster"
   vmimflatscreen.param.CleanBadPixel = False
   vmimflatscreen.param.CleanCosmic = False
   vmimflatscreen.param.CosmicThreshold = 4.0
   vmimflatscreen.param.CosmicRatio = 2.0
   vmimflatscreen.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
   vmimflatscreen = cpl.Recipe("vmimflatscreen")
   [...]
   res = vmimflatscreen( ..., param = {"SmoothBoxSize":7, "SmoothMethod":"Median"})


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