procedure qextract (inmage ,calstar , inputsky, exptime, nabba) # # Procedure to produce to extract and flux calibrated a spectra # for OSIRIS x-disp spectra # by Richard Elston 9/5/93 # string inmage {prompt="input prefix of average object"} string calstar {prompt="input prefix of calibration star"} string inputsky {prompt="input identified reference sky"} real exptime {prompt="exposure time of input object"} real nabba {prompt="number of ABBA pairs in final image"} begin string inimage, rfsky real rdnoise, gain inimage=inmage rfsky=inputsky rdnoise=30.0*sqrt(nabba*2.0) gain=10.0*nabba*2.0 # # apextract the input spectra # imdel ("ones.imh", ver-) imcopy (inimage//".kavg.imh", "ones.imh", verbose=yes) imrepla ("ones.imh", 1.00, imaginary=0., lower=INDEF, upper=INDEF) imarith ("ones.imh", "*", rfsky//".ksky.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) imarith ("ones.imh", "+", inimage//".kavg.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) apall ("ones.imh", 1, output=inimage//".kavg.0001", format="multispec", references="", profiles="", interactive=yes, find=no, recenter=no, resize=no, edit=yes, trace=yes, fittrace=yes, extract=yes, extras=yes, review=no, line=INDEF, nsum=10, lower=-6., upper=6., apidtable="", b_function="chebyshev", b_order=1, b_sample="-30:-10,10:30", b_naverage=-3, b_niterate=0, b_low_reject=3., b_high_rejec=3., b_grow=0., width=5., radius=10., threshold=0., minsep=5., maxsep=1000., order="increasing", apertures="", npeaks=INDEF, shift=yes, llimit=INDEF, ulimit=INDEF, ylevel=0.1, peak=yes, bkg=yes, r_grow=0., avglimits=no, t_nsum=10, t_step=5, t_nlost=10, t_function="legendre", t_order=3, t_sample="*", t_naverage=1, t_niterate=3, t_low_reject=3., t_high_rejec=3., t_grow=0., background="fit", skybox=1, weights="variance", pfit="fit1d", clean=yes, saturation=INDEF, readnoise=rdnoise, gain=gain, lsigma=3., usigma=3., nsubaps=1) imdel ("ones.imh", ver-) imcopy (inimage//".havg.imh", "ones.imh", verbose=yes) imrepla ("ones.imh", 1., imaginary=0., lower=INDEF, upper=INDEF) imarith ("ones.imh", "*", rfsky//".hsky.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) imarith ("ones.imh", "+", inimage//".havg.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) apall ("ones.imh", 1, output=inimage//".havg.0001", format="multispec", references="", profiles="", interactive=yes, find=no, recenter=no, resize=no, edit=yes, trace=yes, fittrace=yes, extract=yes, extras=yes, review=no, line=INDEF, nsum=10, lower=-6., upper=6., apidtable="", b_function="chebyshev", b_order=1, b_sample="-30:-10,10:30", b_naverage=-3, b_niterate=0, b_low_reject=3., b_high_rejec=3., b_grow=0., width=5., radius=10., threshold=0., minsep=5., maxsep=1000., order="increasing", apertures="", npeaks=INDEF, shift=yes, llimit=INDEF, ulimit=INDEF, ylevel=0.1, peak=yes, bkg=yes, r_grow=0., avglimits=no, t_nsum=10, t_step=5, t_nlost=10, t_function="legendre", t_order=3, t_sample="*", t_naverage=1, t_niterate=3, t_low_reject=3., t_high_rejec=3., t_grow=0., background="fit", skybox=1, weights="variance", pfit="fit1d", clean=yes, saturation=INDEF, readnoise=rdnoise, gain=gain, lsigma=3., usigma=3., nsubaps=1) imdel ("ones.imh", ver-) imcopy (inimage//".javg.imh", "ones.imh", verbose=yes) imrepla ("ones.imh", 1., imaginary=0., lower=INDEF, upper=INDEF) imarith ("ones.imh", "*", rfsky//".jsky.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) imarith ("ones.imh", "+", inimage//".javg.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) apall ("ones.imh", 1, output=inimage//".javg.0001", format="multispec", references="", profiles="", interactive=yes, find=no, recenter=no, resize=no, edit=yes, trace=yes, fittrace=yes, extract=yes, extras=yes, review=no, line=INDEF, nsum=10, lower=-6., upper=6., apidtable="", b_function="chebyshev", b_order=1, b_sample="-30:-10,10:30", b_naverage=-3, b_niterate=0, b_low_reject=3., b_high_rejec=3., b_grow=0., width=5., radius=10., threshold=0., minsep=5., maxsep=1000., order="increasing", apertures="", npeaks=INDEF, shift=yes, llimit=INDEF, ulimit=INDEF, ylevel=0.1, peak=yes, bkg=yes, r_grow=0., avglimits=no, t_nsum=10, t_step=5, t_nlost=10, t_function="legendre", t_order=3, t_sample="*", t_naverage=1, t_niterate=3, t_low_reject=3., t_high_rejec=3., t_grow=0., background="fit", skybox=1, weights="variance", pfit="fit1d", clean=yes, saturation=INDEF, readnoise=rdnoise, gain=gain, lsigma=3., usigma=3., nsubaps=1) imdel ("ones.imh", ver-) imcopy (inimage//".iavg.imh", "ones.imh", verbose=yes) imrepla ("ones.imh", 1., imaginary=0., lower=INDEF, upper=INDEF) imarith ("ones.imh", "*", rfsky//".isky.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) imarith ("ones.imh", "+", inimage//".iavg.imh", "ones.imh", title="", divzero=0., hparams="", pixtype="", calctype="", verbose=no, noact=no) apall ("ones.imh", 1, output=inimage//".iavg.0001", format="multispec", references="", profiles="", interactive=yes, find=no, recenter=no, resize=no, edit=yes, trace=yes, fittrace=yes, extract=yes, extras=yes, review=no, line=INDEF, nsum=10, lower=-6., upper=6., apidtable="", b_function="chebyshev", b_order=1, b_sample="-30:-10,10:30", b_naverage=-3, b_niterate=0, b_low_reject=3., b_high_rejec=3., b_grow=0., width=5., radius=10., threshold=0., minsep=5., maxsep=1000., order="increasing", apertures="", npeaks=INDEF, shift=yes, llimit=INDEF, ulimit=INDEF, ylevel=0.1, peak=yes, bkg=yes, r_grow=0., avglimits=no, t_nsum=10, t_step=5, t_nlost=10, t_function="legendre", t_order=3, t_sample="*", t_naverage=1, t_niterate=3, t_low_reject=3., t_high_rejec=3., t_grow=0., background="fit", skybox=1, weights="variance", pfit="fit1d", clean=yes, saturation=INDEF, readnoise=rdnoise, gain=gain, lsigma=3., usigma=3., nsubaps=1) # # wavelength calibrate the flux calibration spectra # xwave (inimage, "avg.0001", inputsky) # # irflux the spectra # imarith(inimage//".kwav.imh", "/", exptime, inimage//".kflx.imh") imarith(inimage//".hwav.imh", "/", exptime, inimage//".hflx.imh") imarith(inimage//".jwav.imh", "/", exptime, inimage//".jflx.imh") imarith(inimage//".iwav.imh", "/", exptime, inimage//".iflx.imh") imarith(inimage//".kflx.imh", "*", calstar//".kflx.imh", inimage//".kflx.imh") imarith(inimage//".hflx.imh", "*", calstar//".hflx.imh", inimage//".hflx.imh") imarith(inimage//".jflx.imh", "*", calstar//".jflx.imh", inimage//".jflx.imh") imarith(inimage//".iflx.imh", "*", calstar//".iflx.imh", inimage//".iflx.imh") imdel (inimage//".?wav.imh") imdel (inimage//".?avg.0001.imh") end