pro makeFlats ;; Creates blank flats inst = ['HRIIR'] date = '050112' vers = '1' for i=0,0 do begin IF inst[i] EQ 'HRIIR' THEN maxmode = 7 ELSE maxmode = 9 FOR mode=1, maxmode do begin IF inst[i] EQ 'HRIIR' THEN BEGIN CASE mode OF 1: dim=[512,256] 2: dim=[512,128] 3: dim=[512,64] 4: dim=[1024,512] 5: dim=[512,256] 6: dim=[1024,512] 7: dim=[1024,512] ENDCASE filter = [0] ENDIF ELSE BEGIN CASE mode OF 1: dim=[1024,1024] 2: dim=[512,512] 3: dim=[256,256] 4: dim=[256,256] 5: dim=[128,128] 6: dim=[128,128] 7: dim=[64,64] 8: dim=[64,64] 9: dim=[1024,1024] ENDCASE filter = [0,7,8,11,4,13,2,14,1] ENDELSE ;; Create the blank flat x = intarr(dim[0],dim[1])+1 ;; Create the header mkhdr, hdr, x sxaddpar, hdr, 'COMMENT', '**********************************************************************' sxaddpar, hdr, 'COMMENT', 'This is a completly flat (all 1) flat field image. Early in flight,' sxaddpar, hdr, 'COMMENT', 'it was determined that our ground based flats would introduce extra' sxaddpar, hdr, 'COMMENT', 'noise so these were created until such time as we find a way to' sxaddpar, hdr, 'COMMENT', 'generate good in flight flats.' sxaddpar, hdr, 'COMMENT', 'Created by: Mark Desnoyer' sxaddpar, hdr, 'COMMENT', '**********************************************************************' sxaddpar, hdr, 'MSNCONFG', 'FLIGHT', ' Configuration of the spacecraft' sxaddpar, hdr, 'FILTER', 'N/A', ' Filter Name' sxaddpar, hdr, 'FLTRNUM', 0, ' Filter Number' sxaddpar, hdr, 'IMGH036', 0, ' IMGH036 Filter pos (Actual)' sxaddpar, hdr, 'IMGH037', 0, ' IMGH037 Filter pos (Commanded)' sxaddpar, hdr, 'FNORIG', 'N/A', ' Original filename from science team' ;; Output the actual image for j=0, n_elements(filter)-1 do begin filt = strtrim(filter[j],2) fn = inst[i]+'-'+date+'-'+vers+'-'+strtrim(mode,2)+'-'+filt+'.fit' writefits, './Data/Flats/'+fn, x, hdr ENDFOR ENDFOR endfor end