procedure mkxdispflat (inflat, outpref ) # # Procedure to make a flats one for each band from a x-disp osiris data # by Richard Elston 8/17/93 # string inflat {prompt="input raw flat"} string outpref {prompt="output image prefix name"} begin string inimage, outname inimage=inflat outname=outpref # # make the subimages for each band # hedit(inimage, "dispaxis", 1, ver-, add+ ) 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 input specta # magnify(outname//".?temp.imh",outname//".?temp.imh",1.0,2.0,flux-, interpol="nearest") # # Aprnomalize the flats # apnormal(outname//".ktemp", outname//".kflat", reference="ref.k.imh", interactive=yes, find=no, recenter=no, resize=no, edit=no, trace=no, fittrace=no, normalize=yes, fitspec=yes, line=INDEF, nsum=10, cennorm=no, threshold=500., background="none", weights="none", pfit="fit1d", clean=no, skybox=1, saturation=INDEF, readnoise="0.", gain="1.", lsigma=4., usigma=4., function="legendre", order=7, sample="*", naverage=1, niterate=3, low_reject=2.5, high_reject=2.5, grow=0.) apnormal(outname//".htemp", outname//".hflat", reference="ref.h.imh", interactive=yes, find=no, recenter=no, resize=no, edit=no, trace=no, fittrace=no, normalize=yes, fitspec=yes, line=INDEF, nsum=10, cennorm=no, threshold=500., background="none", weights="none", pfit="fit1d", clean=no, skybox=1, saturation=INDEF, readnoise="0.", gain="1.", lsigma=4., usigma=4., function="legendre", order=7, sample="*", naverage=1, niterate=3, low_reject=2.5, high_reject=2.5, grow=0.) apnormal(outname//".jtemp", outname//".jflat", reference="ref.j.imh", interactive=yes, find=no, recenter=no, resize=no, edit=no, trace=no, fittrace=no, normalize=yes, fitspec=yes, line=INDEF, nsum=10, cennorm=no, threshold=500., background="none", weights="none", pfit="fit1d", clean=no, skybox=1, saturation=INDEF, readnoise="0.", gain="1.", lsigma=4., usigma=4., function="legendre", order=7, sample="*", naverage=1, niterate=3, low_reject=2.5, high_reject=2.5, grow=0.) apnormal(outname//".itemp", outname//".iflat", reference="ref.i.imh", interactive=yes, find=no, recenter=no, resize=no, edit=no, trace=no, fittrace=no, normalize=yes, fitspec=yes, line=INDEF, nsum=10, cennorm=no, threshold=100., background="none", weights="none", pfit="fit1d", clean=no, skybox=1, saturation=INDEF, readnoise="0.", gain="1.", lsigma=4., usigma=4., function="legendre", order=7, sample="*", naverage=1, niterate=3, low_reject=2.5, high_reject=2.5, grow=0.) imdel(outname//".?temp.imh") # # clip very low pixals # imrep ( outname//".kflat", 0, upper=0.5) imrep ( outname//".hflat", 0, upper=0.5) imrep ( outname//".jflat", 0, upper=0.5) imrep ( outname//".iflat", 0, upper=0.5) end