The vmifuscience recipe
===============================================================

.. data:: vmifuscience

Synopsis
--------

Extract spectra from an IFU scientific exposure.

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

This recipe extracts IFU scientific spectra using the input extraction
mask, after aligning it to the brightest fiber spectra detected on the
input exposure. The extracted spectra are then resampled at a constant
wavelength step, after aligning the input wavelength calibration to
the positions of a set of identified sky lines. The extracted spectra
are eventually corrected for the relative differences in transmission
from fiber to fiber.


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

  DO category:             Type:       Explanation:             Required:
  IFU_SCIENCE              Raw         Scientific spectra          Y
  MASTER_BIAS              Calib       Master bias                 Y
  IFU_TRACE                Calib       Extraction mask             Y
  IFU_IDS                  Calib       Wavelength calibration      Y
  IFU_TRANSMISSION         Calib       Transmission correction     Y
  EXTINCT_TABLE            Calib       Atmospheric extinction      .

  IFU_SPECPHOT_TABLE       Calib       Response curve              .

  CCD_TABLE                Calib       Bad pixel table             .


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

  DO category:             Data type:  Explanation:
  IFU_SCIENCE_REDUCED      FITS image  Reduced scientific spectra
  IFU_SCIENCE_FLUX_REDUCED FITS image  Reduced scientific spectra
  IFU_FOV                  FITS image  Reconstructed IFU field-of-view
  IFU_SKY_TRACE            FITS table  Science aligned extraction mask

  Only if sky alignment is requested:
  IFU_SKY_IDS              FITS table  Sky aligned wavelength solution
The extraction mask, the wavelength calibration, and the relative
transmission table, are those generated by the recipe vmifucalib. A CCD
table must be specified only if a bad pixel cleaning is requested.


For more details, please refer to the VIMOS Pipeline User's Guide.


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

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

   Create an object for the recipe vmifuscience.

::

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

Parameters
----------

.. py:attribute:: vmifuscience.param.BiasMethod

    Bias removal method. (str; default: 'Zmaster') [default="Zmaster"].
.. py:attribute:: vmifuscience.param.CleanBadPixel

    Bad pixel correction on master flat field. (bool; default: False) [default=False].
.. py:attribute:: vmifuscience.param.ApplyTransmission

    Apply transmission correction to extracted scientific spectra (bool;  default: True) [default=True].
.. py:attribute:: vmifuscience.param.CalibrateFlux

    Extracted spectra are flux calibrated. (bool; default: False) [default=False].
.. py:attribute:: vmifuscience.param.UseSkylines

    Use sky lines to refine the wavelength calibration (bool; default:  True) [default=True].
.. py:attribute:: vmifuscience.param.UseSkyIndividual

    Use sky lines to refine the wavelength calibration individually for  each spectrum (bool; default: False) [default=False].
.. py:attribute:: vmifuscience.param.ComputeQC

    Compute QC1 parameters (bool; default: False) [default=False].


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

::

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

   vmifuscience.param.BiasMethod = "Zmaster"
   vmifuscience.param.CleanBadPixel = False
   vmifuscience.param.ApplyTransmission = True
   vmifuscience.param.CalibrateFlux = False
   vmifuscience.param.UseSkylines = True
   vmifuscience.param.UseSkyIndividual = False
   vmifuscience.param.ComputeQC = False


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

::

   import cpl
   vmifuscience = cpl.Recipe("vmifuscience")
   [...]
   res = vmifuscience( ..., param = {"BiasMethod":"Zmaster", "CleanBadPixel":False})


.. 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 `ESO VIMOS Pipeline Team <https://support.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 VIMOS Instrument Pipeline
Copyright (C) 2002-2005 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  02110-1301 USA


.. codeauthor:: ESO VIMOS Pipeline Team <https://support.eso.org>
