[gradsusr] How to define a variable that is 1 if one parameter OR another parameter is in a certain range?

Jeff Duda jeffduda319 at gmail.com
Mon Jun 10 12:42:25 EDT 2013


Stefan,
Define two separate fields, one for each side of the disjunction.  Just
make sure to use the same color table for both displays so that in the end
it appears you are displaying just one field.

Jeff Duda


On Mon, Jun 10, 2013 at 2:54 AM, Stefan Gofferje <stefan at saakeskus.fi>wrote:

> Hi,
>
> how would one define a variable that is 1 if one parameter OR another
> parameter is in a certain range?
>
> I have found a way of expressing "AND" by masking out values, then
> const'ing them and const'ing them again, resulting in a result of 1 if
> the variable is in the desired range, e.g. cape>500 and li<-2 in this
> case. When I then simply multiply the 2 expressions, I get 1 if
> expression 1 AND expression 2 are within the desired range and 0 (or U)
> if either of them isn't.
>
> 'define tstorm =
> const(const(maskout(cape255_0mb,cape255_0mb-500),1.0),0,-u)*
> const(const(maskout(no4lftxsfc,(-1*no4lftxsfc)-2),1.0),0,-u)'
>
> Now, how would I express e.g. ((cape>500 AND li<-2) OR prate>20) in a
> similar way?
>
> Ideas, anyone?
>
> -Stefan
>
> _______________________________________________
> 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/20130610/015d40db/attachment-0003.html 


More information about the gradsusr mailing list