[gradsusr] Multi if maskout
Jeff Duda
jeffduda319 at gmail.com
Sun Aug 4 00:51:04 EDT 2019
Look at the documentation for the if() function (note: this is not the same
thing as the if-construct in the scripting language). It seems what you're
looking for should be pretty straightforward.
Jeff Duda
On Sat, Aug 3, 2019 at 6:04 PM Tyler Youschak <tyleryouschak at gmail.com>
wrote:
> Hello,
>
> I've been trying to do some magic to create an index. I was trying to
> originally create a function that had an if to check to see if the
> temperature were between two values, and then another if to check the value
> of another computed variable. Here to find out, I couldn't get it to work
> because it wouldn't actually use the variables I created in the functions.
> Later, I stumbled across an email in this group saying that it would take
> *more* time to do an if like I was doing and would be quicker to do a mask
> out for computation time.
>
> So, that leads me to my question. I'm trying to do an "advanced" maskout
> (advanced to me, most likely not to those advanced members in here)! Any
> chance anyone could give me a starting point, or at least get me started
> for the first temperature range.
>
> Here's my "pseudo code" (where t is temp and z is lcl height):
> if(math_nint(t) = 0)
> if((z >= 38000) & (z < 42000)) ; 'define wsi = 1' ; endif
> if((z >= 42000) & (z < 49000)) ; 'define wsi = 2' ; endif
> if((z >= 49000) & (z <= 55000)) ; 'define wsi = 3' ; endif
> endif
>
> if(math_nint(t) = 1)
> if((z >= 35500) & (z < 42500)) ; 'define wsi = 1' ; endif
> if((z >= 42500) & (z < 47000)) ; 'define wsi = 2' ; endif
> if((z >= 47000) & (z <= 52500)) ; 'define wsi = 3' ; endif
> endif
>
> Thanks,
> Tyler Youschak
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
--
Jeff Duda, Research Scientist
University of Colorado Boulder
Cooperative Institute for Research in Environmental Sciences
NOAA/OAR/ESRL/Global Systems Division
Boulder, CO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gradsusr.org/pipermail/gradsusr/attachments/20190803/816f28bd/attachment.html>
More information about the gradsusr
mailing list