[ncl-talk] Understanding where statement

Guido Cioni guidocioni at gmail.com
Sun Dec 24 09:27:29 MST 2017


	function where (
		condtnl_expr  ,    
		true_value    ,    
		false_value        
	)

NCL is reading your condition like "where delz>= 0.5 then replace delz with its own value", thus nothing changes. Maybe you want to change the order of the conditions?

>     DELZ =where(delz.ge.0.5,delz at _FillValue,delz)


What you wrote is basically "removing" all the values less than 0.5 by substituting them with fill value which is 0.5. Thus, it makes sense that the minimum of your array is 0.5 

> On 24. Dec 2017, at 17:13, Barry Lynn via ncl-talk <ncl-talk at ucar.edu> wrote:
> 
> Hi:
> 
> I have the lines:
> 
>     delz at _FillValue = 0.5
>     DELZ =where(delz.ge.0.5,delz,delz at _FillValue)
>     print("DELZ")
>     printMinMax(DELZ,False)
> min=0.500002   max=2.36552
> 
> I don't understand why DELZ is still > 0.5.
> 
> Thank you for your suggestions,
> Happy Holidays
> -- 
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science, 
> The Hebrew University of Jerusalem, 
> Givat Ram, Jerusalem 91904, Israel 
> Tel: 972 547 231 170
> Fax: (972)-25662581
> 
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com <http://weather-it-is.com/>
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk


Guido Cioni
http://guidocioni.altervista <http://guidocioni.altervista/>.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171224/27dc6c78/attachment.html>


More information about the ncl-talk mailing list