procedure mkmask (inflat) # # Procedure to produce mask frames for OSIRIS X-dispersed data # by Richard Elston 9/04/93 # string inflat {prompt="input flatfield image prefix"} begin string inimage, outname inimage=inflat outname='mask' imdel("?."//outname//".imh", ver-) # # Straighten the Spectra # straightv2(inimage//".kflat.imh" , "k."//outname//".imh" , "k") straightv2(inimage//".hflat.imh" , "h."//outname//".imh" , "h") straightv2(inimage//".jflat.imh" , "j."//outname//".imh" , "j") straightv2(inimage//".iflat.imh" , "i."//outname//".imh" , "i") # # trim off the trash must be the same as used in xdispflatten # imcopy("k."//outname//"[*,3:85]", "k."//outname) imcopy("h."//outname//"[*,3:85]", "h."//outname) imcopy("j."//outname//"[*,3:85]", "j."//outname) imcopy("i."//outname//"[*,3:85]", "i."//outname) # # Replace Bad pixals with 0 # imreplace("k."//outname, 0 , upper=0.6, lower=INDEF) imreplace("h."//outname, 0 , upper=0.6, lower=INDEF) imreplace("i."//outname, 0 , upper=0.6, lower=INDEF) imreplace("j."//outname, 0 , upper=0.6, lower=INDEF) imreplace("k."//outname, 0 , lower=1.7, upper=INDEF) imreplace("h."//outname, 0 , lower=1.7, upper=INDEF) imreplace("j."//outname, 0 , lower=1.7, upper=INDEF) imreplace("i."//outname, 0 , lower=1.7, upper=INDEF) # # Replace the Good pixals with 1 # imreplace("k."//outname, 1 , lower=0.5, upper=INDEF) imreplace("h."//outname, 1 , lower=0.5, upper=INDEF) imreplace("j."//outname, 1 , lower=0.5, upper=INDEF) imreplace("i."//outname, 1 , lower=0.5, upper=INDEF) # # make them pl files # imcopy("k."//outname//".imh", "k."//outname//".pl") imcopy("h."//outname//".imh", "h."//outname//".pl") imcopy("j."//outname//".imh", "j."//outname//".pl") imcopy("i."//outname//".imh", "i."//outname//".pl") imdel ("?."//outname//".imh") end