Skip to content

Commit

Permalink
Merge pull request #294 from GEOS-ESM/feature/ltakacs/Plot_Updates_20…
Browse files Browse the repository at this point in the history
…220915

Plot_Updates_20220915
  • Loading branch information
mathomp4 authored Sep 22, 2022
2 parents 82912e1 + 56766e1 commit 3909b86
Show file tree
Hide file tree
Showing 17 changed files with 426 additions and 217 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

## [1.6.1] - 2022-09-22

### Changed

Apply latest updates from L. Takacs to the plot package

## [1.6.0] - 2022-09-12

### Changed
Expand Down
31 changes: 19 additions & 12 deletions GEOS_Util/plots/grads_util/cbarn.gs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ endwhile
*
* Get plot size info
*
*ga-> q gxinfo
*Last Graphic = Shaded
*Page Size = 11 by 8.5
*X Limits = 1.5 to 10.5
*Y Limits = 1 to 8
*Xaxis = Lat Yaxis = Lev
*Mproj = 2

'query gxinfo'
rec2 = sublin(result,2)
rec3 = sublin(result,3)
Expand All @@ -116,6 +124,7 @@ endwhile
ylo = subwrd(rec4,4)

xmiddle = ( subwrd(rec3,4) + subwrd(rec3,6) )/2
say 'xmiddle = 'xmiddle

if( vpos = 'r' )
xhi = subwrd(rec3,6)
Expand Down Expand Up @@ -160,15 +169,15 @@ endwhile
if (vchk = 1 )

if(xmid = '') ; xmid = xhi+xd/2 ; endif
xwid = 0.2
ywid = 0.5
xl = xmid-xwid/2
xr = xl + xwid
xwid = 0.2 * scalex
ywid = 0.5 * scaley
xl = xmid-xwid/2
xr = xl + xwid
if (ywid*cint > ysiz*barsf)
ywid = ysiz*barsf/cint
endif
xwid = xwid*sbar*scalex
ywid = ywid*sbar*scaley
xwid = xwid*sbar
ywid = ywid*sbar
if(ymid = '') ; ymid = ysiz/2 ; endif
yb = ymid - ywid*cint/2
'set string 1 l 2'
Expand All @@ -180,19 +189,17 @@ endwhile
* horizontal bar
*

ywid = 0.4
xwid = 0.8

ywid = 0.4 * scaley
xwid = 0.8 * scalex
if(ymid = '') ; ymid = ylo/2-ywid/2 ; endif
yt = ymid + yoffset
yb = ymid
if(xmid = '') ; xmid = xsiz/2 ; xmid = xmiddle ; endif
if (xwid*cint > xsiz*barsf)
xwid = xsiz*barsf/cint
endif

xwid = xwid*sbar*scalex
ywid = ywid*sbar*scaley
xwid = xwid*sbar
ywid = ywid*sbar
xl = xmid - xwid*cint/2
'set string 1 tc 2'
vert = 0
Expand Down
17 changes: 17 additions & 0 deletions GEOS_Util/plots/grads_util/dc.gs
Original file line number Diff line number Diff line change
Expand Up @@ -1477,6 +1477,8 @@ if( face = GLOBAL | face = 6 | face = 65 )
if( face = GLOBAL )
* 'set parea 8.0 10.5 0.5 3.0'
'parea 4 3 4 3'
xmid = subwrd(result,1)
ybot = subwrd(result,2)
'set xyrev on'
'set xflip off'
'set yflip on'
Expand Down Expand Up @@ -1585,6 +1587,20 @@ endif
*******************************************************
*******************************************************

*if( face = GLOBAL )
** 'set parea 8.0 10.5 0.5 3.0'
* 'parea 4 3 4 3'
* 'set line 0 1 10'
* 'draw line 2.75 0.230041 2.75 8.25846l'
* 'draw line 0.246349 2.8 10.7644 2.8'
* 'draw line 0.246349 5.6 10.7644 5.6'
* 'draw line 5.5 0.230041 5.5 8.25846l'
* 'draw line 8.247 0.230041 8.247 8.25846l'
*endif

*******************************************************
*******************************************************

