Installation instructions for the cirred IR data reduction package.  

The cirred package has been built on linux, solaris an sunos machines. 
The entire package consists of IRAF cl scripts, fortran source and a binary 
fitsio (cfitsio v1.4) library.  Using the package in other environments 
should be straight forward, even if you have to build the fitsio library 
(see below). 

Get the current package:
	http://www.ctio.noao.edu/instruments/ir_instruments/cirred/cirred.tar.gz

Put the gzipped tar file in the scripts directory of your choice. For example,
/mylogindir/IRAF/scripts/

At the unix prompt:
	gunzip cirred.tar.gz
	tar -xvf cirred.tar	
At the linux prompt:
        tar -zxvf cirred.tar.gz

Put the following in your login.cl or (preferrably) your loginuser.cl file:
	set	scripts  = /mylogindir/IRAF/scripts/
	task    $cirred  = scripts$cirred.cl

Edit the cirred.cl file so that the pkhome variable points to 
/mylogindir/IRAF/scripts/ . Next edit the task statements for fixfits, fixbad,
and calc_off. These are "foreign" (binary) tasks to the cl; we compile them 
below. I haven't figured out how to have the cl interpret the pkhome variable
and use the "$" escape following the "=". That's why these have to be explicitly
called out. The second "$" tells the cl that the task is foreign, the first that
there is no parameter file.

Start up IRAF, and cd to /mylogindir/IRAF/scripts/.

Compile fixfits, fixbad, and calc_off. 

	cl> fc fixfits.f ./libcfitsio_XXX.a
	cl> fc calc_off.f
	cl> fc fixbad.f

	XXX = lnx for linux (try libcfitsio_lnx_141102.a for RedHat<9)
	XXX = sol for solaris 5.6
	XXX = sun for sunos 4.1.3

The libraries are from CFITSIO v 1.4.

fc is the IRAF fortran compiler. By using it, we save the hassle of finding
the needed IRAF libraries in the unix or linux environment.

If you compiled your own CFITSIO library (see below) just substitute the 
appropriate name on the fc fixfits.f line. You can delete any of the libraries
you won't use.

Now, load the package:

	cl> cirred

you should see something like:
cl> cirred
      calc_off    fixbad      med         shift_comb  
      clearim     fixfits     maskbad     osiris      sky_sub     
ci>

If you have to get the CFITSIO package:

If the pre-compiled fitsio libraries are not compatible with your particular 
system, you can build them for yourself from the CFITSIO package available at:
        
        http://heasarc.gsfc.nasa.gov/fitsio
        ftp://legacy.gsfc.nasa.gov/software/fitsio/c

The bad pixel interpolation routine fixfits 
requires the CFITSIO library. If you don't want to use this, you may 
choose to skip it. The functionality of fixfits is duplicated in
fixbad, which uses IRAF "imh" files instead. 

We have found the CFITSIO package to be relatively easy to install and very 
useful.