The kmo_make_image recipe
===============================================================

.. data:: kmo_make_image

Synopsis
--------

Collapse a cube to create a spatial image

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

This recipe collapses a cube along the spectral axis using rejection. By 
default all spectral slices are averaged.

Errors are propagated for the same spectral ranges as for the input data if
a noise map is provided.


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

   DO                    KMOS                                                  
   category              Type   Explanation                    Required #Frames
   --------              -----  -----------                    -------- -------
   <none or any>         F3I    data frame                         Y       1   
   <none or any>         F1S    OH line spectrum                   N      0,1  

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

   DO                    KMOS
   category              Type   Explanation
   --------              -----  -----------
   MAKE_IMAGE            F2I    Collapsed data cubes


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

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

   Create an object for the recipe kmo_make_image.

::

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

Parameters
----------

.. py:attribute:: kmo_make_image.param.range

    The spectral ranges to combine. e.g."x1_start,x1_end;x2_start,x2_end"  (microns) (str; default: '') [default=""].
.. py:attribute:: kmo_make_image.param.threshold

    The OH threshold level (%) (float; default: 0.1) [default=0.1].
.. py:attribute:: kmo_make_image.param.cmethod

    Either apply "average", "median", "sum", "min_max." or "ksigma". (str;  default: 'ksigma') [default="ksigma"].
.. py:attribute:: kmo_make_image.param.cpos_rej

    The positive rejection threshold for kappa-sigma-clipping (sigma).  (float; default: 3.0) [default=3.0].
.. py:attribute:: kmo_make_image.param.cneg_rej

    The negative rejection threshold for kappa-sigma-clipping (sigma).  (float; default: 3.0) [default=3.0].
.. py:attribute:: kmo_make_image.param.citer

    The number of iterations for kappa-sigma-clipping. (long; default: 3) [default=3].
.. py:attribute:: kmo_make_image.param.cmax

    The number of maximum pixel values to clip with min/max-clipping.  (long; default: 1) [default=1].
.. py:attribute:: kmo_make_image.param.cmin

    The number of minimum pixel values to clip with min/max-clipping.  (long; default: 1) [default=1].


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

::

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

   kmo_make_image.param.range = ""
   kmo_make_image.param.threshold = 0.1
   kmo_make_image.param.cmethod = "ksigma"
   kmo_make_image.param.cpos_rej = 3.0
   kmo_make_image.param.cneg_rej = 3.0
   kmo_make_image.param.citer = 3
   kmo_make_image.param.cmax = 1
   kmo_make_image.param.cmin = 1


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

::

   import cpl
   kmo_make_image = cpl.Recipe("kmo_make_image")
   [...]
   res = kmo_make_image( ..., param = {"range":"", "threshold":0.1})


.. 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 `Alex Agudo Berbel <kmos-spark@mpe.mpg.de>`_. Alternatively, you may 
send a report to the `ESO User Support Department <usd-help@eso.org>`_.

Copyright
---------

This file is part of the KMOS Instrument Pipeline
Copyright (C) 2002,2003 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, 51 Franklin Street, Suite 500, Boston, MA  02110-1335  USA

.. codeauthor:: Alex Agudo Berbel <kmos-spark@mpe.mpg.de>
