<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">You’ve got a typo in your variable name:</div><div class=""><br class=""></div><div class=""><font face="InputMono-Regular" class="">Dbz = where(dbz.lt.0, dbz+256,dbz)</font></div><div class=""><font face="InputMono-Regular" class=""><br class=""></font></div><div class=""><font face="InputMono-Regular" class="">Dbz != dbz </font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Also you’re trying to do all those conversions on an array of bytes which isn’t going to go well. </div><div class="">You want to convert to float before you start doing anything with it. </div><div class=""><br class=""></div><div class="">I don’t really understand the order in which this data was packed so 2 options:</div><div class=""><br class=""></div><div class=""><div class=""><font face="InputMono-Regular" class=""> dbz = byte2flt( f->Reflectivity(0,:,:) ) </font></div><div class=""><font face="InputMono-Regular" class=""> printMinMax(dbz,False)</font></div><div class=""><font face="InputMono-Regular" class=""> dbz = where(dbz.lt.0, dbz+256,dbz)</font></div><div class=""><font face="InputMono-Regular" class=""> dbz = (dbz * 0.5)-33<span class="Apple-tab-span" style="white-space:pre"> </span>; scale the data again?</font></div><div class=""><font face="InputMono-Regular" class=""> printMinMax(dbz,False)</font></div></div><div class=""><font face="InputMono-Regular" class=""> ; Reflectivity: min=-32.75 max=94.75</font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> This seems like it’s scaling and offsetting twice. So instead below, strip the metadata on read in so offset and scale isn’t applied. After the where statement, then apply the scale/offset. </div><div class=""> This way looks more correct when plotted . </div><div class=""><br class=""></div><div class=""><div class=""><font face="InputMono-Regular" class=""> dbz = byte2flt( (/ f->Reflectivity(0,:,:) /) ) ;; strip data and don’t apply offset / scale yet. </font></div><div class=""><font face="InputMono-Regular" class=""> printMinMax(dbz,False)</font></div><div class=""><font face="InputMono-Regular" class=""> dbz = where(dbz.lt.0, dbz+256,dbz)</font></div><div class=""><font face="InputMono-Regular" class=""> dbz = (dbz * 0.5)-33 <span class="Apple-tab-span" style="white-space:pre"> </span>;; now scale the data</font></div><div class=""><font face="InputMono-Regular" class=""> print("after where")</font></div><div class=""><font face="InputMono-Regular" class=""> printMinMax(dbz,False)</font></div></div><div class=""><font face="InputMono-Regular" class="">; min=-2.5 max=60.5</font></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Good luck, </div><div class=""><br class=""></div><div class="">Alan </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><br class=""><br class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><span class="Apple-style-span" style="border-collapse: separate; font-variant-ligatures: normal; font-variant-east-asian: normal; font-variant-position: normal; line-height: normal; border-spacing: 0px;"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">##############################<br class="">Alan Brammer,<div class="">Post-Doc Researcher</div><div class=""><br class=""></div><div class="">Department of Atmospheric and Environmental Sciences,<br class="">University at Albany, State University of New York, Albany, NY, 12222<div class=""><a href="mailto:abrammer@albany.edu" class="">abrammer@albany.edu</a><br class="">##############################</div></div></div></span></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On 8 Sep 2017, at 05:59, Barry Lynn <<a href="mailto:barry.h.lynn@gmail.com" class="">barry.h.lynn@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi:<div class=""><br class=""></div><div class="">I would like to make a radar plot using the original coordinates in the enclosed nc file, after converting to cartesian coordinates.</div><div class=""><br class=""></div><div class="">The original dimensions of dbz were time_range; the ones in the file are different. Still, after using the new dimensions, I get </div><div class="">something that looks reasonable.<br class=""></div><div class=""><br class=""></div><div class="">However, I was told that I need to convert values < 0 (by adding 256), and then multiply by 0.5 and subtract 33 to get actual radar values.</div><div class=""><br class=""></div><div class="">But, when I use the where statement on the byte values or even integer values I don't get any change in the output. That is, the min/max before and after the where statement stays the same.</div><div class=""><br class=""></div><div class="">To make matters even more confusing: the map that results has values from about 80 to 300, even though the min/max are listed as -127 to 128.</div><div class=""><br class=""></div><div class="">Thank you for your help -- it would be great to be able to plot radar from nc file obtained from the weather and climate tool kit.<div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:rgb(245,245,245);padding:5px;color:rgb(34,34,34);font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid rgb(221,221,221);line-height:1"><a href="https://drive.google.com/file/d/0B3E3GjUeKpBdUnlTdUdOX21HNEk/view?usp=drive_web" target="_blank" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0;border:none" class=""><img style="vertical-align: bottom; border: none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png" class=""> <span dir="ltr" style="color:rgb(17,85,204);text-decoration:none;vertical-align:bottom" class="">KOKX_V06_20130209_000138.nc</span></a><img src="x-msg://ssl.gstatic.com/ui/v1/icons/common/x_8px.png" style="opacity: 0.55; cursor: pointer; float: right; position: relative; top: -1px; display: none;" class=""></div><br clear="all" class=""><div class=""><br class=""></div>-- <br class=""><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class="">Barry H. Lynn, Ph.D<div class=""><div class="">Senior Lecturer,</div><div class=""><div class=""><span style="color:rgb(136,136,136)" class="">The Institute of the Earth Science, </span><br style="color:rgb(136,136,136)" class=""><span style="color:rgb(136,136,136)" class="">The Hebrew University of Jerusalem, </span><br style="color:rgb(136,136,136)" class=""><span style="color:rgb(136,136,136)" class="">Givat Ram, Jerusalem 91904, Israel </span><br style="color:rgb(136,136,136)" class=""></div><span style="color:rgb(136,136,136)" class="">Tel: 972 547 231 170</span><br style="color:rgb(136,136,136)" class=""><span style="color:rgb(136,136,136)" class="">Fax: (972)-25662581</span></div></div><div class=""><span style="color:rgb(136,136,136)" class=""><br class=""></span></div><div class="">C.E.O, Weather It Is, LTD<br class="">Weather and Climate Focus<br class=""><a href="http://weather-it-is.com/" target="_blank" class="">http://weather-it-is.com</a><br class="">Jerusalem, Israel<br class="">Local: 02 930 9525<br class="">Cell: 054 7 231 170<br class="">Int-IS: x972 2 930 9525<br class="">US 914 432 3108<br class=""></div></div></div>
</div></div>
<span id="cid:1977993A-C984-4C33-A8E2-8DE5E14D5FB9@eas.albany.edu"><radar_2.ncl></span>_______________________________________________<br class="">ncl-talk mailing list<br class=""><a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">List instructions, subscriber options, unsubscribe:<br class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk<br class=""></div></blockquote></div><br class=""></body></html>