pro selscrplot,cube,whichplot,ind1,ind2,lvlflag=lvlflag if n_elements(ind1) eq 0 then ind1=0 if n_elements(ind2) eq 0 then ind2=2 if n_elements(lvlflag) eq 0 then lvlflag=0 ; ind1 and ind2 are the window identifiers for the plot and colorbar ; respectively ; lvlflag choses between linear contors (1) or smart contours (0) wset,ind1 erase wset,ind2 erase sz=size(cube) sx=float(sz(1)) sy=float(sz(2)) asp=(sy/sx) ;arat=asp/(max([sy,sx])) xnorm=sx/(max([sy,sx])) ynorm=sy/(max([sy,sx])) if asp ge 1 then begin xmarg=1-0.8/asp pos=[xmarg/2,0.1, 1-xmarg/2,0.9] endif else begin ymarg=1-0.8*asp pos=[0.1,ymarg/2,0.9,1-ymarg/2] endelse q=whichplot a=replicate(255,256)-findgen(256) b=findgen(256) ttles=strarr(16) ttles=['!8S!Iij!3','!8l!8!Iij!3','!8s!Iij!3','!8S!Iij!El!3',$ '!8l!8!Iij!El!3','!8S!Iij!Es!N!3','!8s!Iij!Es!N!3','!8S!Iij!E0!N!3',$ '!8T!IA!E*!N!3','!4D!8v!3','!8v!ILSR!3','!8T!Iint!3','!4r!8!Irms!3',$ '!8T!E*!IA!N/!4r!8!Irms!3','!10"!8l!8!Iij!N!10"!3',$ '!10"!8l!8!El!Iij!N!10"!3','!10"!8l!8!Iij!N!10"!3',$ '!10"!8l!8!El!Iij!N!10"!3'] cub=cube(*,*,q) lvl=levs(cub,15) lvl=lvl(uniq(lvl)) pointer=where(cub ne 99999.0) if pointer(0) eq -1 then begin xyouts,0.2,0.5,'No Valid Data to Plot',charsize=2 return endif dit=cub(pointer) mini=min(cub) maxi=max(cub) if lvlflag ne 0 then begin lvl=findgen(15)*(maxi-mini)/15.+mini print,'Difference between contours:',(maxi-mini)/15. endif colmatrix=((max(lvl)-min(lvl))/100*findgen(100)+min(lvl))#[1.,1.,1.,1.] colmatrix=transpose(colmatrix) ;tvlct,a,a,a wset,ind1 contour,cube(*,*,q),$ levels=lvl,/cell_fill,max_value=99998.0,xrange=[0,sx-1],yrange=[0,sy-1],$ /noerase,xstyle=5,ystyle=5,position=pos wset,ind2 contour,colmatrix,/fill,levels=lvl,/noerase,xstyle=5,ystyle=5 wset,ind1 ;tvlct,b,b,b contour,cube(*,*,q),position=pos,levels=[0.],color=255,xstyle=5,$ ystyle=5,/noerase,max_value=99998.0,xrange=[0,sx-1],yrange=[0,sy-1] wset,ind2 contour,colmatrix,levels=[0.],xstyle=5,c_color=255,$ ystyle=5,/noerase wset,ind1 contour,cube(*,*,q),position=pos,/nodata,$ title=ttles(q),xtitle='!3x (pixels)',ytitle='!3y (pixels)',$ xticks=1,yticks=1,xcharsize=0.8,ycharsize=0.8,$ xtickname=[' ',' '],ytickname=[' ',' '],/noerase,charsize=1.5 wset,ind2 xtn=strarr(3) xtn(0)=sigfig(min(lvl),3) xtn(1)=sigfig((max(lvl)-min(lvl))/2+min(lvl),3) xtn(2)=sigfig(max(lvl),3) contour,colmatrix,/nodata,xstyle=1,ystyle=1,/noerase,$ xticks=1,yticks=1,xtickname=[' ',' '],ytickname=[' ',' '],title='Color Bar',$ xtitle=ttles(q)+'!N Value '+units(q) axis,0,0,yax=0,/ynozero,/data,yticks=2,$ ytickname=xtn,yticklen=-0.15,ycharsize=0.75 wset,ind1 end