<div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="color:rgb(255,0,0)">My hasty response was <b>not</b> correct.</span> <br></div><div><br></div><div>Rashed Mahmood sent me the following offline. [ THX! ]</div><div>He also suggested that the .lt. and .gt. be changed to .le. and .ge.<br></div><div>============================================</div><div> a = (/0.1, 1, 2, 3, .5, -10, 30, 1, 2, 3/) ; type float<br> a@valid_range = (/-0.2, 5/) ; indices 0 and 1<br> a@_FillValue = -999.0 ; match type of variable 'a'<br> print(a)<br> print("-----")<br> a = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml"><b>where</b></a>( a<span style="color:rgb(0,0,255)"><b>.ge.</b></span>a@valid_range(<b>0</b>) <span style="color:rgb(0,0,255)"><b>.and.</b></span> a<span style="color:rgb(0,0,255)"><b>.le.</b></span>a@valid_range(<b>1</b>), a, a@_FillValue )<br> print(a)</div><div>============================================<br></div><div><br></div><div>Variable: a<br>Type: float<br>Total Size: 40 bytes<br> 10 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [10]<br>Coordinates: <br>Number Of Attributes: 2<br> _FillValue : -999<br> valid_range : <b>( -0.2, 5 )</b><br>(0) 0.1<br>(1) 1<br>(2) 2<br>(3) 3<br>(4) 0.5<br>(5) -10<br>(6) 30<br>(7) 1<br>(8) 2<br>(9) 3<br>(0) -----<br><br><br>Variable: a<br>Type: float<br>Total Size: 40 bytes<br> 10 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [10]<br>Coordinates: <br>Number Of Attributes: 2<br> _FillValue : -999<br> valid_range : ( -0.2, 5 )<br>(0) 0.1<br>(1) 1<br>(2) 2<br>(3) 3<br>(4) 0.5<br><b>(5) -999<br>(6) -999</b><br>(7) 1<br>(8) 2<br>(9) 3<br><br></div><div><br></div><div><div><br></div><div>ncl 0> a = (/0.1, 1, 2, 3, .5, -10, 30, 1, 2, 3/) <wbr> ; type <b>float</b><br>ncl 1> valid_range = (/-0.2, 5/)<br>ncl 2> a@_FillValue = -999.0 ; match type of variable 'a'<br>ncl 3> data = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml"><b>where</b></a>(a.gt.valid_range(0) <span style="color:rgb(0,0,255)"><b>.or.</b></span> a.lt.valid_range(1) , a , a@_FillValue) <wbr> <wbr> <br>ncl 4> print(data)<br><br><br>Variable: data<br>Type: float<br>Total Size: 40 bytes<br> 10 values<br>Number of Dimensions: 1<br>Dimensions and sizes: [10]<br>Coordinates: <br>Number Of Attributes: 1<br> _FillValue : -999<br>(0) 0.1<br>(1) 1<br>(2) 2<br>(3) 3<br>(4) 0.5<br>(5) -10<br>(6) 30<br>(7) 1<br>(8) 2<br>(9) 3<br>ncl 5> data = where(a.gt.valid_range(0) .and. a.lt.valid_range(1) , a , a@_FillValue) <br>ncl 6> print(data) <br></div><div><br></div><div>Variable: data<br>Type: float<br>Total Size: 40 bytes<br> 10 values<br>Number of Dimensions: 1 <wbr> <wbr> <wbr> <wbr> <br>Dimensions and sizes: [10] <wbr> <wbr> <wbr> <wbr> <br>Coordinates: <wbr> <wbr> <wbr> <wbr> <wbr> <br>Number Of Attributes: 1 <wbr> <wbr> <wbr> <wbr> <br> _FillValue : -999<br>(0) 0.1<br>(1) 1<br>(2) 2<br>(3) 3<br>(4) 0.5<br>(5) -999<br>(6) -999<br>(7) 1<br>(8) 2<br>(9) 3</div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 11, 2018 at 7:54 AM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>.and. ===> .or.</div><div><br></div><div>data = where(data_raw.gt.data_hdf4@va<wbr>lid_range(0) <span style="color:rgb(0,0,255)"><b>.or.</b></span> data_raw.lt.data_hdf4@valid_ra<wbr>nge(1) ,data_raw, data_hdf4@_FillValue)
<br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Tue, Sep 11, 2018 at 1:34 AM, Elham Ghasemifar <span dir="ltr"><<a href="mailto:elham.ghasemifar@modares.ac.ir" target="_blank">elham.ghasemifar@modares.ac.<wbr>ir</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
<div dir="ltr">
<div id="m_-694845165727120854m_-7741226398152501045divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif" dir="ltr">
<p>dear colleges</p>
<p>anyone can help me how i can change valid range, i tried more but NCL got me error ,</p>
<p></p>
<div>
<p style="margin-bottom:0in;line-height:100%"><br>
</p>
<p style="margin-bottom:0in;line-height:100%"><br>
</p>
<p style="margin-bottom:0in;line-height:100%">; Process valid_range. Fill value and missing value will be handled by this
</p>
<p style="margin-bottom:0in;line-height:100%">; since they are outside of range values.
</p>
<p style="margin-bottom:0in;line-height:100%">data = where(data_raw.gt.data_hdf4@va<wbr>lid_range(0) .and. data_raw.lt.data_hdf4@valid_ra<wbr>nge(1) ,data_raw, data_hdf4@_FillValue)
</p>
<p style="margin-bottom:0in;line-height:100%"><br>
</p>
</div>
<br>
<p></p>
</div>
</div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>