pro field_scale, cct_min, cct_max, title=title, mxfld=mxfld, window=window ;+ ; ; procedure: field_scale ; ; purpose: create window with scales of field_plot displays ; ; author: paul@ncar, 5/93 (minor mod's by rob@ncar) ; ;============================================================================== ; ; Check number of parameters. ; if n_params() ne 2 then begin print print, "usage: field_scale, cct_min, cct_max" print print, " Arguments" print, " cct_min - minimun for continuum scale" print, " cct_max - maximun for continuum scale" print, " Keywords" print, " title - title for window" print, " (def 'field_scale')" print, " mxfld - max field displayed, gauss" print, " (def 4000)" print, " window - index of opened free window" print return endif ;- ;Save system stuff. sav_w = !d.window sav_p = !p ;Get character height in pixmap window. !p.font = -1 window, /free, /pixmap, xsize=100, ysize=100 erase, 0 xyouts, 0, 0, 'X', color=1, /device hgt = 1.+max( where( tvrd() eq 1 ) )/100 csize = 12./hgt wdelete, !d.window ;Open window. xsize = 300 ysize = 300 mrg = 16 if n_elements(title) eq 0 then title='field_scale' window, /free, xsize=xsize, ysize=ysize, title=title $ , xpos=1144-xsize, ypos=900-ysize window = !d.window erase, !d.n_colors-1 ;Label the window. xyouts, /device, align=0.5, charsize=csize, color=0 $ ,[ xsize/6, xsize/2, xsize*5/6, xsize/4, xsize*3/4 ] $ ,[ ysize-mrg, ysize-mrg, ysize-mrg, ysize/2-mrg, ysize/2-mrg ] $ ,[ 'Continuum', 'Field', 'Doppler', 'Azimuth', 'Inclination' ] ;Color bar raster. ydim = ysize/2-3*mrg xdim = 40 yrast = lindgen(xdim,ydim)/xdim ;Display continuum scale. tvasp, yrast, xsize/6-xdim/2, ysize/2+mrg, /gray cmin = strcompress(string(cct_min,format='(i10)')) cmax = strcompress(string(cct_max,format='(i10)')) xyouts, /device, align=0.5, charsize=csize, color=0 $ ,xsize/6 $ ,[ ysize/2, ysize-2*mrg ]+2 $ ,[ cmin, cmax ] ;Display field strength scale. if n_elements(mxfld) eq 0 then mxfld=4000 tvasp, yrast, xsize/2-xdim/2, ysize/2+mrg, /gray, /invert xyouts, /device, align=0.5, charsize=csize, color=0 $ ,xsize/2 $ ,[ ysize/2, ysize-2*mrg ]+2 $ ,[ '0', stringit(mxfld) ] ;Display Doppler scale. tvasp, yrast, xsize*5/6-xdim/2, ysize/2+mrg xyouts, /device, align=0.5, charsize=csize, color=0 $ ,xsize*5/6 $ ,[ ysize/2, ysize-2*mrg ]+2 $ ,[ '-2 km/sec', '2 km/sec' ] ;Display azimuth scale. xdim= ydim tv, cbar_azimuth(D0=ydim,/notable), xsize/4-xdim/2, mrg xyouts, /device, align=0.5, charsize=csize, color=0 $ , xsize/4 $ ,[ mrg+ydim, 0 ]+2 $ ,[ '90', '270' ] xyouts, /device, align=0.0, charsize=csize, color=0 $ ,[ 0, xsize/4+xdim/2 ] $ , mrg+ydim/2-4 $ ,[ '180', ' 0' ] ;Display inclination scale. xdim = ydim/2 tv, cbar_zenith(D0=ydim,/notable), xsize*3./4.-xdim/2, mrg xyouts, /device, align=.0, charsize=csize, color=0 $ ,[ xsize*3/4-xdim/2, xsize*3/4+xdim/2, xsize*3/4-xdim/2 ] $ ,[ mrg+ydim+2, mrg+ydim/2-4, 2 ] $ ,[ '0', ' 90', '180' ] ;Restore system stuff. if sav_w ge 0 then wset, sav_w !p = sav_p end