The gimasterdark recipe
===============================================================

.. data:: gimasterdark

Synopsis
--------

Creates a master dark image from a set of raw dark frames.

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

For detailed information please refer to the GIRAFFE pipeline user manual.

It is available at http://www.eso.org/pipelines.


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

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

   Create an object for the recipe gimasterdark.

::

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

Parameters
----------

.. py:attribute:: gimasterdark.param.stack_method

    Stacking method: average, median, minmax or ksigma (str; default:  'median') [default="median"].
.. py:attribute:: gimasterdark.param.stack_ksigmalow

    Lower threshold multiplier for method ksigma (float; default: 5.0) [default=5.0].
.. py:attribute:: gimasterdark.param.stack_ksigmahigh

    Upper threshold multiplier for method ksigma (float; default: 5.0) [default=5.0].
.. py:attribute:: gimasterdark.param.stack_minreject

    Minimum rejection level for method minmax (int; default: 1) [default=1].
.. py:attribute:: gimasterdark.param.stack_maxreject

    Maximum rejection level for method minmax (int; default: 1) [default=1].
.. py:attribute:: gimasterdark.param.remove_bias

    Enable bias removal (bool; default: True) [default=True].
.. py:attribute:: gimasterdark.param.bsremove_method

    Bias removal method (str; default: 'PROFILE') [default="PROFILE"].
.. py:attribute:: gimasterdark.param.bsremove_areas

    Bias areas to use (Xl0:Xr0:Yl0:Yr0, ... ,Xln:Xrn:Yln:Yrn) (str;  default: '5:40:0:4095') [default="5:40:0:4095"].
.. py:attribute:: gimasterdark.param.bsremove_sigma

    Sigma Clipping: sigma threshold factor (float; default: 2.5) [default=2.5].
.. py:attribute:: gimasterdark.param.bsremove_niter

    Sigma Clipping: maximum number of iterations (int; default: 5) [default=5].
.. py:attribute:: gimasterdark.param.bsremove_mfrac

    Sigma Clipping: minimum fraction of points accepted/total [0.0..1.0]  (float; default: 0.8) [default=0.8].
.. py:attribute:: gimasterdark.param.bsremove_xorder

    Order of X polynomial fit (CURVE method only) (int; default: 1) [default=1].
.. py:attribute:: gimasterdark.param.bsremove_yorder

    Order of Y polynomial fit (CURVE method only) (int; default: 1) [default=1].
.. py:attribute:: gimasterdark.param.bsremove_xstep

    Sampling step along X (CURVE method only) (int; default: 1) [default=1].
.. py:attribute:: gimasterdark.param.bsremove_ystep

    Sampling step along Y (CURVE method only) (int; default: 1) [default=1].


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

::

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

   gimasterdark.param.stack_method = "median"
   gimasterdark.param.stack_ksigmalow = 5.0
   gimasterdark.param.stack_ksigmahigh = 5.0
   gimasterdark.param.stack_minreject = 1
   gimasterdark.param.stack_maxreject = 1
   gimasterdark.param.remove_bias = True
   gimasterdark.param.bsremove_method = "PROFILE"
   gimasterdark.param.bsremove_areas = "5:40:0:4095"
   gimasterdark.param.bsremove_sigma = 2.5
   gimasterdark.param.bsremove_niter = 5
   gimasterdark.param.bsremove_mfrac = 0.8
   gimasterdark.param.bsremove_xorder = 1
   gimasterdark.param.bsremove_yorder = 1
   gimasterdark.param.bsremove_xstep = 1
   gimasterdark.param.bsremove_ystep = 1


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

::

   import cpl
   gimasterdark = cpl.Recipe("gimasterdark")
   [...]
   res = gimasterdark( ..., param = {"stack_method":"median", "stack_ksigmalow":5.0})


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

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

Please report any problems to `Giraffe Pipeline <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 GIRAFFE Instrument Pipeline
 Copyright (C) 2002-2014 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:: Giraffe Pipeline <usd-help@eso.org>
