[ncl-talk] where function

Laura Fowler laura at ucar.edu
Thu Jun 7 11:14:04 MDT 2018


Hello:

I am trying to make a composite of 2 cloud layers using the where
function but that does not seem to work. I am attaching the plots
test.layers_3.pdf and test.layers_7.pdf which are monthly mean values
of the liquid water paths for the lower cloud layer and the upper
cloud layer. Both data include missing values (green), but the liquid
water path for the upper cloud layer contains a lot more missing data
than the lower cloud layer.

I would like to make a composite of the two layers. So first, I used
the where function as below:

lw = where(lw_aqua_3.ne.lw_aqua_3 at _FillValue .and.
lw_aqua_7.ne.lw_aqua_7 at _FillValue, \
                   lw_aqua_3+lw_aqua_7,lw_aqua_3 at _FillValue)

where lw_aqua_3 and lw_aqua_7 are the liquid water paths for the lower
and upper cloud layers, respectively. The plot
test1.add_layers.pdf show the "total" liquid water path.


What I can't seem to be able to do is to fill the missing value of lw
with lw_aqua_3 where lw_aqua_7 is actually missing and vice versa. So
I did:

;lw2 = where(lw_aqua_3.ne.lw_aqua_3 at _FillValue .and.
lw_aqua_7.eq.lw_aqua_7 at _FillValue, \
                      lw_aqua_3,lw)

but that does not work as the plot of lw2 (test1.add_layers.pdf) is
the same as the plot for lw (since lw is missing where lw_aqua_3 is
not missing). I also tried to use ismissing but that does not work
since lw and lw2 are a two dimensional array.


Is there a simpler way to compute that kind of composite?

Thanks,
Laura







-- 
!-------------------------------------------------------------------------------------------------------------
Laura D. Fowler
Mesoscale and Microscale Meteorology Division (MMM)
National Center for Atmospheric Research
P.O. Box 3000, Boulder CO 80307-3000

e-mail: laura at ucar.edu
phone: 303-497-1628

!-------------------------------------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.layers_3.pdf
Type: application/pdf
Size: 254927 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180607/153ddbd6/attachment-0004.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.layers_7.pdf
Type: application/pdf
Size: 304417 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180607/153ddbd6/attachment-0005.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test1.add_layers.pdf
Type: application/pdf
Size: 315379 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180607/153ddbd6/attachment-0006.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test2.add_layers.pdf
Type: application/pdf
Size: 315792 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180607/153ddbd6/attachment-0007.pdf>


More information about the ncl-talk mailing list