<div dir="ltr"><div>Examining satellite swath data was the original reason for developing the <b> <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml" target="_blank">stat_dispersion</a> </b>function.</div><div><br></div><div>Note: The documentation says to explicitly:  <b>load /.../contributed.ncl</b> That is out-of-date.</div><div>The contributed library is automatically loaded so the explicit load is NOT necessary.</div><div>---------------<br></div><div>The golden rule of data processing is <span style="color:rgb(0,0,255)"><b>'know your data'</b></span>  !!<br></div><div><br></div><div>Examining only the min/max of noisy data can be rather limiting. Try:</div><div><pre>  ws_opt_sd = True               ; options for <b>s</b>tat_<b>d</b>ispersion
  ws_opt_sd@PrintStat = True
  ws_stat = <a href="http://www.ncl.ucar.edu/Document/Functions/Contributed/stat_dispersion.shtml" target="_blank"><b>stat_dispersion</b></a>(ws, ws_opt_sd )  <br>-------<br><br></pre><pre><font face="arial,sans-serif">See also <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/nice_mnmxintvl.shtml" target="_blank"><b>nice_mnmxintvl</b></a>. You may wish to use this and the output from <b>stat_dispersion</b>  to help set contour levels. EG:<br>If you decide to use (say) the lower and upper sextiles<br><br> ws_low  =  ws_stat(5)         ; Low Sextile   ; whatever statistic you want<br> ws_high = ws_stat(11)       ; High Sextile   ;       "             "         "      "<br> ws_MaxPlotLevel = 16      ; whatever you choose  8 to 16 is common<br> ws_mnmxint = <b>nice_mnmxintvl</b>( ws_low, ws_high,ws_MaxPlotLevel  , False)  ; last argument could be True also<br><br>  ws_res = True
  . . .
  ws_res@<a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnLevelSelectionMode" target="_blank"><i>cnLevelSelectionMode</i></a> = "ManualLevels"
  ws_res@<a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMinLevelValF" target="_blank"><i>cnMinLevelValF</i></a>       = ws_low
  ws_res@<a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnMaxLevelValF" target="_blank"><i>cnMaxLevelValF</i></a>      = ws_high
  ws_res@<a href="http://www.ncl.ucar.edu/Document/Graphics/Resources/cn.shtml#cnLevelSpacingF" target="_blank"><i>cnLevelSpacingF</i></a>     = ws_mnmxint(2)       ; use suggested contour interval <br>                                                                                    ; could be changed as you see as appropriate<br>---<br></font></pre><pre><font face="arial,sans-serif">To be clear, you could use <b>any returned statistic </b>for low and high<br><br>ws_low  =  ws_stat(3)    ; Low Decile<br>ws_high = ws_stat(12)  ; High Octile<br>==<br>ws_low  =  ws_stat(2)    ; Min value<br>ws_high = ws_stat(7)    ; High Tri<br>==<br>ws_low  =  ws_stat(24)    ; lower 5%<br>ws_high = ws_stat(26)    ; Upper 1%<br>==<br><br></font></pre><pre><font face="arial,sans-serif">If you want to eliminate 'extreme' values, then<br></font></pre><pre><font face="arial,sans-serif">     ws = <a href="http://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml"><b>where</b></a>(ws.lt.ws_low .or.  ws.gt.ws_high , ws@_FillValue, ws)<br>     <br></font></pre><pre><font face="arial,sans-serif"><b>Again, as a scientist/researcher [... <span style="color:rgb(0,0,255)">ALWAYS</span>...] examine your data.</b><br><br></font></pre><pre><font face="arial,sans-serif">Good Luck<br></font></pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 12, 2020 at 6:00 AM Sakib Ahmed <<a href="mailto:nonicknameforever@gmail.com" target="_blank">nonicknameforever@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you, Dennis, for the suggestion!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 11, 2020 at 9:25 PM Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Oops:</div><div>     print(WS)   ; all 287 values</div><div>should be</div><div>     print(ws(:,nl,ml))         <br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 11, 2020 at 1:52 PM Dennis Shea <<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Looks correct to me.</div><div><br></div><div>Keep in mind that satellite swath data can be quite noisy. <br></div><div><br></div><div>You can do a simple test at one lat/lon location.</div><div><br></div><div>  nl  = 600                       ; arbitrary ... your choice<br></div><div>  ml = 700                       ;     "                    "<br></div><div>  <br></div><div>  ws_min  = <b>min</b>(ws(:,nl,ml))</div><div>  ws_max = <b>max</b>(ws(:,nl,ml)</div><div><br></div><div>  print(WS)   ; all 287 values</div><div>  print("====")                         ; visual separator <br></div><div>  print("ws_min  ="+ws_min )</div><div>  print("ws_max ="+ws_max )</div><div>  print("swath="+swath(nl,ml))   ; should match 'ws_max'</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 11, 2020 at 1:16 PM Sakib Ahmed via ncl-talk <<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear NCL Community,<div><br></div><div>I'm trying to calculate the maximum wind swath(maximum wind speed at each grid point for all the time steps) from a model output but after plotting, it doesn't look correct. It would be helpful if anyone can point me if there's anything wrong with the code that I'm using. </div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div>begin</div><div><br></div><div>f    = addfile("<a href="http://florence_wind.nc" target="_blank">florence_wind.nc</a>" ,"r" )   ; reading file </div><div>ws = f->ws                                          ; reading variable     </div><div>printVarSummary(ws)<br></div><div><br></div><div>Variable: ws<br>Type: float<br>Total Size: 1658634992 bytes<br>            414658748 values<br>Number of Dimensions: 3<br>Dimensions and sizes:   [287] x [1202] x [1202]<br>Coordinates:<br></div><div>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;calculate swath;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;</div><div><br></div><div>swath = dim_max_n(ws,0)   ; swath<span style="color:rgb(0,0,0);font-family:courier;font-size:13.3333px">(nlat,nlon)</span></div><div><br></div><div>printVarSummary(swath)</div><div><br></div><div>Variable: swath<br>Type: float<br>Total Size: 5779216 bytes<br>            1444804 values<br>Number of Dimensions: 2<br>Dimensions and sizes:   [1202] x [1202]<br>Coordinates:<br></div><div><br></div><div>end </div><div><br></div><div><div>Thank you in advance for the help. </div><div>Sakib</div><font color="#888888"><div><br></div><div><div><font face="arial, sans-serif" color="#000000">Sakib Ahmed</font></div><div><font face="arial, sans-serif" color="#000000">Connecticut College</font></div><div><font face="arial, sans-serif" color="#000000">Environmental Studies Major,</font></div><div><font face="arial, sans-serif" color="#000000">New London, CT 06320</font></div><div><br></div></div></font></div><div><br></div></div>
_______________________________________________<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/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>