login

dshade.gs

Top / GrADS / script / dshade.gs

Japanese / English

  • Note: Since GrADS 2.1 or later supports transparent color, this script will be removed in future. Also use color.gs which supports transparent color.

Name

xcbar - Draw two shading figures.

Synopsis

1: Set background color

dshade set back color-args...

2: Set overlay color

dshade set over [-alpha min max] color-args...

3: Draw

dshade draw var-back var-over

Description

Use GrADS 2.0 or higher. Only x-y cross section is supported now. To show help, simply run "color".

Options

1: Set background color

color-args
Same as color.gs.

2: Set overlay color

color-args
Same as color.gs.
-alpha min max
Start and end value of transparency. 0-255.

3: Draw

var-back
Background variable.
var-over
Variable to overlay.

Examples

(1) Draw zonal wind over topography

ga-> open hgs.ctl
ga-> open u.ctl
ga-> dshade set back -levs 0 1000  -kind (96,96,148)->(94,118,58)->(74,44,19)
ga-> dshade set over -levs -50 0 50 -kind (255,255,255)->(255,255,255) -alpha 230 0
ga-> dshade draw hgs-100 u.2

(2) Draw zonal wind over topography (high resolution)

Use dummy control file with high resolution and interpolate to its variable.

ga-> open dshade_sample2.ctl
ga-> open hgs.ctl
ga-> open u.ctl
ga-> vback = lterp(hgs.2(t=1)-100, dummy)
ga-> vover = lterp(u.3(z=1,t=1), dummy)
ga-> dshade set back -levs 0 1000  -kind (96,96,148)->(94,118,58)->(74,44,19)
ga-> dshade set over -levs -50 0 50 -kind (255,255,255)->(255,255,255) -alpha 230 0
ga-> dshade draw vback vover
  • dshade_sample2.ctl
DSET ^dummy.grd
OPTIONS TEMPLATE
UNDEF -9.99e+20
*XDEF 360 LINEAR   0.0 1
*YDEF 181 LINEAR -90.0 1
XDEF 3600 LINEAR   0.0 0.1
YDEF 1801 LINEAR -90.0 0.1
*XDEF 7200 LINEAR   0.0 0.05
*YDEF 3601 LINEAR -90.0 0.05
ZDEF   1 LEVELS 0.0
TDEF   1 LINEAR 01jan2000 1mo
VARS 1
dummy 0 99 dummy
ENDVARS

(4) Draw zonal wind over topography (high resolution) No.2

ga-> open dshade_sample3.ctl
ga-> open hgs.ctl
ga-> open u.ctl
ga-> vback = lterp(hgs.2(t=1)-100, dummy)
ga-> vover = lterp(u.3(z=1,t=1), dummy)
ga-> dshade set back -levs 0 100 500 1000 2000 3000 5000 -kind blue->lime->limegreen->green->maroon->purple->red->silver
ga-> dshade set over 0 40 1 -kind (255,255,255)->(255,255,255) -alpha 0 230
ga-> dshade draw vback vover
  • dshade_sample3.ctl
DSET ^dummy.grd
OPTIONS TEMPLATE
UNDEF -9.99e+20
*XDEF 360 LINEAR   0.0 1
*YDEF 181 LINEAR -90.0 1
XDEF 1800 LINEAR   0.0 0.2
YDEF 901 LINEAR -90.0 0.2
*XDEF 7200 LINEAR   0.0 0.05
*YDEF 3601 LINEAR -90.0 0.05
ZDEF   1 LEVELS 0.0
TDEF   1 LINEAR 01jan2000 1mo
VARS 1
dummy 0 99 dummy
ENDVARS

Script source code