[ncl-talk] Mapping Radar (and that pesky "where" statement).
Alan Brammer
abrammer at albany.edu
Fri Sep 8 08:23:29 MDT 2017
You’ve got a typo in your variable name:
Dbz = where(dbz.lt.0, dbz+256,dbz)
Dbz != dbz
Also you’re trying to do all those conversions on an array of bytes which isn’t going to go well.
You want to convert to float before you start doing anything with it.
I don’t really understand the order in which this data was packed so 2 options:
dbz = byte2flt( f->Reflectivity(0,:,:) )
printMinMax(dbz,False)
dbz = where(dbz.lt.0, dbz+256,dbz)
dbz = (dbz * 0.5)-33 ; scale the data again?
printMinMax(dbz,False)
; Reflectivity: min=-32.75 max=94.75
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.
This way looks more correct when plotted .
dbz = byte2flt( (/ f->Reflectivity(0,:,:) /) ) ;; strip data and don’t apply offset / scale yet.
printMinMax(dbz,False)
dbz = where(dbz.lt.0, dbz+256,dbz)
dbz = (dbz * 0.5)-33 ;; now scale the data
print("after where")
printMinMax(dbz,False)
; min=-2.5 max=60.5
Good luck,
Alan
##############################
Alan Brammer,
Post-Doc Researcher
Department of Atmospheric and Environmental Sciences,
University at Albany, State University of New York, Albany, NY, 12222
abrammer at albany.edu
##############################
> On 8 Sep 2017, at 05:59, Barry Lynn <barry.h.lynn at gmail.com> wrote:
>
> Hi:
>
> I would like to make a radar plot using the original coordinates in the enclosed nc file, after converting to cartesian coordinates.
>
> The original dimensions of dbz were time_range; the ones in the file are different. Still, after using the new dimensions, I get
> something that looks reasonable.
>
> 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.
>
> 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.
>
> 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.
>
> 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.
> KOKX_V06_20130209_000138.nc <https://drive.google.com/file/d/0B3E3GjUeKpBdUnlTdUdOX21HNEk/view?usp=drive_web>
>
> --
> Barry H. Lynn, Ph.D
> Senior Lecturer,
> The Institute of the Earth Science,
> The Hebrew University of Jerusalem,
> Givat Ram, Jerusalem 91904, Israel
> Tel: 972 547 231 170
> Fax: (972)-25662581
>
> C.E.O, Weather It Is, LTD
> Weather and Climate Focus
> http://weather-it-is.com <http://weather-it-is.com/>
> Jerusalem, Israel
> Local: 02 930 9525
> Cell: 054 7 231 170
> Int-IS: x972 2 930 9525
> US 914 432 3108
> <radar_2.ncl>_______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170908/721a3ceb/attachment.html>
More information about the ncl-talk
mailing list