<html><head></head><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif;font-size:16px"><div id="yui_3_16_0_ym19_1_1465017602197_5347" dir="ltr"><span id="yui_3_16_0_ym19_1_1465017602197_5450">thanks Mary it worked and now the data looks reasonable. </span></div><div></div><div id="yui_3_16_0_ym19_1_1465017602197_5578">Pls find the plots for the layer 57 and layer 61 (where the rainrate is MAX). </div><div id="yui_3_16_0_ym19_1_1465017602197_5579">I am unable to understand why the Red Colored band is coming..</div><div id="yui_3_16_0_ym19_1_1465017602197_5997"><br></div><div id="yui_3_16_0_ym19_1_1465017602197_5915"> </div><div id="yui_3_16_0_ym19_1_1465017602197_5914"><br></div><div class="signature" id="yui_3_16_0_ym19_1_1465017602197_5913">Geeta.</div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, Sans-Serif; font-size: 16px;"> <div dir="ltr"><font size="2" face="Arial"> On Saturday, 4 June 2016 12:37 AM, Mary Haley <haley@ucar.edu> wrote:<br></font></div> <br><br> <div class="y_msg_container"><div id="yiv9119119323"><div><div dir="ltr"><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif">Geeta,</font></div><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif"><br clear="none"></font></div><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif">As I mentioned in an earlier email, the '-88.88' value may not be exact. If you look at your output, you had values like this:</font></div><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif"><br clear="none"></font></div><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif"><span style="color:rgb(0,0,0);">-99.98999999999999</span><br clear="none"></font></div><div class="yiv9119119323gmail_default"><span style="color:rgb(0,0,0);"><font face="arial, helvetica, sans-serif"><br clear="none"></font></span></div><div class="yiv9119119323gmail_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="yiv9119119323gmail_default"><span style="color:rgb(0,0,0);"><font face="arial, helvetica, sans-serif"><br clear="none"></font></span></div><div class="yiv9119119323gmail_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 clear="none"></span></font></div><div class="yiv9119119323gmail_default"><span style="color:rgb(0,0,0);"><font face="arial, helvetica, sans-serif"><br clear="none"></font></span></div><div class="yiv9119119323gmail_default"><span style="color:rgb(0,0,0);"><font face="arial, helvetica, sans-serif">or similar. </font></span></div><div class="yiv9119119323gmail_default"><span style="color:rgb(0,0,0);"><font face="arial, helvetica, sans-serif"><br clear="none"></font></span></div><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif">To catch this possible roundoff error, Use "-88.8" instead of "-88.88", and use ".lt" instead of ".eq":</font></div><div class="yiv9119119323gmail_default"><font face="arial, helvetica, sans-serif"><br clear="none"></font></div><div class="yiv9119119323gmail_default">
<div class="yiv9119119323"><font face="arial, helvetica, sans-serif"> RF_fnl = <span class="yiv9119119323">where</span>(RF_with_missing<span class="yiv9119119323">.lt.</span>-<span class="yiv9119119323">88.8</span>,-RF_with_missing@_FillValue,RF_with_missing)</font></div></div><div class="yiv9119119323gmail_default" style="font-size:small;"><span style="color:rgb(0,0,0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"><br clear="none"></span></div><div class="yiv9119119323gmail_default" style="">--Mary</div><div class="yiv9119119323gmail_default" style=""><br clear="none"></div><div class="yiv9119119323gmail_default" style="font-size:small;"><div><br clear="none"></div><div><br clear="none"></div><span class="yiv9119119323im" style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"></span></div><div class="yiv9119119323yqt2252743374" id="yiv9119119323yqt05543"><div class="yiv9119119323gmail_extra"><br clear="none"><div class="yiv9119119323gmail_quote">On Fri, Jun 3, 2016 at 11:07 AM, Geeta Geeta <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com" target="_blank" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>></span> wrote:<br clear="none"><blockquote class="yiv9119119323gmail_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, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', 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 clear="none"></div><div dir="ltr">Variable: RF_flt</div><div dir="ltr">Type: float</div><div dir="ltr">Total Size: 144992960 bytes</div><span class="yiv9119119323"></span><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><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 clear="none"></div><div dir="ltr">Variable: RF_with_missing</div><span class="yiv9119119323"></span><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><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="yiv9119119323"></span><div dir="ltr"><br clear="none"></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><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 clear="none"></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 clear="none"></div><div dir="ltr">thank you for your help</div><span class="yiv9119119323"><font color="#888888"></font></span><div></div><div> </div><div>Geeta.</div><div><div class="yiv9119119323h5"> <div><br clear="none"><br clear="none"></div><div style="display:block;"> <div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"> <div dir="ltr"><font size="2" face="Arial"> On Friday, 3 June 2016 9:50 PM, Geeta Geeta <<a rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com" target="_blank" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>> wrote:<br clear="none"></font></div> <br clear="none"><br clear="none"> <div><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', 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><ARRAY of 453103 elements></div><div> lon2d :<span style="white-space:pre-wrap;">        </span><ARRAY of 453103 elements></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, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"> <div dir="ltr"><font size="2" face="Arial"> On Friday, 3 June 2016 8:22 PM, Mary Haley <<a rel="nofollow" shape="rect" ymailto="mailto:haley@ucar.edu" target="_blank" href="mailto:haley@ucar.edu">haley@ucar.edu</a>> 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 "short2flt" 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->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 "printVarSummary" and "prinMinMax" 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"><<a rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com" target="_blank" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>></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, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;background-color:rgb(255,255,255);"><div><div><div style="color:rgb(0,0,0);font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', 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, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"> <div style="font-family:HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;font-size:16px;"> <div dir="ltr"><font size="2" face="Arial"> On Friday, 3 June 2016 3:29 AM, Mary Haley <<a rel="nofollow" shape="rect" ymailto="mailto:haley@ucar.edu" target="_blank" href="mailto:haley@ucar.edu">haley@ucar.edu</a>> 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 "short" and has scale_factor and add_offset attributes, you should read the data using "short2flt", which will apply these attributes for you. Afterwards, use "printVarSummary" and "printMinMax" 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 "where" function</div><div style="font-size:small;"><br clear="none"></div><div style="font-size:small;">First, use "-9999" 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 "-9999" 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's not generally a good idea to do a straight comparison of float data with "if(x.eq.12.34)" 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" target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml">http://www.ncl.ucar.edu/Document/Functions/Contributed/short2flt.shtml</a><br clear="none"></div><div><a rel="nofollow" shape="rect" target="_blank" href="http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml">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"><<a rel="nofollow" shape="rect" ymailto="mailto:geetag54@yahoo.com" target="_blank" href="mailto:geetag54@yahoo.com">geetag54@yahoo.com</a>></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, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', 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 "rain" 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><ARRAY of 453103 elements></div><div dir="ltr"> lon2d :<span style="white-space:pre-wrap;">        </span><ARRAY of 453103 elements></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" ymailto="mailto:ncl-talk@ucar.edu" target="_blank" href="mailto:ncl-talk@ucar.edu">ncl-talk@ucar.edu</a><br clear="none">
List instructions, subscriber options, unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk">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 clear="none"><br clear="none"></div> </div> </div> </div></div></div></div></div></blockquote></div><br clear="none"></div></div></div></div></div><br><br></div> </div> </div> </div></div></body></html>