The naco_img_jitter recipe
===============================================================

.. data:: naco_img_jitter

Synopsis
--------

Jitter recipe

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

naco_img_jitter -- NACO imaging jitter recipe.

The files listed in the Set Of Frames (sof-file) must be tagged:
NACO-raw-file.fits IM_JITTER_OBJ or
NACO-raw-file.fits IM_JITTER_SKY or
NACO-raw-file.fits POL_JITTER_OBJ or
NACO-raw-file.fits POL_JITTER_SKY or
NACO-flat-file.fits MASTER_IMG_FLAT or
NACO-bpm-file.fits MASTER_IMG_FLAT_BADPIX or
NACO-dark-file.fits NACO_IMG_DARK_AVG

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

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

   Create an object for the recipe naco_img_jitter.

::

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

Parameters
----------

.. py:attribute:: naco_img_jitter.param.off

    An optional ASCII specification of the offsets in case those in FITS-  headers are missing or wrong. The file must consist of one line per  object FITS-file and each line must consist of two numbers which  represent the shift in pixels of that image relative to the first  image. The first line should thus comprise two zeros. Correct FITS-  header offsets mean that the i'th X offset can be gotten from  Xoffset_0 - Xoffset_i, where Xoffset_i is the value of ESO SEQ  CUMOFFSETX and likewise for Y. (str; default: None) [default="None"].
.. py:attribute:: naco_img_jitter.param.objs

    objects file (str; default: None) [default="None"].
.. py:attribute:: naco_img_jitter.param.oddeven

    Apply the odd-even correction. Warning: This flag currently has no  effect (bool; default: False) [default=False].
.. py:attribute:: naco_img_jitter.param.xcorr

    Cross correlation search and measure sizes (str; default: '40 40 65  65') [default="40 40 65 65"].
.. py:attribute:: naco_img_jitter.param.union

    Combine images using their union, as opposed to their intersection  (deprecated and ignored, see --combine_method) (bool; default: True) [default=True].
.. py:attribute:: naco_img_jitter.param.rej

    Low and high number of rejected values (str; default: '2 2') [default="2 2"].
.. py:attribute:: naco_img_jitter.param.combine_method

    Combine images using one of: 1) Onto the first image (first); 2) Their  union (union); 3) Their intersection (inter). NB: Only the  'first'-method produces an image product with WCS coordinates. A  successful 'first'-method always produces a combined image with  dimensions equal to those of the input images. For the 'union'-method  the result image is at least as large as the input images while for  the 'inter'-method the result image is at most as large as the input  images (str; default: 'union') [default="union"].
.. py:attribute:: naco_img_jitter.param.sky_planes

    Estimate the sky using the median of the last n planes in the previous  cube and the first n planes in the following cube. If the cube has  less than n planes then use all planes. Zero means all. (Ignored for  non-cube data) (long; default: 25) [default=25].
.. py:attribute:: naco_img_jitter.param.cube_mode

    Collapse cube data using one of: 1) No recentering (add); 2) Shift-  and-Add (saa). (Ignored for non-cube data) (str; default: 'saa') [default="saa"].
.. py:attribute:: naco_img_jitter.param.lucky

    In cube mode use only the frames with a strehl ratio in the given top  fraction. (Ignored for non-cube data) (float; default: 1.0) [default=1.0].
.. py:attribute:: naco_img_jitter.param.save_cube

    Append the cube of corrected object images that are shifted added  together to the product (bool; default: False) [default=False].


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

::

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

   naco_img_jitter.param.off = "None"
   naco_img_jitter.param.objs = "None"
   naco_img_jitter.param.oddeven = False
   naco_img_jitter.param.xcorr = "40 40 65 65"
   naco_img_jitter.param.union = True
   naco_img_jitter.param.rej = "2 2"
   naco_img_jitter.param.combine_method = "union"
   naco_img_jitter.param.sky_planes = 25
   naco_img_jitter.param.cube_mode = "saa"
   naco_img_jitter.param.lucky = 1.0
   naco_img_jitter.param.save_cube = False


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

::

   import cpl
   naco_img_jitter = cpl.Recipe("naco_img_jitter")
   [...]
   res = naco_img_jitter( ..., param = {"off":"None", "objs":"None"})


.. 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 `Lars Lundin <llundin@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 NACO Instrument Pipeline
Copyright (C) 2002, 2003, 2005, 2008 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:: Lars Lundin <llundin@eso.org>
