The hawki_step_combine recipe
===============================================================

.. data:: hawki_step_combine

Synopsis
--------

Jitter image combination recipe

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

hawki_step_combine -- hawki combine jitter images.

The files listed in the Set Of Frames (sof-file) must be tagged:
science-file.fits DIST_CORRECTED or
science-file.fits BKG_SUBTRACTED or
bpm-file.fits BPM (optional) 
bkg_bpm-file.fits BKG_BPM (optional) 
offsets-file.fits OFFSETS_REFINED (optional) 
The recipe creates as an output:
hawki_step_combine.fits (COMBINED): 
The recipe does the following steps:
-Allocate an image with the proper combined size 
   (depends on parameters --comb_meth and --borders)
-Retrieve the offsets either from the offsets-file.fits or from the header
-For each combined pixel, the contribution of each individual frame 
   is added using a resampling kernel. If any of the pixels involved in
   the resampling is a bad pixel (defined in bpm-file.fits), it is not
   taken into account.

   With the remaining pixels a minmax rejection is performed
Return code:
esorex exits with an error code of 0 if the recipe completes successfully
or 1 otherwise

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

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

   Create an object for the recipe hawki_step_combine.

::

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

Parameters
----------

.. py:attribute:: hawki_step_combine.param.offset_max

    Maximum offset allowed (long; default: 1500) [default=1500].
.. py:attribute:: hawki_step_combine.param.comb_meth

    Final size of combination (union / inter / first) (str; default:  'union') [default="union"].
.. py:attribute:: hawki_step_combine.param.rej

    Low and high number of rejected values (str; default: '1,1') [default="1,1"].
.. py:attribute:: hawki_step_combine.param.borders

    Border pixels trimmed (long; default: 4) [default=4].
.. py:attribute:: hawki_step_combine.param.resamp_kernel

    Resampling kernel (default/tanh/sinc/sinc2/lanczos/hamming/hann) (str;  default: 'default') [default="default"].


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

::

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

   hawki_step_combine.param.offset_max = 1500
   hawki_step_combine.param.comb_meth = "union"
   hawki_step_combine.param.rej = "1,1"
   hawki_step_combine.param.borders = 4
   hawki_step_combine.param.resamp_kernel = "default"


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_combine = cpl.Recipe("hawki_step_combine")
   [...]
   res = hawki_step_combine( ..., param = {"offset_max":1500, "comb_meth":"union"})


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