pro oct04,file ;This program creates DISR SHS frames. ;The frames consis of 4 byte intensities per pixel, rastered across ;the ccd, 520 wide by 256 tall for a total of 133,120 pixels (532,480 bytes). if n_params() eq 0 then begin & file='' & read,'Please enter a filename (name.CCD): ',file & endif openw,2,file print,'What would you like to do:' print,' Enter To' print,' 1 Create one gradient from top to bottom of the CCD' print,' 2 To create a recurring 1 dn/row gradient from top to bottom of the CCD' print,' 3 To create a constant value across the CCD' read,'? :',menu ;Initalize m=0.0285319084 ;conversion slope: frame value to CCD DN, old value = 0.028508 DN/count b=27.506696 ;conversion offset: frame value to CCD DN, old value = 28.25007 DN m2=0 ;exposure time sensitivity slope (DN/ms) b2=1 ;exposure time offset (ms) ;DN=m*DecVal+b ;good for Exp=1 sec (1000 ms) ;DN1=m2*Exp+b2 ;relation between Exposure time and DN. if menu eq 1 then begin read,'What DN value do you want for the top row (min=28 DN)?: ',DNrow1 read,'What DN value do you want for the bottom row (max=4095 DN)?: ',DNrow256 read,'What exposure time would you like (in ms)?: ',Exp RowSlope=float((DNrow256-DNrow1)/256.) DN=DNrow1 ;start at the top for j=0,256-1 do begin ;each row DecVal=long(((DN-(Exp-1)*m2-b)/m)+0.5) ;;For i=0,520-1 do printf,2,DecVal,format='($,z)' ;same value accross the row For i=0,520-1 do writeu,2,DecVal ;same value accross the row DN=fix(DN+RowSlope+.5) endfor goto,exit endif if menu eq 2 then begin read,'What DN value do you want for the top row (min=28 DN)?: ',DNrow1 read,'What DN value do you want for the recursion end (max=4095 DN)?: ',MaxDN read,'What exposure time would you like (in ms)?: ',Exp ;;RowSlope=float((DNrow256-DNrow1)/256.) DN=DNrow1 ;start at the top for j=0,256-1 do begin ;each row DecVal=long(((DN-(Exp-1)*m2-b)/m)+0.5) ;;For i=0,520-1 do printf,2,DecVal,format='($,z)' ;same value accross the row For i=0,520-1 do writeu,2,DecVal ;same value accross the row DN=fix(DN+1) if DN gt MaxDN then DN=28 ;and we start again... endfor goto,exit endif if menu eq 3 then begin DN=0 Exp=1000 read,'What DN value would you like to have?; ',DN read,'What exposure time would you like (in ms)?: ',Exp DecVal=long(((DN-(Exp-1)*m2-b)/m)+0.5) ;;for i = 0l,133120l-1 do printf,2,DecVal,format='($,z)' For i=0l,133120l-1 do writeu,2,DecVal ;same value accross the row ;;stop goto,exit endif goto, skip ;old stuff beyond here... whatfile: if n_params() eq 0 then begin & file='' & read,'What file? ',file & endif if file eq 'bye' or file eq 'exit' then goto,exit file_ck=findfile(file) if file_ck(0) eq '' then begin & print,'File not found' & goto,whatfile & endif openr,1,file line='0'XL for i=0,10 do begin readu,1,line print,line,format='(z)' endfor skip: ;stop exit: close,/all end