The hawki_step_compute_bkg recipe
===============================================================

.. data:: hawki_step_compute_bkg

Synopsis
--------

Background computing utility

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

hawki_step_compute_bkg -- hawki background computation utility.

This recipe will create the associated background images
for a given set of object images. If there are sky images, these will
be used to compute the background, otherwise, the background is computed
using a running mean on the object images. An optional mask can be supplied
for the running mean.

The files listed in the Set Of Frames (sof-file) must be tagged:
obj_basic_cal-file.fits BASIC_CALIBRATED or
sky_basic_cal-file.fits SKY_BASIC_CALIBRATED 
and optionally for object masking:
object_mask-file.fits OBJ_MASK 
offsets.fits OFFSETS_REFINED 
distortion_x.fits DISTORTION_X 
distortion_y.fits DISTORTION_Y 

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

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

   Create an object for the recipe hawki_step_compute_bkg.

::

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

Parameters
----------

.. py:attribute:: hawki_step_compute_bkg.param.nmin_comb

    Minimum number of jitter frames to use the running median (long;  default: 10) [default=10].
.. py:attribute:: hawki_step_compute_bkg.param.nhalf_window

    Number of images at both sides of the current ima to use for bkg in  running median (long; default: 7) [default=7].
.. py:attribute:: hawki_step_compute_bkg.param.rejlow

    The number of frames with low level to reject (long; default: 2) [default=2].
.. py:attribute:: hawki_step_compute_bkg.param.rejhigh

    The number of frames with high level to reject (long; default: 2) [default=2].


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

::

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

   hawki_step_compute_bkg.param.nmin_comb = 10
   hawki_step_compute_bkg.param.nhalf_window = 7
   hawki_step_compute_bkg.param.rejlow = 2
   hawki_step_compute_bkg.param.rejhigh = 2


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

::

   import cpl
   hawki_step_compute_bkg = cpl.Recipe("hawki_step_compute_bkg")
   [...]
   res = hawki_step_compute_bkg( ..., param = {"nmin_comb":10, "nhalf_window":7})


.. 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 `Cesar Enrique Garcia Dabo <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 HAWKI Instrument Pipeline
Copyright (C) 2002,2011 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:: Cesar Enrique Garcia Dabo <usd-help@eso.org>
