; MNVR.PRO ; ; This program calculates the mean and variance of sets of images at ; various exposure times, and also of sets of dark frames at corresponding ; accumulation times, and calculates the mean and variance of the ; dark-subtracted images. It stores the corrected means and variances for ; later processing to determine the noise floor of the CCD camera used to ; obtain the images. ; user='' SPAWN,'whoami',user IF user(0) NE 'cnsr3' THEN BEGIN PRINT,'USER NOT cnsr3 - change users and restart' retall ENDIF PRINT,'ENTER THE CAMERA AND FILTER NUMBERS' cam=0 & filt=0 READ,cam,filt mn=LONARR(256,256,25) var=mn loadct,13 FOR iexp=21,25 DO BEGIN texp=iexp sexp=STRCOMPRESS(texp,/REMOVE_ALL) PRINT,'texp=',texp,' sexp=',sexp IF cam EQ 1 THEN day=09 ELSE day=07 name=STRING(cam,filt,day,cam,filt,iexp,$ FORM='("/jasper/cnsr3_data1/cal/c",i1,"/f",i1,"/c",i2.2,2i1,i3.3)') files=findfile(name+'*',count=nfl) IF files(0) NE '' THEN BEGIN meanvar,files,nfl,256,m,v,hb mr=LONG(ROUND(m)) & vr=LONG(ROUND(v)) mn(*,*,iexp-1)=mr var(*,*,iexp-1)=vr kh=gethd(hb) date=kh.misc.dt.(0) file=STRING(date,cam,filt,texp,$ FORM='("/jasper/cnsr3_data1/linearity/l",I2.2,2I1,I3.3)') imout,file+'.mean',mn(*,*,iexp-1) imout,file+'.varc',var(*,*,iexp-1) PRINT,STRING(texp, $ FORMAT='("Images for ",F4.1,"-s exposure completed.")') TVSCL,m,0 & TVSCL,v,1 ENDIF ENDFOR END