The muse_scipost_make_cube recipe
===============================================================

.. data:: muse_scipost_make_cube

Synopsis
--------

Make a MUSE cube from a MUSE pixel table.

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

This recipe takes a pixel table and resamples it to either a FITS cube or a Euro3D table and optionally to a stacked spectrum. This is a part of the muse_scipost recipe.


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

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

   Create an object for the recipe muse_scipost_make_cube.

::

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

Parameters
----------

.. py:attribute:: muse_scipost_make_cube.param.lambdamin

    Cut off the data below this wavelength after loading the pixel  table(s). (float; default: 4000.0) [default=4000.0].
.. py:attribute:: muse_scipost_make_cube.param.lambdamax

    Cut off the data above this wavelength after loading the pixel  table(s). (float; default: 10000.0) [default=10000.0].
.. py:attribute:: muse_scipost_make_cube.param.resample

    The resampling technique to use for the final output cube. (str;  default: 'drizzle') [default="drizzle"].
.. py:attribute:: muse_scipost_make_cube.param.dx

    Horizontal step size for resampling (in arcsec or pixel). The  following defaults are taken when this value is set to 0.0: 0.2'' for  WFM, 0.025'' for NFM, 1.0 if data is in pixel units. (float; default:  0.0) [default=0.0].
.. py:attribute:: muse_scipost_make_cube.param.dy

    Vertical step size for resampling (in arcsec or pixel). The following  defaults are taken when this value is set to 0.0: 0.2'' for WFM,  0.025'' for NFM, 1.0 if data is in pixel units. (float; default: 0.0) [default=0.0].
.. py:attribute:: muse_scipost_make_cube.param.dlambda

    Wavelength step size (in Angstrom). Natural instrument sampling is  used, if this is 0.0 (float; default: 0.0) [default=0.0].
.. py:attribute:: muse_scipost_make_cube.param.crtype

    Type of statistics used for detection of cosmic rays during final  resampling. "iraf" uses the variance information, "mean" uses standard  (mean/stdev) statistics, "median" uses median and the median median of  the absolute median deviation. (str; default: 'median') [default="median"].
.. py:attribute:: muse_scipost_make_cube.param.crsigma

    Sigma rejection factor to use for cosmic ray rejection during final  resampling. A zero or negative value switches cosmic ray rejection  off. (float; default: 15.0) [default=15.0].
.. py:attribute:: muse_scipost_make_cube.param.rc

    Critical radius for the "renka" resampling method. (float; default:  1.25) [default=1.25].
.. py:attribute:: muse_scipost_make_cube.param.pixfrac

    Pixel down-scaling factor for the "drizzle" resampling method. Up to  three, comma-separated, floating-point values can be given. If only  one value is given, it applies to all dimensions, two values are  interpreted as spatial and spectral direction, respectively, while  three are taken as horizontal, vertical, and spectral. (str; default:  '0.8,0.8') [default="0.8,0.8"].
.. py:attribute:: muse_scipost_make_cube.param.ld

    Number of adjacent pixels to take into account during resampling in  all three directions (loop distance); this affects all resampling  methods except "nearest". (int; default: 1) [default=1].
.. py:attribute:: muse_scipost_make_cube.param.format

    Type of output file format, "Cube" is a standard FITS cube with  NAXIS=3 and multiple extensions (for data and variance). The extended  "x" formats include the reconstructed image(s) in FITS image  extensions within the same file. (str; default: 'Cube') [default="Cube"].
.. py:attribute:: muse_scipost_make_cube.param.stacked

    If true, write an additional output file in form of a 2D stacked image  (x direction is pseudo-spatial, y direction is wavelength). (bool;  default: False) [default=False].
.. py:attribute:: muse_scipost_make_cube.param.filter

    The filter name(s) to be used for the output field-of-view image. Each  name has to correspond to an EXTNAME in an extension of the  FILTER_LIST file. If an unsupported filter name is given, creation of  the respective image is omitted. If multiple filter names are given,  they have to be comma separated. (str; default: 'white') [default="white"].


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

::

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

   muse_scipost_make_cube.param.lambdamin = 4000.0
   muse_scipost_make_cube.param.lambdamax = 10000.0
   muse_scipost_make_cube.param.resample = "drizzle"
   muse_scipost_make_cube.param.dx = 0.0
   muse_scipost_make_cube.param.dy = 0.0
   muse_scipost_make_cube.param.dlambda = 0.0
   muse_scipost_make_cube.param.crtype = "median"
   muse_scipost_make_cube.param.crsigma = 15.0
   muse_scipost_make_cube.param.rc = 1.25
   muse_scipost_make_cube.param.pixfrac = "0.8,0.8"
   muse_scipost_make_cube.param.ld = 1
   muse_scipost_make_cube.param.format = "Cube"
   muse_scipost_make_cube.param.stacked = False
   muse_scipost_make_cube.param.filter = "white"


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

::

   import cpl
   muse_scipost_make_cube = cpl.Recipe("muse_scipost_make_cube")
   [...]
   res = muse_scipost_make_cube( ..., param = {"lambdamin":4000.0, "lambdamax":10000.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 `Ole Streicher <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 MUSE Instrument Pipeline
Copyright (C) 2005, 2018 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  02111-1307  USA

.. codeauthor:: Ole Streicher <usd-help@eso.org>
