contour over particular values of shading

Mary Jo Nath Mary-Jo.Nath at NOAA.GOV
Tue Jan 2 09:21:41 EST 2007


John,

I think you can use maskout() function to do this.

'd maskout(var2.2,var1-5)'

When var1 < 5, then (var1-5) is negative, masking out the value of
var2.2, so no contours will be drawn.

In your script:

'open a1.ctl'
'open a2.ctl'
'set lat -20 20'
'set lon 0 360'
'run B-R.gs'
'set clevs 1 2 3 4 5 6 7 8 9 10'
'set ccols 16 17 18 19 20 50 21 22 23 24 25'
'set gxout shaded'
'd var1'
* if(var1>5) ** commented out
'set ccolor 0'
'set gxout contour'
'set clevs 0.5 1.0 1.5 2.0'
'set ylpos 0 r'
'd maskout(var2.2,var1-5)'
* endif
'run cbarn 0.7 0 4.0 5.5'

MJ

John Guhin wrote:
> Hi,
>      I have a variable shaded (values form 1 to 10), and I want to
> plot a contour of another variable on it. But I want to plot contours
> only over the region where shaded values are more than 5. I tried with
> the following, but did not work. It is plotting contours over all
> region. Any help will be great....
>
> 'open a1.ctl'
> 'open a2.ctl'
> 'set lat -20 20'
> 'set lon 0 360'
> 'run B-R.gs'
> 'set clevs 1 2 3 4 5 6 7 8 9 10'
> 'set ccols 16 17 18 19 20 50 21 22 23 24 25'
> 'set gxout shaded'
> 'd var1'
> if(var1>5)
> 'set ccolor 0'
> 'set gxout contour'
> 'set clevs 0.5 1.0 1.5 2.0'
> 'set ylpos 0 r'
> 'd var2.2'
> endif
> 'run cbarn 0.7 0 4.0 5.5'
>
>
> --
> John Guhin



More information about the gradsusr mailing list