Orienting the files correctly

Now pamela expects the dispersion direction of grating spectroscopy to be along the y-axis, i.e., the spectra run vertically up/down the CCD images. If this is not already the case, then there is a pamela script called rotate.pl which will do for this for you. Create a list of files (without the .sdf suffix) and give this to rotate:

(rm sdf.lis)
foreach file (*.sdf)
echo $file:r >> sdf.lis
rotate @sdf.lis

There is no restriction on which direction the dispersion goes in pamela

Creating the zero and unit images

Now you have images in the correct orientation, you need to make two useful images for pamela. The first is full of zeros and the second is full of ones. These can be made from absolutely any image of the correct size, using the starlink figaro package:

isub [image] [image] zero
icadd zero 1 unit

It is best to make the unit image in this way because the command idiv [image] [image] unit can give odd results, due to limitations in the way fits files store numbers and also due to possible divide-by-zero problems.