pro display_ccd_ds,fn @c_system.inc @c_header.inc ; Read the file d_read,fn,h,p ; Set the window size and open it xsize=d_value(h,H_XSIZE)>400+200 ysize=600 window,1,xsize=xsize,ysize=ysize,title=fn ; Do the histogram histo=histogram(p) xhisto=indgen(max(p)-min(p)+1)+min(p) plot,xhisto,histo,psym=10,position=[0.05,0.08,0.6,0.48],xtitle='DN' if (d_value(h,H_SET_NAME) eq 'Full') or (d_value(h,H_SET_NAME) eq 'Image') then begin ; For images determine the optimum stretch numpixels=long(d_value(h,H_XSIZE))*long(d_value(h,H_YSIZE)) sizehisto=size(histo) c_histo=long(histo) c_histo(0)=long(histo(0)) for i=1,sizehisto(1)-1 do c_histo(i)=c_histo(i-1)+histo(i) hstart=where(c_histo ge 0.05*numpixels) hstart=hstart(0) hend=where(c_histo ge 0.95*numpixels) hend=hend(0) imgmin=xhisto(hstart) imgmax=xhisto(hend) imgrange=imgmax-imgmin imgmin=imgmin-0.1*imgrange imgmax=imgmax+0.1*imgrange tv,bytscl(rotate(p,7),min=imgmin,max=imgmax,top=!D.N_COLORS), $ 0,600-d_value(h,H_YSIZE) xyouts,0.05,0.54,'black = '+string(fix(imgmin))+' white = '+ $ string(fix(imgmax)),/normal endif ; Add header info to display xyouts,xsize-190,ysize-20,d_value(h,H_DIRECTORY),/device xyouts,xsize-190,ysize-35,d_value(h,H_SET_NAME),/device xyouts,xsize-190,ysize-50,'Exposure ='+string(d_value(h,H_EXPTIME), $ format='(f7.1)'),/device xyouts,xsize-190,ysize-65,'CCD temp ='+string(d_value(h,H_CCDTEMP), $ format='(f6.2)'),/device xyouts,xsize-190,ysize-80,'Mission time ='+string(d_value(h,H_MISSION_TIME), $ format='(f12.4)'),/device end