pro make_Gains inst = ['HRIVIS','MRIVIS','HRIIR','ITSVIS'] for i=0,3 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 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 ENDELSE x = intarr(dim[0],dim[1])+1 ;; Make the header mkhdr, hdr, x sxaddpar, hdr, 'BZERO', 0 sxaddpar, hdr, 'BSCALE', 1 cmt = strarr(7) stars= '***********************************************************************' cmt[0] = stars cmt[1] = '** This file allows a quadrant to quadrant gain to be specified. This' cmt[2] = '** gain is normalized to the gain at launch and thus, if the amplifier' cmt[3] = '** gain changes in flight, this file can be replaced to adjust the' cmt[4] = '** calibration without having to modify the flat field created on the' cmt[5] = '** ground. cmt[6] = stars sxaddhist, cmt, hdr, /comment sxaddpar, hdr, 'MSNCONFG', 'NONE', ' Configuration of the spacecraft' sxaddpar, hdr, 'FNORIG', 'N/A', ' Original filename from science team' sxaddpar, hdr, 'DATEDLV', 'N/A', ' Date when file was delivered to SDC' sxaddpar, hdr, 'AUTHOR', 'N/A', ' Author of this data file' ;; Output the file fn = inst[i]+'_000101_1_'+strtrim(mode,2)+'.fit' writefits, './Data/Gains/'+fn, x, hdr ENDFOR endfor end