Automated reduction perl script

This script carries out complete reduction of a series of files. It handles identification of which are arcs and which are objects, and extracts normally and optimally and also extracts sky spectra at the position of the object. The user must have set up flat fields, a file defining the sky regions and various other parameters.

The arcs (and optionally flats) to be associated with a given object are determined from the position, time and slit angle. If these are not found, the script will issue a warning and take an inclusive approach. i.e. It will assume that an arc is associated unless it can prove that it is not.

NB the script fixhead must have been run on all the files before using reduce. This creates a standardized header structure.

Invocation

reduce.pl datafile (switches) file1 file2 @list1 @list2

where file1, file2 are individual files, while list1 and list2 are lists of file names

Switches

There are two switches to modify the action of reduce:

-t---If specified the list of data types will be wriiten but no reduction will be carried out.
-s---If specified, the determination of data types will be skipped. The combination of -t and -s allows you to have one run to determine types, which you can edit, and then run with -s to ensure that it does not re-determine the data types. Note that you cannot specify both options simultaneously.

Action

Given a list of files, reduce first generates a script to extract positional and timing data and also to analyse the frames to identify data type using idtype or optionally the headers for format 5 at least. The frames are classified as data, arc, flat, or junk and the latter are ignored (and warnings are issued).

It then generates and runs the pamela reduction commands.

What reduce does NOT do

'reduce' does NOT debias the data. You must debias the data before running reduce.

Setting up for using reduce

A fair bit of setting up is needed to use reduce effectively. You are going to have to decide on the parameters you want to use for reduction. These need to be edited into a separate file -- see datafile for a template. The best way to set the parameters is to go through some reduction by hand. This will allow you to decide such parameters as the number of coefficients for fitting the sky background etc. You will also need to set up various files such as a unit and zeroframe, a master sky frame and work out a reference position for skymov.

If you are running on a new set of data you may need to add some code to both this script and the header fixing script.

Once you have done this and set up the data file to your satisfaction then you can try running this script.

Files produced by reduce

reduce produces many temporary files. These have different name, but all start with zzz, so just delete zzz* to get rid of them. In some cases they may be of use when problems occur which is why they are not deleted automatically.

Datafile format

Even if you don't have to edit the script file, you will undoubtedly have to edit your own datafile. So download it using shift-click and edit it. Mostly it consists of setting parameters used by the pamela routines. You may need to change the format number if you have edited the script for your format.

Author: T.R. Marsh
Created: 14 January 2001
Revised: 13 August 2009


Page generated Fri Nov 20 09:23:37 2009