'close 'topofile
*if( gxout != Contour ) ; 'set gxout 'gxout ; endif
'set gxout 'gxout
Expand All @@ -1600,3 +1616,4 @@ if( face = GLOBAL )
'set parea off'
endif

return xmid' 'ybot
4 changes: 4 additions & 0 deletions GEOS_Util/plots/grads_util/lines
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ ylow = sublin (read(name),2)
xhigh = sublin (read(name),2)
yhigh = sublin (read(name),2)
endif
say 'xhigh = 'xhigh

* White-out Legend Region
* -----------------------
Expand All @@ -179,6 +180,9 @@ xtspot = x2spot + (xhigh-xlow)/10

vsize = (yhigh-ylow)/(2.5*numline)
hsize = (xhigh-(xhigh-xlow)/10-xtspot)/maxlength
*hsize = (xhigh-(xhigh-xlow)/50-xtspot)/maxlength
*hsize = hsize + 0.07
say 'hsize = 'hsize
'set strsiz 'hsize' 'vsize

'set string 1 l 1'
Expand Down
6 changes: 3 additions & 3 deletions GEOS_Util/plots/grads_util/parea
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ say ' left: 'left
say ' right: 'right

'getinfo page'
pagex = subwrd(result,1)
pagey = subwrd(result,2)
pagex = subwrd(result,1)
pagey = subwrd(result,2)

dx0 = pagex / xmax
dy0 = pagey / ymax
Expand Down Expand Up @@ -83,7 +83,7 @@ say 'Initial parea: 'x1' 'x2' 'y1' 'y2
endif

say ' Final parea: 'x1' 'x2' 'y1' 'y2
'set parea 'x1' 'x2' 'y1' 'y2
'set parea 'x1' 'x2' 'y1' 'y2
'set grads off'

xmid = ( x1 + x2 )/2
Expand Down
17 changes: 13 additions & 4 deletions GEOS_Util/plots/grads_util/statdplt.gs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,17 @@ if( hour < 100 ) ; hour = 0hour ; endif
'run getenv "SYSCMP_TDIM"'
tdim = result

'parea 'xloc' 'yloc' 'xmax' 'ymax
xmid = subwrd(result,1)
ybot = subwrd(result,2)
ytop = subwrd(result,3)
if( yloc = 1 )
'parea 'xloc' 'yloc' 'xmax' 'ymax' -top 1.0 -bot 0.3 -left 0.5 -right 0.3'
xmid = subwrd(result,1)
ybot = subwrd(result,2) - 0.4
ytop = subwrd(result,3) + 0.1
else
'parea 'xloc' 'yloc' 'xmax' 'ymax' -top 0.5 -bot 0.9 -left 0.5 -right 0.3'
xmid = subwrd(result,1)
ybot = subwrd(result,2) - 0.4
ytop = subwrd(result,3) + 0.1
endif

if( xloc = 1 & yloc = 1 )
x1 = 1.014 + ( 4.12 / 4 )
Expand All @@ -89,6 +96,8 @@ if( xloc = 1 & yloc = 1 )
y2 = 7.62
'set parea 'x1' 'x2' 'y1' 'y2
xmid = ( x1 + x2 )/2
ybot = y1 - 0.4
ytop = y2 + 0.1
endif

'set datawarn off'
Expand Down
37 changes: 23 additions & 14 deletions GEOS_Util/plots/grads_util/statdpltz.gs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,17 @@ if( hour < 100 ) ; hour = 0hour ; endif
tdim = result
say 'TDIM: 'tdim

'parea 'xloc' 'yloc' 'xmax' 'ymax
xmid = subwrd(result,1)
ybot = subwrd(result,2)
ytop = subwrd(result,3)
if( yloc = 1 )
'parea 'xloc' 'yloc' 'xmax' 'ymax' -top 1.0 -bot 0.3 -left 0.5 -right 0.3'
xmid = subwrd(result,1)
ybot = subwrd(result,2) - 0.4
ytop = subwrd(result,3) + 0.1
else
'parea 'xloc' 'yloc' 'xmax' 'ymax' -top 0.5 -bot 0.9 -left 0.5 -right 0.3'
xmid = subwrd(result,1)
ybot = subwrd(result,2) - 0.4
ytop = subwrd(result,3) + 0.1
endif

