;+ ; NAME: ; get_spe_zero ; ; PURPOSE: (one line) ; return zero-flux (dark+bias) information for reducing an SPE file ; ; DESCRIPTION: ; return zero-flux (dark+bias) information for reducing an SPE file ; ; CATEGORY: ; IMAGES ; ; CALLING SEQUENCE: ; zero = get_spe_zero(zfilename, zero, zerr, zbad, znoise, $ ; silent=silent, $ ; aexptime=aexptime, ainfo=ainfo) ; INPUTS: ; zfilename : filename of SPE zero-flux (dark+bias) average images ; ; OPTIONAL INPUT PARAMETERS: ; -------- behavior of the routine ------------ ; silent : 1 if the routine is to perform silently. Default = 0, ; print out statements ; ; -------- description of the file the zero file will be applied to ------ ; aexptime : exposure time in seconds ; ainfo: string (filename), array of strings (FITS header) or ; structure (SPE header) ; ; OUTPUTS: ; zero - the average zero-flux image ; zerr - the error in the average zero-flux image (NOT error per ; image per pixel) ; zbad - bad pixel image for avg (0 = good) ; znoise - read noise (or read noise plus dark noise) scalar, in DN ; ; SIDE EFFECTS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY: ; Written 14 Jun 2007 Leslie Ann Young SwRI ; Modified 13 Sep 2007 LAY ;- function get_spe_zero,zfilename, zerr, zbad, znoise, $ silent=silent, aexptime=aexptime, ainfo=ainfo, $ fitshead = fitshead, spehead = spehead, exptime=exptime func = 'get_spe_zero' if not keyword_set(silent) then silent = 0b zfn = zfilename[0] ; in case zfilename is array[1] if not silent then begin print, func, ' : reading ', zfn endif if not isfile(zfn) then begin print, func, ' : ', zfn, ' not found' stop endif zero = readfits(zfn, zhead, /silent) zerr = readfits(zfn, ex=1, /silent) zbad = readfits(zfn, ex=2, /silent) znoise = sxpar(zhead, 'READN_DN') fitshead = spe_head(zhead, valid, spehead, exptime=exptime) if keyword_set(ainfo) and not silent then begin exempt = ['EXTIMLOC','EXTIMUTC','NFRAMES'] if (spe_hdiff(zfn, ainfo, zdiff, adiff, exempt=exempt, itime2=aexptime)) then begin print, func + ' : WARNING - ', zfn, $ ' has imcompatible data information' print, zdiff print, adiff endif end return, zero end