pro plot_heatrate,data,xdata,ydata,HRF=hrf,YRANGE=yrange,DATEARG=datearg,$ SITE=site,XRANGE=xrange,IMAGE=image,BOUNDARY=boundary,SCALE=scale ;------------------------------------------------- ;Title: plot_heatrate.pro ;Purpose: Plot heating rate profiles ; ;I/O format: ; ;Keywors: Boundary: set equal to IWC to draw a boundary contour around the cloud. ; ;Author: Matthew Shupe ;Date: 1/18/01 ;Modified: 1/18/01 ;---------------------------------------- ;Make plot and axis titles ;-------------------------- if keyword_set(hrf) then begin if keyword_set(scale) then begin if n_elements(scale) ne 2 then begin print,'SCALE: Must contain 2 elements' return endif endif else scale=[-2,2] title='!17Heating Rate Forcing' cbtitle='!17Heating Rate Forcing (K/day)' levels=findgen(31)*(scale[1]-scale[0])/30. + scale[0] nlev=n_elements(levels) wh=closest(levels,0,0) wh=wh[0] colors=[fix(findgen(wh)/wh*126)+2,128,fix((findgen(nlev-wh-1)+1)/(nlev-wh-1)*126)+128] strlev=string(levels,format='(f5.2)') pdata=data endif else begin if keyword_set(scale) then begin if n_elements(scale) ne 2 then begin print,'SCALE: Must contain 2 elements' return endif endif else scale=[-3,3] title='!17Heating Rates' cbtitle='!17Heating Rate (K/day)' levels=findgen(31)*(scale[1]-scale[0])/30.0 + scale[0] nlev=n_elements(levels) ;colors=findgen(nlev)*250/(nlev-1)+5 wh=closest(levels,0,0) wh=wh[0] colors=[fix(findgen(wh)/wh*126)+2,128,fix((findgen(nlev-wh-1)+1)/(nlev-wh-1)*126)+128] strlev=string(levels,format='(f5.2)') pdata=data endelse if keyword_set(SITE) then title=title+', '+site if keyword_set(DATEARG) then title=title+', '+datearg xtitle='!17Time (hours)' ytitle='!17Height (km)' loadct,41,file='/export/home/mshupe/IDLcode/colorscopy.tbl' ;file='c:/rsi/shupetools/colorscopy.tbl' !p.color=1 ;Determine max height index ;-------------------------- if not(keyword_set(yrange)) then yrange=[min(ydata),max(ydata)] if not(keyword_set(xrange)) then xrange=[min(xdata),max(xdata)] ;Create the axes and plot window ;-------------------------------- contour,pdata,xdata,ydata,/nodata,$ position=[.1,.2,.95,.95],/xstyle,xrange=xrange,font=-1,$ title=title,xtitle=xtitle,ytitle=ytitle,$ background=0,yrange=yrange,/ystyle ;Create the contour plot ;------------------------ contour,pdata,xdata,ydata,position=[.1,.2,.95,.95], $ levels=levels,c_colors=colors,/cell_fill,font=-1,$ /xstyle,xrange=xrange,/ystyle,yrange=yrange,/noerase,$ clip=[xrange[0],yrange[0],xrange[1],yrange[1]] if keyword_set(boundary) then $ contour,boundary,xdata,ydata,position=[.1,.2,.95,.95], $ levels=[0.0001,10],/follow,c_labels=[0,0,0],$ /xstyle,xrange=xrange,/ystyle,yrange=yrange,/noerase ;Create the colorbar and labels ;------------------------------ cbst=.15 cben=.9 cbxwid=(cben-cbst)/nlev cb_x=[cbst,cbst,cbst+cbxwid,cbst+cbxwid] cb_y=[.075,.105,.105,.075] for i = 0,nlev-1 do begin polyfill,cb_x,cb_y,color=colors[i],/normal if i mod 3 eq 0 then xyouts,cb_x[0],cb_y[0]-0.03,strlev[i],/norm,font=-1,alignment=0.5 cb_x=cb_x+cbxwid endfor xyouts,.525,.01,cbtitle,alignment=0.5,font=-1,/normal if keyword_set(image) then begin case strupcase(!d.name) of 'WIN': write_jpeg,image,tvrd(true=1),true=1 'X': write_gif,image,tvrd() else: endcase endif end ;procedure