f2infoimaging -- Description of the tasks used to reduce 
                 FLAMINGOS-2 imaging data




The F2 package contains tasks for processing FLAMINGOS-2 imaging, longslit and multi-object spectroscopy (MOS) data. Many routines for the proper reduction of infrared imaging and spectroscopic data already exist within the Gemini IRAF package. Therefore, imaging, longslit and MOS reduction will also make use of the tasks in the NIRI and GNIRS packages, respectively. The specifics of the individual tasks can be found in their help files.

This document summarises the tasks used to reduce FLAMINGOS-2 imaging data. For more information regarding the FLAMINGOS-2 data structure and for generic F2 package information, see f2info. For information on the NIRI package, see niriinfo. In addition, the f2examples task provides a sample processing script for imaging data.

The F2PREPARE task is used to prepare the FLAMINGOS-2 raw data from Gemini South. The output imaging data from F2PREPARE are similar to the native format for NIRI data. This allows for subsequent processing with the NIRI package.

The tasks are designed to provide a fairly complete and flexible reduction for the purpose of assessing data quality at the time of observation. Real-time reductions may not be optimal for a particular science application. The F2 and NIRI package scripts can be optimised for a particular application using the hidden parameters to achieve the best possible results.

The tasks produce logfiles for the performed processing steps. The name of the logfile may be set in each individual task or at the package level by setting f2.logfile.

The tasks add header keywords to the output images. These header keywords contain information about the performed processing steps and the values of the critical parameters that were used.

All FLAMINGOS-2 images are written as multi-extension FITS (MEF) files. Raw data have two unnamed extensions. Most of the header information is written to the primary header unit (PHU), which is extension [0]. The data read from the array is in the pixel data extension, which is extension [1].

It is recommended to use imtype="fits". This is set automatically when loading the GEMINI package.


NSHEADERS - Update header values for FLAMINGOS-2

This task is described in more detail in gnirsinfo and f2info. It must be called before beginning to reduce FLAMINGOS-2 data.

F2PREPARE - Prepare raw FLAMINGOS-2 data for reduction

This task is described in more detail in f2info. It must be called before running any of the following tasks.

NIFLAT - Derive normalised flat field and BPM

NIFLAT is used to construct normalised flat field images and BPMs using calibration unit (GCAL), twilight or sky flat field images, and dark images. For GCAL flat field images, a set of exposures with the shutter closed is combined and subtracted from a set of exposures with the shutter open. For sky flat field images, NIFLAT calls NISKY to mask and remove objects before normalising. NIFLAT uses the flat field images and short dark images to identify bad pixels.

The values of the niflat.statsec, niflat.thresh_flo, niflat.thresh_fup, niflat.thresh_dlo and niflat.thresh_dup parameters are changed (by NSHEADERS) from the NIRI defaults to take into account differences between the NIRI and FLAMINGOS-2 detectors. The values used are:

   niflat.thresh_flo = 0.70
   niflat.thresh_fup = 1.20
   niflat.thresh_dlo = -50. 
   niflat.thresh_dup = 600.

NIFASTSKY - Derive sky image, median or min/max filtering

NIFASTSKY is used to construct sky images by median or min/max filtering. No attempt is made to specifically flag objects in the sky images. This task is mostly used for rapid reductions at the telescope, although it may suffice for standard reductions depending on the complexity of the field.

The value of the nifastsky.statsec parameter is changed (by NSHEADERS) from the NIRI default to "[300:1748,300:1748]".

NISKY - Derive sky image, includes masking of objects

NISKY is used to construct sky images. Objects in the input images are identified and masked using OBJMASKS. In general, it is recommended to use NISKY rather than NIFASTSKY for science quality reductions. Because NISKY does a preliminary reduction of each image and identifies objects to mask, it is considerably slower than NIFASTSKY.

The value of the nisky.statsec parameter is changed (by NSHEADERS) from the NIRI default to "[300:1748,300:1748]".

NIREDUCE - Reduce images (sky or dark subtract, flat divide)

NIREDUCE is used to sky or dark subtract and flat field divide the science data. The sky image can be scaled before subtraction if desired.

The value of the nifastsky.statsec parameter is changed (by NSHEADERS) from the NIRI default to "[300:1748,300:1748]".


For typical reductions the user will need appropriate flat field images, short dark images, on-target science images and sky images. GCAL flat field images are usually taken both with the IR lamp on and off to allow separation of the instrumental thermal signature from the sensitivity response. Short dark images are used to identify bad pixels.

If the target is not extended and the field is uncrowded, the on-target science images may be used as sky images. This assumes that sufficiently large dither steps were used during the observations.

The sample processing script for imaging data as provided by the f2examples task also shows a typical reduction.

0. Use NSHEADERS to define the header values for FLAMINGOS-2.

1. Use GEMTOOLS.GEMLIST to make separate lists of the files associated with different observation types. Typically these will be called obj.lis, flat.lis, etc. Tasks can then be invoked on all the data of one type using the "@" syntax.

2. Use F2PREPARE to update the raw data headers and create the variance and data quality planes, if desired. The other tasks will not run if the data has not first been processed using F2PREPARE. It is recommended to run F2PREPARE first on just the calibration images, use NIFLAT to derive the BPM and then run F2PREPARE on the science frames using the newly created BPM to flag bad pixels in the DQ plane.

3. Use NIFLAT to derive a normalised flat field image and a BPM.

4. Use NISKY (or alternatively NIFASTSKY) to derive sky images. The near-IR sky level and structure varies on timescales of a few minutes and care should be taken to combine only sky images that are close enough in time to each other and to the relevant science images that such variations are non-significant. This may take some experimentation. Use fl_keepmasks=yes to check the object identification step.

5. Use NIREDUCE to subtract the sky images and apply the normalised flat field image. Data from each filter should be processed separately, as NIREDUCE takes only one sky image at a time as its input. Better sky subtraction can often be achieved by scaling the sky image to the same mean level as the science frame (assuming the science frame is sky-dominated).

6. The processed images may be co-added with the task GEMTOOLS.IMCOADD. Photometry may be derived with any suitable photometry package.


The f2examples task provides a sample processing script for imaging data.


The tasks in the F2 and NIRI packages are designed to operate on MEF images that have been processed using F2PREPARE. The task F2PREPARE will not run on data from instruments other than FLAMINGOS-2 and will not run on simple FITS files.


f2prepare, f2examples, f2info, gnirs.gnirsinfo, gnirs.nsheaders, niri.niriinfo, niri.niflat, niri.nifastsky, niri.nisky, niri.nireduce, gemtools.imcoadd