if( xloc = 1 & yloc = 1 )
x1 = 1.014 + ( 4.12 / 4 )
Expand All @@ -75,6 +82,8 @@ if( xloc = 1 & yloc = 1 )
y2 = 7.62
'set parea 'x1' 'x2' 'y1' 'y2
xmid = ( x1 + x2 )/2
ybot = y1 - 0.4
ytop = y2 + 0.1
endif

'set datawarn off'
Expand Down Expand Up @@ -140,8 +149,8 @@ endif
'define delDamp = 'field'Damp'tag2'z'
'define delDphz = 'field'Dphz'tag2'z'

* To Unify Contour Interval and Scaling, use: delDmse , otherwise use: del'type'
* ------------------------------------------------------------------------------
* To Unify Contour Interval and Scaling, use: delDmse , otherwise use: del'type'
* ------------------------------------------------------------------------------
* dummy = getstuff( 'delDmse' )
dummy = getstuff( del''type'' )
diff_cint = subwrd(dummy,1)
Expand Down Expand Up @@ -170,7 +179,7 @@ endif
'define delDphz = 'field'Dphz'tag2'z'

if( tipe = Dres )
'define delDmse = delDmse - ( delDmes + delDamp + delDphz)'
'define delDmse = delDmse - ( delDmes + delDamp + delDphz)'
endif

'define diff = del'type
Expand Down Expand Up @@ -276,45 +285,45 @@ say 'MONTH_LABEL: 'month

if( tipe = Dmse )
'set strsiz 0.10'
'draw string 'xmid' 'ytop' MSE: Mean Square Error (x10**'diffm')' ;
'draw string 'xmid' 'ytop' MSE: Mean Square Error (x10**'diffm')' ;
'cbarn -sbar 0.5 -snum 0.35 -xmid 'xmid' -ymid 'ybot' -scaley 0.5 -scalex 1.0'
endif

if( tipe = Dres )
'set strsiz 0.08'
'draw string 'xmid' 'ytop' MSE - [ BIAS + AMPLITUDE + PHASE] (x10**'diffm')' ;
'draw string 'xmid' 'ytop' MSE - [ BIAS + AMPLITUDE + PHASE] (x10**'diffm')' ;
'cbarn -sbar 0.4 -snum 0.35 -xmid 'xmid' -ymid 'ybot' -scaley 0.5 -scalex 0.9'
endif
if( type = Dmes )
'set strsiz 0.08'
'draw string 'xmid' 'ytop' BIAS Error Difference (x10**'diffm')' ;
'draw string 'xmid' 'ytop' BIAS Error Difference (x10**'diffm')' ;
'cbarn -sbar 0.4 -snum 0.35 -xmid 'xmid' -ymid 'ybot' -scaley 0.5 -scalex 0.9'
endif
if( type = Damp )
'set strsiz 0.08'
'draw string 'xmid' 'ytop' AMPL Error Difference (x10**'diffm')' ;
'draw string 'xmid' 'ytop' AMPL Error Difference (x10**'diffm')' ;
'cbarn -sbar 0.4 -snum 0.35 -xmid 'xmid' -ymid 'ybot' -scaley 0.5 -scalex 0.9'
endif
if( type = Dphz )
'set strsiz 0.08'
'draw string 'xmid' 'ytop' PHASE Error Difference (x10**'diffm')' ;
'draw string 'xmid' 'ytop' PHASE Error Difference (x10**'diffm')' ;
'cbarn -sbar 0.4 -snum 0.35 -xmid 'xmid' -ymid 'ybot' -scaley 0.5 -scalex 0.9'
endif


if( tipe = Dres )
'set vpage off'
'set string 1 c 6'

'set strsiz 0.16'
'draw string 5.50 8.40 Zonal Mean 'UFIELD' 'month' 'year' Forecast Hour: 'hour
'set strsiz 0.12'
'draw string 5.50 8.18 'exp2' - 'exp1' 'numf'-member Ensemble (Contour > 'confidence'% Confidence)'
'set strsiz .10'
'draw string 5.50 7.95 'title

endif

return

function getstuff( q )

'minmax.simple 'q
Expand Down
Loading

0 comments on commit 3909b86

Please sign in to comment.