<div dir="ltr"><div><div><div><div><div>A clever use of the const() and maskout() functions will give you the desired result. The reason you are only seeing one field in the end is that every time you run a display command with gxout set as shaded or grfill, the latter field is covering up the former field anywhere the colors are not the background value or a transparent color.<br><br></div>An example of how to use the const() and maskout() functions for the t2 field would be:<br></div>To limit the field to only values below 298 K...<br></div>'define var = const(maskout(t2,298-t2),0,-u)<wbr>'<br></div>The above command would set all areas where t2 > 298 K to 0 and leave all other areas untouched. You can nest this field within another set of const(maskout(...)) functions to handle the other end (< 295) and yet another one for the 1s in the middle. One way to keep this command from getting ugly is to partition it...<br></div><div>'define part1 = const(maskout(t2,298-t2),0,-u)<wbr>'<br></div><div>'define part2 = const(maskout(part1,part1-295)<wbr>,0,-u)'<br></div><div>'define part3 = const(part2,1)'<br></div><div>'define var = part3'<br></div><div><br></div>Jeff Duda<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 27, 2016 at 2:24 AM, Nibin Gopi <span dir="ltr"><<a href="mailto:nibingopi10@gmail.com" target="_blank">nibingopi10@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>i have do the follwing code for ploting constant field according to some condition satisfied. but it only shows one green color plot all over the map(i attched the fig)<br><br></div>the code is <br><br><br><br>'open cnt_2014-09-25_d03.ctl'<br>'set t 1'<br>'define var = t2'<br>'define var1=rh2'<br>'define var2=rainc+rainnc'<br>i=1<br>while(i<=324)<br>j=1<br>while(j<=324)<br>'q defval var 'i' 'j<br>'q defval var1 'i' 'j<br>'q defval var2 'i' 'j<br>val = subwrd(result,3)<br>val2=subwrd(result,3)<br>val3=subwrd(result,3)<br><br>if (val > 295.0 & val < 298 )<br> 'set defval var 'i' 'j' '1<br>endif<br>if (val > 298.0 )<br> 'set defval var 'i' 'j' '0<br>endif<br>if (val1 > 50.0 & val1 < 60.0 )<br> 'set defval var1 'i' 'j' '2<br>endif<br><br>if (val1 > 60 )<br> 'set defval var1 'i' 'j' '3<br>endif<br>if (val2 > 75.0 & val2 < 175.0 )<br> 'set defval var2 'i' 'j' '4<br>endif<br><br>if (val2 > 175.0 )<br> 'set defval var2 'i' 'j' '5<br>endif<br>j=j+2<br>endwhile<br>i=i+1<br>endwhile<br>'set gxout grfill'<br>'set clevs 0 1 2 3 4 5'<br>'set ccols 2 3 10 6 8 15'<br>'d var'<br>'d var1'<br>'d var2'<br>'run <a href="http://cbarn.gs" target="_blank">cbarn.gs</a>'<br>'printim 1.png white'<br>'quit'<br></div> <br><br></div>please give me some solution<br><br><br><br><br><img alt="Inline image 1" src="cid:ii_1593f610c6688d47" width="336" height="435"><br> <br></div>
<br>______________________________<wbr>_________________<br>
gradsusr mailing list<br>
<a href="mailto:gradsusr@gradsusr.org">gradsusr@gradsusr.org</a><br>
<a href="http://gradsusr.org/mailman/listinfo/gradsusr" rel="noreferrer" target="_blank">http://gradsusr.org/mailman/<wbr>listinfo/gradsusr</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Jeff Duda<br>Post-doctoral research fellow<br>University of Oklahoma School of Meteorology<br></div></div></div></div></div>
</div>