[gradsusr] Only plot data IF var <= 10

Jeff Duda jeffduda319 at gmail.com
Sat Dec 26 19:05:31 EST 2015


Unless you're running OpenGrads, if statements do not work on fields. IF
statements in scripts only apply to script variables.

The field analogy to the IF statement is to use a combination of const()
and maskout(), usually nested. Your example would be converted into

d maskout(tmp2m,5-tmp2m)

Jeff Duda

On Sat, Dec 26, 2015 at 2:54 PM, Christopher Gilroy <chris.gilroy at gmail.com>
wrote:

> Hey guys, I don't believe IF statements are meant to be used like this
> which would make sense why it's not working:
>
> 'define maxtemp = max(tmpprs,lev=1000,lev=500)-273.15'
>
> if ( maxtemp <= 5 )
> 'd tmp2m'
> endif
>
> That expectation would have been to only plot tmp2m where maxtemp <= 5.
>
> As I said, I don't think it's as easy/designed to use IF statements like
> this? I think I may have to do something with const and maskout in order to
> do something like this?
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20151226/8193d06f/attachment.html 


More information about the gradsusr mailing list