; ;------------------------------------------------------------------ ; pro pltst,cgm=cgm,ps=ps @pltdat.h ; hem = 'S' if map.projcen(0) gt 0. then hem = 'N' dlat = frame.yy(1)-frame.yy(0) nlats = fix(((90.-abs(map.stperim)+dlat/2.)/dlat)+.5) if (map.projcen(0) lt 0. and frame.yy(nlats-1) gt map.stperim) or $ (map.projcen(0) gt 0. and frame.yy(frame.ny-nlats) lt map.stperim) then $ nlats = nlats-1 iskip = frame.ny-nlats if map.projcen(0) lt 0. then iskip = 0 glat = fltarr(nlats) for j=0,nlats-1 do glat(j) = frame.yy(iskip+j) genglb = frame.zz if map.log10 gt 0 then log10f,genglb,frame.nx*frame.ny,1.e-20,!spval fminmax, genglb,frame.nx*frame.ny,gmin,gmax,!spval if gmin eq 1.e36 and gmax eq -1.e36 then begin print,'>>> no data (array is all special value) (maybe height too high?)' print,'>>> NO PLOT MADE <<<' return endif genpol = fltarr(frame.nx,nlats) for j=0,nlats-1 do genpol(*,j) = genglb(*,iskip+j) fminmax,genpol,frame.nx*nlats,rmin,rmax,!spval if rmin eq rmax then begin print,'>>> pltst: apparent constant value -- no plot made' return endif ; chsize_toplab = 1.5 & if keyword_set(cgm) then chsize_toplab = 1.2 chsize_tics = 1.3 & if keyword_set(cgm) then chsize_tics = 1. chsize_clines = 1.2 & if keyword_set(cgm) then chsize_clines = .9 chsize_range = 1.1 & if keyword_set(cgm) then chsize_range = .8 chsize_clrbar = 1.3 ; ; Set up polar stereographic projection: ; if imcon eq 0 or imcon eq 2 then begin ; doing image xur = .79 & yur = .89 xll = .05 & yll = .15 endif else begin xur = .87 & yur = .91 xll = .13 & yll = .17 endelse fudge = .02*(xur-xll) mappos = [xll-fudge,yll-fudge,xur+fudge,yur+fudge] ; ; Note: if mapset (which calls map_set) is not called twice here, ; the projection will be 'squashed' if map.stperim has been ; changed to higher latitude since the previous frame ; mapset,mappos,map.projcen,map.stperim mapset,mappos,map.projcen,map.stperim mappos = [xll,yll,xur,yur] ; ; Warp an image to the projection: ; if (imcon eq 0 or imcon eq 2) then begin if cont.imapply gt 0 then begin ; apply cont.cmin,cmax to color scale glbimage = bytscl(genglb(*,*),top=!d.table_size-3,min=cont.cmin,$ max=cont.cmax)+1 indx = where(genglb gt cont.cmax or genglb lt cont.cmin, cnt) if cnt gt 0 then begin glbimage(indx) = 0 print,' Removed ',cnt,' points outside cmin,cmax' endif endif else begin glbimage = bytscl(genglb(*,*),top=!d.table_size-3,min=rmin,max=rmax)+1 endelse indx = where(genglb ge !spval/10., cnt) if cnt ne 0 then begin print,'Found ',cnt,' "missing data" points' glbimage(indx) = 0 ; make missing data black endif im = map_image(glbimage,xim,yim,xsiz,ysiz,compress=map.imcompress,$ latmin=frame.yy(0),latmax=frame.yy(frame.ny-1),/bilinear,/whole_map) endif ; ; Set up contouring cmin,cmax,cint: ; if imcon gt 0 then begin prntcon = cont.prntcon if keyword_set(cgm) or keyword_set(ps) then prntcon = 0 levels = conspec(genpol,cont.cmin,cont.cmax,cont.cint,cont.nlev,$ prntcon) cont.nlev = n_elements(levels) if cont.nlev le 1 then begin if cont.nlev le 0 then $ print,'>>> pltst: no data (array all special value) -- no frame made' if cont.nlev eq 1 then $ print,'>>> pltst: only one contour level -- no frame made' return endif ; ; clabels(cont.nlev) (c_labels) = int flag for whether or not to label ; contour line ; clines(cont.nlev) (c_linestyle) = int flag for linestyles ; (0=solid, 2=dashed) ; dashneg = 1 clabels = intarr(cont.nlev) clines = intarr(cont.nlev) ; default to solid lines (all 0's) for i=0,cont.nlev-1 do begin if cont.nthlab le 0 then clabels(i) = 0 else $ if cont.nthlab eq 1 then clabels(i) = 1 else $ if i mod cont.nthlab eq 0 then clabels(i)=1 else clabels(i)=0 if dashneg then begin clines(i) = 0 if levels(i) lt 0. then clines(i) = 2 endif endfor if cont.cint gt 0. then $ contitle = 'CONTOUR ' + $ strcompress(string(levels(0),format="(G9.3)"),/remove_all)+' TO '+$ strcompress(string(levels(cont.nlev-1),format="(G9.3)"),/remove_all)+$ ' BY '+ strcompress(string(levels(1)-levels(0),format="(G9.3)"),$ /remove_all) + ' (MIN,MAX=' + strcompress(string(rmin,format="(G9.3)"),$ /remove_all) + ',' + strcompress(string(rmax,format="(G9.3)"),$ /remove_all) + ')' $ else $ contitle = 'CONTOUR ' + $ strcompress(string(levels(0),format="(G9.3)"),/remove_all)+' TO '+$ strcompress(string(levels(cont.nlev-1),format="(G9.3)"),/remove_all)+$ ' BY '+ strcompress(string(levels(1)-levels(0),format="(G9.3)"),$ /remove_all) endif ; imcon > 0 ; ; Set up color bar: ; barw = .04 & barh = yur-yll xbar = xur+.05 & ybar = yll barmin = rmin & barmax = rmax if cont.imapply gt 0 then begin barmin = cont.cmin barmax = cont.cmax endif barlabs = [strcompress(string(barmin,format="(g10.4)"),/remove_all),$ strcompress(string(0.5*(barmin+barmax),format="(g10.4)"),/remove_all),$ strcompress(string(barmax,format="(g10.4)"),/remove_all)] psx = xur-xll & psy = yur-yll ; postscript size ; ; Draw contours and/or image: ; toplab = frame.toplab xmid = .5*(xll+xur) if imcon ne 0 and imcon ne 2 then $ xyouts,xmid,yur+.06,toplab,/norm,charsize=chsize_toplab,align=.5 $ else $ xyouts,.5,yur+.06,toplab,/norm,charsize=chsize_toplab,align=.5 platlab = strcompress(string(map.stperim,format="('PERIMLAT=',f5.1)"),$ /remove_all) xyouts,.85,yur+.03,platlab,charsize=chsize_range,align=.5,/norm ;box,/itic case imcon of ; ; Image only: ; 0: begin tv,im,xim,yim,xsize=xsiz,ysize=ysiz clrbar,barw,barh,xbar,ybar,barlabs,botcolor=1,topcolor=!d.table_size-2,$ charsize=chsize_clrbar if map.continents gt -1 then map_continents,mlinestyle=contline,$ color=map.continents if map.grid gt -1 then map_grid,/label,color=map.grid labpol,mappos,hem,chsize_tics xyouts,xmid,yll-.13,frame.botlab,align=.5,/norm,charsize=chsize_range end ; ; Contour only: ; 1: begin if map.continents gt -1 then map_continents,mlinestyle=contline,$ color=map.continents if map.grid gt -1 then map_grid,/label,color=map.grid contour,genpol,frame.xx,glat,/norm,/noerase,position=mappos,/follow,$ xstyle=5,ystyle=5,nlevels=cont.nlev,levels=levels,$ c_charsize=chsize_clines,c_labels=clabels,max_value=!spval/10.,$ c_linestyle=clines,/overplot,c_colors=[cont.conclr] xyouts,xmid,yll-.10,contitle,align=.5,/norm,charsize=chsize_range labpol,mappos,hem,chsize_tics xyouts,xmid,yll-.14,frame.botlab,align=.5,/norm,charsize=chsize_range end ; ; Image + contour ; 2: begin tv,im,xim,yim,xsize=xsiz,ysize=ysiz clrbar,barw,barh,xbar,ybar,barlabs,botcolor=1,topcolor=!d.table_size-2,$ charsize=chsize_clrbar contour,genpol,frame.xx,glat,/norm,/noerase,position=mappos,/follow,$ xstyle=5,ystyle=5,nlevels=cont.nlev,levels=levels,$ c_charsize=chsize_clines,c_labels=clabels,max_value=!spval/10.,$ c_linestyle=clines,/overplot,c_colors=[cont.conclr] xyouts,xmid,yll-.1,contitle,align=.5,/norm,charsize=chsize_range if map.continents gt -1 then map_continents,mlinestyle=contline,$ color=map.continents if map.grid gt -1 then map_grid,/label,color=map.grid labpol,mappos,hem,chsize_tics xyouts,xmid,yll-.14,frame.botlab,align=.5,/norm,charsize=chsize_range end else: print,'bad imcon' endcase if vec.ivec gt 0 then begin ylaboff = .28 if imcon eq 2 then ylaboff = .35 pltst_vec,mappos,cgm=cgm,ps=ps,ylaboff=ylaboff endif ;mapset,mappos,map.projcen,map.stperim ; to reset mapping coords if keyword_set(cgm) le 0 and keyword_set(ps) le 0 then begin print,'Completed frame ',iframe iframe = iframe+1 endif return end