The sinfo_utl_cube2spectrum recipe
===============================================================

.. data:: sinfo_utl_cube2spectrum

Synopsis
--------

Collapse a cube to an image over an aperture

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

This recipe performs cube to 1D spectrum image conversion.

The input files is a cube
Its associated tag should be CUBE.

The output is an image resulting from the cube manipulated 
according to the value of op
Over an aperture as specified by the parameter 
sinfoni.sinfo_utl_cube2spectrum.aperture having alias 'op', 'ap'Information on relevant parameters can be found with
esorex --params sinfo_utl_cube2spectrum
esorex --help sinfo_utl_cube2spectrum


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

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

   Create an object for the recipe sinfo_utl_cube2spectrum.

::

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

Parameters
----------

.. py:attribute:: sinfo_utl_cube2spectrum.param.op

    A possible operation: average, clean_mean, median, sum (str; default:  'average') [default="average"].
.. py:attribute:: sinfo_utl_cube2spectrum.param.ap

    A possible aperture: rectangle, circle (str; default: 'rectangle') [default="rectangle"].
.. py:attribute:: sinfo_utl_cube2spectrum.param.llx

    Lower left X rectangle coordinate (long; default: 2) [default=2].
.. py:attribute:: sinfo_utl_cube2spectrum.param.lly

    Lower left Y rectangle coordinate (long; default: 2) [default=2].
.. py:attribute:: sinfo_utl_cube2spectrum.param.urx

    Upper right X rectangle coordinate (long; default: 28) [default=28].
.. py:attribute:: sinfo_utl_cube2spectrum.param.ury

    Upper right Y rectangle coordinate (long; default: 28) [default=28].
.. py:attribute:: sinfo_utl_cube2spectrum.param.lo_rej

    Clean mean low rejection (long; default: 10) [default=10].
.. py:attribute:: sinfo_utl_cube2spectrum.param.hi_rej

    Clean mean low rejection (long; default: 10) [default=10].
.. py:attribute:: sinfo_utl_cube2spectrum.param.centerx

    Circle center X coordinate (long; default: 16) [default=16].
.. py:attribute:: sinfo_utl_cube2spectrum.param.centery

    Circle center Y coordinate (long; default: 16) [default=16].
.. py:attribute:: sinfo_utl_cube2spectrum.param.radius

    Circle radii (long; default: 5) [default=5].


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

::

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

   sinfo_utl_cube2spectrum.param.op = "average"
   sinfo_utl_cube2spectrum.param.ap = "rectangle"
   sinfo_utl_cube2spectrum.param.llx = 2
   sinfo_utl_cube2spectrum.param.lly = 2
   sinfo_utl_cube2spectrum.param.urx = 28
   sinfo_utl_cube2spectrum.param.ury = 28
   sinfo_utl_cube2spectrum.param.lo_rej = 10
   sinfo_utl_cube2spectrum.param.hi_rej = 10
   sinfo_utl_cube2spectrum.param.centerx = 16
   sinfo_utl_cube2spectrum.param.centery = 16
   sinfo_utl_cube2spectrum.param.radius = 5


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

::

   import cpl
   sinfo_utl_cube2spectrum = cpl.Recipe("sinfo_utl_cube2spectrum")
   [...]
   res = sinfo_utl_cube2spectrum( ..., param = {"op":"average", "ap":"rectangle"})


.. 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 `Andrea Modigliani <Andrea.Modigliani@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 SINFONI 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, Inc., 59 Temple Place, Suite 330, Boston, 
MA  02111-1307  USA

.. codeauthor:: Andrea Modigliani <Andrea.Modigliani@eso.org>
