- Unbundle the tar file in some directory
- In wavext.com there is a link to an IRAF library which links Fortran code to IRAF enabling the FITS data and header parameters to be read and written. You need to find libiraf77.a on your machine (perhaps under iraf/extern/stsdas/lib/libiraf77.a or in the Scisoft directory structure if you have that installed) and then change the link. You may have to consult your systems person but usually the library is somewhere accessible.
- Compile the code with >sh wavext.com. This makes wavext.e in the directory.
- In the directory in which you usually start IRAF there is a file called login.cl. Around where you have lines like
# # Default USER package; extend or modify as you wish. Note that this can # be used to call FORTRAN programs from IRAF. # package user #
add a line
task wavextract = /directory/wavext.e
where the directory is the location where you compiled the code.
When you next log in to IRAF you should find a new task called wavextract and you can enter parameters with epar as any other task.
If you recompile or change the wavextract.par file you need to log in to IRAF (or PYRAF if you use that instead) again.
The following FITS keywords need to be present and filled:
INSTRUME (currently allowed values are 'FLAMES' or 'VIMOS' or 'GMOS')
CRPIX3: Start pixel for wavelength array (usually = 1.0)
CRVAL3: Wavelength (A) corresponding to start pixel
CDELT3: Wavelength increment per pixel (A)
DEC: Declination (deg.)
AZIMUTH: Telescope azimuth (deg.) Called HIERARCH ESO TEL AZ in ESO header
PA_START: Parallactic angle at start of observation (called HIERARCH ESO TEL PARANG START in ESO header)
PA_END: Parallactic angle at end of observation (HIERARCH ESO TEL PARANG END)
ADA_POSANG: Position angle of axis of instrument IFU (HIERARCH ESO ADA POSANG)
The pressure and temperature are input on the command line when running the script, and are stored in the ESO hierarchical header HIERARCH ESO TEL AMBI PRES START and HIERARCH ESO TEL AMBI TEMP. As with things that have start and end values you should take the middle value. How you do this depends on whether you have single images or many combined.
Run on the IRAF command line as follows:
#convert long ESO HIERARCH keywords to IRAF understandable lengths using hierarch28 program (see below) print ("!~/iraf/hierarch28 cube.fits ESO_keyword_table.conv") | cl real temp,pres imgets( "cube.fits", "TEMP" ) #extract out temp and pressure values from header temp=real(imgets.value)+273 #convert to K imgets( "cube.fits", "PRES_S") pres=real(imgets.value) real fidwave fidwave=6500 #set fiducial wavelength diffatmref( Incube="cube.fits", Xpixin=0.52, Ypixin=0.52, Xpixout=0.52, Ypixout=0.52, FidWav=fidwave, Xoffset=0.0, Yoffset=0.0, interpol="spline3", Pressure=(pres), Temperature=(temp), outcube="cube_DAR.fits")
Download the hierarch28 program here.
Many thanks to Jeremy Walsh for providing this script