<div dir="ltr"><div class="gmail_default"><font face="arial, helvetica, sans-serif">Geeta,</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">As I mentioned in an earlier email, the &#39;-88.88&#39; value may not be exact.  If you look at your output, you had values like this:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">-99.98999999999999</span><br></font></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">The -88.88 values may be the same situation, i.e., they may be:</font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0)">-88.8777777777777</span><span style="color:rgb(0,0,0)"><br></span></font></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif">or similar. </font></span></div><div class="gmail_default"><span style="color:rgb(0,0,0)"><font face="arial, helvetica, sans-serif"><br></font></span></div><div class="gmail_default"><font face="arial, helvetica, sans-serif">To catch this possible roundoff error, Use &quot;-88.8&quot; instead of &quot;-88.88&quot;, and use &quot;.lt&quot; instead of &quot;.eq&quot;:</font></div><div class="gmail_default"><font face="arial, helvetica, sans-serif"><br></font></div><div class="gmail_default">







<p class=""><font face="arial, helvetica, sans-serif">    RF_fnl          =  <span class="">where</span>(RF_with_missing<span class="">.lt.</span>-<span class="">88.8</span>,-RF_with_missing@_FillValue,RF_with_missing)</font></p></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"><br></span></div><div class="gmail_default" style="">--Mary</div><div class="gmail_default" style=""><br></div><div class="gmail_default" style="font-size:small"><div><br></div><div><br></div><span class="im" style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"></span></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 3, 2016 at 11:07 AM, Geeta Geeta <span dir="ltr">&lt;<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px;background-color:rgb(255,255,255)"><div><span>Hi Mary. </span></div><div><span>There was some problem with the earlier script that I sent you. Pl s look at this one. </span></div><div dir="ltr"><span>this is the output. </span></div><div dir="ltr">0)<span style="white-space:pre-wrap">        </span>9247</div><div dir="ltr">(1)<span style="white-space:pre-wrap">        </span>49</div><div dir="ltr"><br></div><div dir="ltr">Variable: RF_flt</div><div dir="ltr">Type: float</div><div dir="ltr">Total Size: 144992960 bytes</div><span class=""><div dir="ltr">            36248240 values</div><div dir="ltr">Number of Dimensions: 3</div><div dir="ltr">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[9247] x [49] x [80]</div><div dir="ltr">Coordinates: </div></span><div dir="ltr">Number Of Attributes: 1</div><div dir="ltr">  _FillValue :<span style="white-space:pre-wrap">        </span>-9999</div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span> </div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span>min=-8888   max=9783</div><div dir="ltr"><br></div><div dir="ltr">Variable: RF_with_missing</div><span class=""><div dir="ltr">Type: double</div><div dir="ltr">Total Size: 289985920 bytes</div><div dir="ltr">            36248240 values</div><div dir="ltr">Number of Dimensions: 3</div><div dir="ltr">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[9247] x [49] x [80]</div><div dir="ltr">Coordinates: </div></span><div dir="ltr">Number Of Attributes: 1</div><div dir="ltr">  _FillValue :<span style="white-space:pre-wrap">        </span>-9999</div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span> </div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span>min=-88.88   max=97.83</div><span class=""><div dir="ltr"><br></div><div dir="ltr">Variable: RF_fnl</div><div dir="ltr">Type: double</div><div dir="ltr">Total Size: 289985920 bytes</div><div dir="ltr">            36248240 values</div><div dir="ltr">Number of Dimensions: 3</div><div dir="ltr">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[9247] x [49] x [80]</div><div dir="ltr">Coordinates: </div></span><div dir="ltr">Number Of Attributes: 1</div><div dir="ltr">  _FillValue :<span style="white-space:pre-wrap">        </span>-9999</div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span> </div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span>min=-88.88   max=97.83</div><div dir="ltr"></div><div dir="ltr">aditya@agniilap:~/geeta/ncl/ReadHDF-2A25$ </div><div dir="ltr"><br></div><div dir="ltr">RF_with_missing has min value of -88.88,  After where statement, the -88.88 is not replaced by -9999. </div><div dir="ltr"><br></div><div dir="ltr">thank you for your help</div><span class=""><font color="#888888"><div></div><div> </div><div>Geeta.</div></font></span><div><div class="h5"> <div><br><br></div><div style="display:block"> <div style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"> <div dir="ltr"><font size="2" face="Arial"> On Friday, 3 June 2016 9:50 PM, Geeta Geeta &lt;<a href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>&gt; wrote:<br></font></div>  <br><br> <div><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px;background-color:rgb(255,255,255)"><div><span>Thanks Mary. </span></div><div><span>I am sending my code and pls tell me where to upload the data?. </span></div><div><span>This is output now. I made changes as you told. </span></div><div>(0)<span style="white-space:pre-wrap">        </span>min=-9999   max=9783</div><div><br clear="none"></div><div>Variable: RF_fnl</div><div>Type: double</div><div>Total Size: 289985920 bytes</div><div>            36248240 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[9247] x [49] x [80]</div><div>Coordinates: </div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=97.83</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=1.85</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=1.48</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=1.58</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=1.73</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=1.99</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=2.6</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=1.7</div><div><br clear="none"></div><div>Variable: RF_fnl</div><div>Type: double</div><div>Total Size: 289985920 bytes</div><div>            36248240 values</div><div>Number of Dimensions: 3</div><div>Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[9247] x [49] x [80]</div><div>Coordinates: </div><div>Number Of Attributes: 2</div><div>  lat2d :<span style="white-space:pre-wrap">        </span>&lt;ARRAY of 453103 elements&gt;</div><div>  lon2d :<span style="white-space:pre-wrap">        </span>&lt;ARRAY of 453103 elements&gt;</div><div>(0)<span style="white-space:pre-wrap">        </span> </div><div>(0)<span style="white-space:pre-wrap">        </span>min=-99.98999999999999   max=97.83</div><div></div><div>aditya@agniilap:~/geeta/ncl/ReadHDF-2A25$ </div><div dir="ltr"><br clear="none"></div><div></div><div> </div><div>Geeta.</div> <div><br clear="none"><br clear="none"></div><div><div style="display:block"> <div style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"> <div dir="ltr"><font size="2" face="Arial"> On Friday, 3 June 2016 8:22 PM, Mary Haley &lt;<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div><div><div><div dir="ltr"><div style="font-size:small">Geeta,</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">Are the -999900 and -888800 values correct? They seem a bit odd.  Perhaps you are supposed to divide the data by the scale_factor rather than multiple by it.  I think the &quot;short2flt&quot; function does a multiply.</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">Try this (UNTESTED):</div><div style="font-size:small"><br clear="none"></div><div>







