[gradsusr] How to limit variable values to a range?

Stephen McMillan smcmillan at planalytics.com
Sun Mar 29 13:44:43 EDT 2015


Brandon,
In addition to using maskout and const, If you are using opengrads, the
user defined function "if" from Ben-Jei Tsuang's Extensions collection,
will accomplish what you need:

http://opengrads.org/doc/udxt/libbjt/

See link for syntax and example.  If you have more questions, I'll be happy
to assist.
Stephen Mc

On Sat, Mar 28, 2015 at 8:53 PM, Brandon Schmidt <admin at wilmingtonwx.com>
wrote:

> GrADS users,
>
> I'm currently trying to display a significant tornado parameter map but
> I've reached an obstacle. One of the terms in the STP equation requires
> it's variable values to be within a specific range. The term is "((2000 -
> sbLCL) / 1000)" using the variable sbLCL. When sbLCL is below 1000, it
> should be set to 1000. When sbLCL is above 2000, it should be set to 2000
> (e.x. 130 should become 1000, 1350 should remain 1350, and 4000 should
> become 2000).
>
> I know this calculation will definitely involve manipulation with the
> *maskout()* and/or *const()* functions but I have no idea where to begin.
> Is there another work-around technique that I'm not seeing?
>
> Any help would be greatly appreciated...Thanks! - Brandon
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20150329/89a4eb2f/attachment.html 


More information about the gradsusr mailing list