procedure mkxdispflat (image, flatpref, outpref ) # # Procedure to flatten and straighten x-disp osiris data # by Richard Elston 8/17/93 # string image {prompt="input raw image "} string flatpref {prompt="prefix of flatfield"} string outpref {prompt="prefix of flattened output image"} begin string inimage,flat,outname inimage=image flat=flatpref outname=outpref # # make the subimages for each band # imdel(outname//".?temp.imh") imcopy(inimage//"[1:256,23:87]", outname//".ktemp") imcopy(inimage//"[1:256,79:165]", outname//".htemp") imcopy(inimage//"[1:256,129:209]", outname//".jtemp") imcopy(inimage//"[1:256,165:253]", outname//".itemp") # # Magnify the images # magnify(outname//".?temp.imh",outname//".?temp.imh",1.0,2.0, interpol="nearest", flux+) # # flatten the sub images # imarith(outname//".ktemp", "/" , flat//".kflat", outname//".ktemp") imarith(outname//".htemp", "/" , flat//".hflat", outname//".htemp") imarith(outname//".jtemp", "/" , flat//".jflat", outname//".jtemp") imarith(outname//".itemp", "/" , flat//".iflat", outname//".itemp") # # straighten the images # straightv2(outname//".ktemp", outname//".ksub", "k") straightv2(outname//".htemp", outname//".hsub", "h") straightv2(outname//".jtemp", outname//".jsub", "j") straightv2(outname//".itemp", outname//".isub", "i") imdel(outname//".?temp.imh") # # trim off the trash # imcopy(outname//".ksub[*,3:85]", outname//".ksub") imcopy(outname//".hsub[*,3:85]", outname//".hsub") imcopy(outname//".jsub[*,3:85]", outname//".jsub") imcopy(outname//".isub[*,3:85]", outname//".isub") end