The amber_selector recipe
===============================================================

.. data:: amber_selector

Synopsis
--------

AMBER OI frame selector

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

This recipe selects frames stored in an AMBER OI product by various
methods and writes a filtered OI product. After selecting a method one
can set a selection criteria for every baseline by defining the
variables X1, X2, and X3. If only one baseline is available, X2 and X3
can be neglected. Moreover one can choose the combining method of the
single criteria by setting the Boolean variable ANDselection.


If ANDselection is not set (--ANDselection=FALSE), a frame passes the
filter if at least one of the selection criteria (X1 || X2 || X3) is
fulfilled.


If ANDselection is set (--ANDselection=TRUE), a frame passes the
filter only if ALL selection criteria (X1 && X2 && X3) are fulfilled.


If AverageFrames is set (--AverageFrames=TRUE), the final product 
will contain the average of the frames

Please note, that for three baselines in both cases the visibility
triplet is written to the product file!

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

  DO category:               Type:      Explanation:      Required: 
  SCIENCE_REDUCED            Products   OI-Fits file                
  or                                                                
  SCIENCE_REDUCED_FILTERED   Products   OI-Fits file                
  or                                                                
  CALIB_REDUCED              Products   OI-Fits file               Y
  or                                                                
  CALIB_REDUCED_FILTERED     Products   OI-Fits file                
  or                                                                
  SCIENCE_CALIBRATED         Products   OI-Fits file              

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

  DO category:               Data type: Explanation:                
  SCIENCE_REDUCED_FILTERED   Products:  filtered OI-fits file       
  or                                                                
  CALIB_REDUCED_FILTERED     Products:  filtered OI-fits file    


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

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

   Create an object for the recipe amber_selector.

::

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

Parameters
----------

.. py:attribute:: amber_selector.param.selection_method

    Selection methods (str; default: 'Fringe_SNR_gt_x') [default="Fringe_SNR_gt_x"].
.. py:attribute:: amber_selector.param.X1

    X1 Value (float; default: 2.0) [default=2.0].
.. py:attribute:: amber_selector.param.X2

    X2 Value (float; default: 2.0) [default=2.0].
.. py:attribute:: amber_selector.param.X3

    X3 Value (float; default: 2.0) [default=2.0].
.. py:attribute:: amber_selector.param.ANDselection

    X1, X2, and X3 combining method (bool; default: False) [default=False].
.. py:attribute:: amber_selector.param.AverageFrames

    Average all frames after selection (bool; default: False) [default=False].


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

::

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

   amber_selector.param.selection_method = "Fringe_SNR_gt_x"
   amber_selector.param.X1 = 2.0
   amber_selector.param.X2 = 2.0
   amber_selector.param.X3 = 2.0
   amber_selector.param.ANDselection = False
   amber_selector.param.AverageFrames = False


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

::

   import cpl
   amber_selector = cpl.Recipe("amber_selector")
   [...]
   res = amber_selector( ..., param = {"selection_method":"Fringe_SNR_gt_x", "X1":2.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 `Armin Gabasch <https://support.eso.org>`_. Alternatively, you may 
send a report to the `ESO User Support Department <usd-help@eso.org>`_.

Copyright
---------



.. codeauthor:: Armin Gabasch <https://support.eso.org>
