[ncl-talk] mashing together multiple precip category variables into 1 variable

Micah Sklut micahs2005 at gmail.com
Sat Apr 4 13:25:42 MDT 2020


That did the trick Dennis, thanks!

On Sat, Apr 4, 2020 at 11:07 AM Dennis Shea <shea at ucar.edu> wrote:

>  Possibly:
>
>
>   fgrb          = *addfiles(*...)
>   prcType   = fgrb[:]->RAIN
>   work        = fgrb[:]->FREEZE_RAIN
>   prcType   = *where*
> <http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml>(work.ne.0,
> 2, prcType)
>   work        = fgrb[:]->ICE
>   prcType   = where(work.ne.0, 3, prcType)
>   work        = fgrb[:]->SNOW
>   prcType   = where(work.ne.0, 4, prcType)
>
> Cheers
>
>
> On Sat, Apr 4, 2020 at 8:53 AM Micah Sklut via ncl-talk <ncl-talk at ucar.edu>
> wrote:
>
>> Hi,
>>
>> Using GFS data, there are 4 different precipitation category variables:
>> rain, freezing rain, ice, snow
>>
>> Each of these variables has a boolean 0 or 1 value for each grid point.
>> I'd like to combine these 4 variables into 1 variable, such that each grid
>> point has a value of:
>> no precip = 0
>> rain = 1
>> freezing rain = 2
>> ice = 3
>> snow = 4
>>
>> Is looping through all of the grid points in space and time, the approach
>> that needs to be taken here? Or is there a more efficient NCL function
>> approach that can be taken?
>>
>> Thanks,
>>
>> --
>> Micah Sklut
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Micah Sklut
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20200404/975f4f01/attachment.html>


More information about the ncl-talk mailing list