<div>   RF_short  =  hdf4_file-&gt;rain<br clear="none">   printVarSummary(RF_short)<br clear="none">   printMinMax(RF_short,0)</div><div>   Rf_fnl  = tofloat(RF_short) / RF_short@scale_factor<br clear="none">   copyVarMeta(RF_short,Rf_fnl)<br clear="none"><br clear="none">   printVarSummary(Rf_fnl)<br clear="none">   printMinMax(Rf_fnl,0)</div><div>   Rf_fnl  =  where(Rf_fnl.eq.-88.88,Rf_fnl@_FillValue,Rf_fnl)<br clear="none">   printMinMax(Rf_fnl,0)</div><div>   Rf_fnl@lon2d      =  longitude<br clear="none">   Rf_fnl@lat2d      =  latitude</div><div>I added several &quot;printVarSummary&quot; and &quot;prinMinMax&quot; calls to make sure that the conversions are working at every step.<br clear="none"></div><div>If this continues to fail, it would help if I could have access to your latest script and data.</div><div>--Mary</div></div></div><div><div><br clear="none"><div>On Fri, Jun 3, 2016 at 2:04 AM, Geeta Geeta <span dir="ltr">&lt;<a rel="nofollow" shape="rect" href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>&gt;</span> wrote:<br clear="none"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px;background-color:rgb(255,255,255)"><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px;background-color:rgb(255,255,255)"><div dir="ltr"><span>thanks Mary for your suggestions.. </span></div><div dir="ltr"><span>I was able to get the plot but I am getting a band like structure in the plot that is middle part is white. Dont know why???</span></div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><span>can u pls suggest. </span></div><span><font color="#888888"></font></span><div></div><div> </div><div>Geeta.</div> <div><br clear="none"><br clear="none"></div><div></div></div></div></div><div><div><div> <div style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"> <div style="font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px"> <div dir="ltr"><font size="2" face="Arial"> On Friday, 3 June 2016 3:29 AM, Mary Haley &lt;<a rel="nofollow" shape="rect" href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>&gt; wrote:<br clear="none"></font></div>  <br clear="none"><br clear="none"> <div><div><div><div dir="ltr"><div style="font-size:small"><br clear="none"></div><div style="font-size:small">Geeta,</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">You will need to approach this with two steps.</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">First, since this data is of type &quot;short&quot; and has scale_factor and add_offset attributes, you should read the data using &quot;short2flt&quot;, which will apply these attributes for you. Afterwards, use &quot;printVarSummary&quot; and &quot;printMinMax&quot; to make sure the data looks okay.</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">Second, whenever your data has multiple missing value values, you can use the &quot;where&quot; function</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">First, use &quot;-9999&quot; as your standard missing value:</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">rf@_FillValue = -9999</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">Now that &quot;-9999&quot; is a recognized missing value, you can then coerce the -88.88 value to missing as well:</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">  rf = where(rf.eq.-88.88,rf@_FillValue,rf)</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small">Note: it&#39;s not generally a good idea to do a straight comparison of float data with &quot;if(x.eq.12.34)&quot; type of comparisons. If you know that all your data is positive, for example, except for the potential -88.88 value, then a better way to do this is:</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small"><div>  rf = where(rf.lt.0,rf@_FillValue,rf)</div><div><br clear="none"></div></div><div style="font-size:small">Or, if you feel more comfortable about comparing values that are closer to -88.88. then use a roundoff of -88:</div><div style="font-size:small"><br clear="none"></div><div style="font-size:small"><div>  rf = where(rf.lt.-88,rf@_FillValue,rf)</div><div><br clear="none"></div><div>This will then catch anything less than -88 and set it to missing.</div><div><br clear="none"></div></div><div><a rel="nofollow" shape="rect" href="http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml</a><br clear="none"></div><div><a rel="nofollow" shape="rect" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml" target="_blank">http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml</a><br clear="none"></div><div><br clear="none"></div><div>--Mary</div><div><br clear="none"></div></div><div><br clear="none"><div>On Thu, Jun 2, 2016 at 12:37 PM, Geeta Geeta <span dir="ltr">&lt;<a rel="nofollow" shape="rect" href="mailto:geetag54@yahoo.com" target="_blank">geetag54@yahoo.com</a>&gt;</span> wrote:<br clear="none"><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue,&#39;Helvetica Neue&#39;,Helvetica,Arial,&#39;Lucida Grande&#39;,sans-serif;font-size:16px;background-color:rgb(255,255,255)"><div>I am using TRMM data that has rain rate in vertical up to 20 km from the Radar . </div><div dir="ltr">the variable &quot;rain&quot; has data type as short </div><div dir="ltr">Variable: RF</div><div dir="ltr">Type: short</div><div dir="ltr">Total Size: 72496480 bytes</div><div dir="ltr">            36248240 values</div><div dir="ltr">Number of Dimensions: 3</div><div dir="ltr">Dimensions and sizes:<span style="white-space:pre-wrap">        </span>[nscan | 9247] x [nray | 49] x [ncell1 | 80]</div><div dir="ltr">Coordinates: </div><div dir="ltr">Number Of Attributes: 9</div><div dir="ltr">  lat2d :<span style="white-space:pre-wrap">        </span>&lt;ARRAY of 453103 elements&gt;</div><div dir="ltr">  lon2d :<span style="white-space:pre-wrap">        </span>&lt;ARRAY of 453103 elements&gt;</div><div dir="ltr">  scale_factor :<span style="white-space:pre-wrap">        </span> 100</div><div dir="ltr">  scale_factor_err :<span style="white-space:pre-wrap">        </span>   0</div><div dir="ltr">  add_offset :<span style="white-space:pre-wrap">        </span>   0</div><div dir="ltr">  add_offset_err :<span style="white-space:pre-wrap">        </span>   0</div><div dir="ltr">  calibrated_nt :<span style="white-space:pre-wrap">        </span>22</div><div dir="ltr">  units :<span style="white-space:pre-wrap">        </span>mm/hr</div><div dir="ltr">  hdf_name :<span style="white-space:pre-wrap">        </span>rain</div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span> </div><div dir="ltr">(0)<span style="white-space:pre-wrap">        </span>min=-9999   max=9783</div><div dir="ltr"><br clear="none"></div><div dir="ltr">It has two types of missing values -88.88 (referrred to as the ground clutter) and -9999 as the missing value. </div><div dir="ltr">I have to plot this data . ho w should i put two values as miising?</div><div dir="ltr">I am getting a plot like this. </div><span><font color="#888888"></font></span><div></div><div> </div><div>Geeta.</div></div></div></div><br clear="none">_______________________________________________<br clear="none">
ncl-talk mailing list<br clear="none">
<a rel="nofollow" shape="rect" href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></div></div></div></blockquote></div><br clear="none"></div></div></div></div><br clear="none"><br clear="none"></div>  </div> </div>  </div></div></div></div></div><br><br></div>  </div> </div>  </div></div></div></div></div></blockquote></div><br></div></div>