Here we give a brief example of how the CCDPACK data reduction programs can take advantage of Set headers in frames obtained from a mosaic camera.
In this case we will assume that the original data is in the form of multi-extension FITS files; a group of data frames data-*.fit, a group of bias frames bias-*.fit and a group of flat fields flat-*.fit. Each MEF represents a single exposure, and contains one Header + Data Unit for each CCD chip in the mosaic camera. It would be possible to leave these files in their original format and allow CCDPACK to convert them on the fly, but the output files will be generated in a more manageable way (their names will be more compact) if we convert them first by hand to NDF format. We do this using the CONVERT package:
This creates one new HDS container file for each MEF with the same name, but with the extension .sdf instead of .fit. We next indicate to CCDPACK that we will be using Set headers:% convert % fits2ndf in='"data-*.fit,bias-*.fit,flat-*.fit"' out='*' container=true
The next job is to inform CCDPACK that each HDS container file represents a single Set:% ccdsetup useset=yes accept
This creates no new files, but adds suitable Set header information to each frame. We can now proceed to the data reduction itself:% makeset in='"data-*,bias-*,flat-*"' mode=container
This combines all the bias container files and produces one new container file called master-bias. The new file will have the same structure as the files which went to generate it, that is it will represent a single Set, and will have as many constituent frames as those files, one for each Set Index value in the inputs. The master bias Set can now be used to debias the data and flat field frames like this:% makebias in='bias-*' out=master-bias
and master flat field generation and correction proceeds in the same way:% debias in='"data-*,flat-*"' bias=master-bias out='db-*'
We now have a set of HDS container files called red_data-*.sdf which contain the reduced data, one Set (=one exposure) per file.% makeflat in='"db_flat-*"' out=master-flat % flatcor in='db_data-*' flat=master-flat out='*|db_|red_|'
The thing to note is that once the Set headers have been set up, the commands typed are just the same as for un-Setted data (compare Example 3 in Section ), but CCDPACK is taking care that frames are only combined/corrected in groups with corresponding ones; this will be clear if you look at the log output of these tasks.