procedure fuse2img (fitsin, imgout) file fitsin {"",prompt="Name of FUSE raw ttag FITS file"} file imgout {"",prompt="Name of output IRAF image file"} begin file fitsfile, imgfile, flxtmp, wavetmp int naxis2 real exptime # Load necessary packages if (! defpac ("ttools")) { print("Please load the 'ttools' package before running this task.") bye } if (! defpac ("ctools")) { print("Make sure the 'stsdas', 'hst_calib' and 'ctools' packages") print("are loaded before running this task.") bye } # Get input file names fitsfile = fitsin imgfile = imgout # Allocate temporary images flxtmp = mktemp("tmp$flx.")//".fits" wavetmp = mktemp("tmp$wave.")//".fits" # Get dimension of table to be converted keypar (fitsfile//"[1]", "NAXIS2") naxis2 = int(keypar.value) # Extract flux and wavelength columns into IRAF image files tabim(fitsfile, flxtmp, "FLUX", 1, naxis2) tabim(fitsfile, wavetmp, "WAVE", 1, naxis2) # Get exposure time keypar (fitsfile//"[0]", "EXPTIME") exptime = real(keypar.value) # Use mkmultispec to create a onedspec compatible spetral image with the # wavelength scale in the header. A high-order cubic spline is used to # follow the FUSE wavelength scale. mkmulti (flxtmp, wavetmp, imgfile,\ function="spline3", nterms=7, weight="", label="Wavelength",\ units="Angstroms", low_reject=2., high_reject=4., niterate=0, grow=1.,\ format="%g", interactive=no, device="stdgraph", markrej=yes, cursor="",\ verbose=yes) # Add exposure time to .imh file in splot format hedit (imgfile, "EXPTIME", exptime, add+, update+, verify-, show+) # Delete temporary images imdelete(flxtmp) imdelete(wavetmp) end