The fors_config recipe
===============================================================

.. data:: fors_config

Synopsis
--------

Creation of FORS recipes configuration tables

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

This recipe is used to create the so-called GRISM_TABLE, containing all
the FORS spectral pipeline configuration parameters related to a specific
grism. This is a way to provide for each specific instrument mode a set of
appropriate defaults for the recipe parameters.

The values assigned to each input parameter of fors_config are simply
copied to a FITS table consisting of one row, and as many columns as the
input parameter: each column will have the same name and type of each
parameter. Only the three parameters "instrument", "grism", and
"id" are not written to the table columns, but to the descriptor header
keywords INSTRUME, ESO INS GRIS1 NAME, and ESO INS GRIS1 ID, that will be
used by the automatic pipeline for appropriate data association.


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

  DO category:               Type:       Explanation:         Required:
Output files
^^^^^^^^^^^^
::

  DO category:               Data type:  Explanation:
  GRISM_TABLE                FITS table  Recipe configuration parameters


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

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

   Create an object for the recipe fors_config.

::

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

Parameters
----------

.. py:attribute:: fors_config.param.dispersion

    Expected spectral dispersion (Angstrom/pixel) (float; default: 0.0) [default=0.0].
.. py:attribute:: fors_config.param.peakdetection

    Peak detection threshold (ADU) (float; default: 250.0) [default=250.0].
.. py:attribute:: fors_config.param.wdegree

    Degree of wavelength calibration polynomial (int; default: 4) [default=4].
.. py:attribute:: fors_config.param.cdegree

    Degree of spectral curvature polynomial (int; default: 4) [default=4].
.. py:attribute:: fors_config.param.startwavelength

    Start wavelength in spectral extraction (float; default: 0.0) [default=0.0].
.. py:attribute:: fors_config.param.endwavelength

    End wavelength in spectral extraction (float; default: 0.0) [default=0.0].
.. py:attribute:: fors_config.param.instrument

    Name of instrument (str; default: '0') [default="0"].
.. py:attribute:: fors_config.param.grism

    Name of grism (str; default: '0') [default="0"].
.. py:attribute:: fors_config.param.grism_id

    Grism ID (str; default: '0') [default="0"].
.. py:attribute:: fors_config.param.filter

    Name of filter (str; default: '0') [default="0"].
.. py:attribute:: fors_config.param.filter_id

    Filter ID (str; default: '0') [default="0"].


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

::

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

   fors_config.param.dispersion = 0.0
   fors_config.param.peakdetection = 250.0
   fors_config.param.wdegree = 4
   fors_config.param.cdegree = 4
   fors_config.param.startwavelength = 0.0
   fors_config.param.endwavelength = 0.0
   fors_config.param.instrument = "0"
   fors_config.param.grism = "0"
   fors_config.param.grism_id = "0"
   fors_config.param.filter = "0"
   fors_config.param.filter_id = "0"


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

::

   import cpl
   fors_config = cpl.Recipe("fors_config")
   [...]
   res = fors_config( ..., param = {"dispersion":0.0, "peakdetection":250.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 `Carlo Izzo <usd-help@eso.org>`_. Alternatively, you may 
send a report to the `ESO User Support Department <usd-help@eso.org>`_.

Copyright
---------

This file is currently part of the FORS Instrument Pipeline
Copyright (C) 2002-2010 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:: Carlo Izzo <usd-help@eso.org>
