Re: how to plot a radar picture

From: Stauffer - CDPHE, Phillip <phillip.stauffer_at_nyahnyahspammersnyahnyah>
Date: Wed Jul 03 2013 - 08:02:30 MDT

This is probably why they look different:

>> reflectivity:scale_factor = 0.5f ;
>> reflectivity:add_offset = -33s ;

On Tue, Jul 2, 2013 at 8:03 PM, hehui <hehui@bjmb.gov.cn> wrote:

> Dear Mary,
> Thanks for responding to my letter.
> In my last letter, I metioned that"The distribution of the output plot radar echo is same as the reality", or "the value of the output plot radar echo is significantly larger than the reality, even the value of some reality strong radar echo region is negative."
>
> The reality refers the radar echo that produced by a special radar software that also read this radar data file. I compare the radar echo produced by the radar software and by my ncl script, and found that the distribution of two radar echo is similar, but the radar intensity produced by my ncl script is siginificantly larger.
>
> I think the problem maybe lies in the type of the varible reflectivity. The type of the varible reflectivity is unsigned byte, and I just use the function byte2flt to transfer it to float type. I am not sure that what I did is correct.
>
> Thanks.
> Yours.
> Hui He
>
>
>
>
>
> Mary Haley 写:
>
> > Dear Hui,
> >
> > You don't need these four lines:
> >
> >> res@sfXCStartV = 115 ; Define where contour plot
> >> res@sfXCEndV = 118 ; should lie on the map plot.
> >> res@sfYCStartV = 38
> >> res@sfYCEndV = 42
> >
> > since you are subscripting the array with:
> >
> > plot=gsn_csm_contour_map_ce(wks,dbz({latitude|38:42},{longtitude|115:118}),res)
>
> >
> > I don't think this will fix your problem, however.
> >
> > I'm not sure what you mean by "The distribution of the output plot radar echo is same as the reality", or "the value of the output plot radar echo is significantly larger than the reality, even the value of some reality strong radar echo region is negative."
>
> >
> > Do you mean that the actual values being plotting look correct? If so, did you look at your data variable with;
>
> >
> > printVarSummary(dbz)
> > printMinMax(dbx,0)
> >
> > to make sure it looks okay?
> >
> > Do you know if these attributes have any significance?
> >
> >> reflectivity:valid_min = 0s ;
> >> reflectivity:valid_max = 255s ;
> >> reflectivity:no_data = 0s ;
> >> reflectivity:bad_data = 1s ;
> >> reflectivity:no_observation = 2s ;
> >> reflectivity:censored_data = 3s ;
> >
> >
> > That is, if the value "1s" is considered "bad data", does that mean you need to set all values that are equal to 1 to missing?
>
> >
> > For example:
> >
> > dbz = where(dbz.eq.dbx@bad_data,dbz_@FillValue,dbz)
> >
> > Also, what is the meaning of "censored_data"? Is this supposed to be set to missing as well?
>
> >
> > --Mary
> >
> >
> > On Jul 2, 2013, at 3:26 AM, hehui wrote:
> >
> >> Dear,
> >> I have a radar data file, whose format is netcdf. I want to plot a radar echo(unit:dbz) picture using NCL.
>
> >> The head file of this radar data file is as following:
> >> netcdf \1306250900 {
> >> dimensions:
> >> longtitude = 1019 ;
> >> latitude = 881 ;
> >> layer = 20 ;
> >> variables:
> >> float longtitude(longtitude) ;
> >> longtitude:units = "degrees_east" ;
> >> float latitude(latitude) ;
> >> latitude:units = "degrees_north" ;
> >> int layer(layer) ;
> >> layer:units = "meter" ;
> >> byte reflectivity(layer, latitude, longtitude) ;
> >> reflectivity:name = "Reflectivity" ;
> >> reflectivity:units = "dBZ" ;
> >> reflectivity:scale_factor = 0.5f ;
> >> reflectivity:add_offset = -33s ;
> >> reflectivity:data_type = "unsigned byte" ;
> >> reflectivity:formula = "dBZ=-33+0.5*N" ;
> >> reflectivity:valid_min = 0s ;
> >> reflectivity:valid_max = 255s ;
> >> reflectivity:no_data = 0s ;
> >> reflectivity:bad_data = 1s ;
> >> reflectivity:no_observation = 2s ;
> >> reflectivity:censored_data = 3s ;
> >> // global attributes:
> >> ...}
> >>
> >> The script file that I wrote to read this data file and plot the radar echo at 5th level is as following:
>
> >> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> >> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> >> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> >> begin
> >>
> >> dbz=new((/881,1019/),"float")
> >> in=addfile("1306250900.nc","r")
> >> dbz=byte2flt(in->reflectivity(4,:,:))
> >> lon=in->longtitude
> >> lat=in->latitude
> >>
> >> res=True
> >> res@gsnMaximize=True
> >> res@cnFillOn=True
> >> res@cnLinesOn=False
> >> res@sfXCStartV = 115 ; Define where contour plot
> >> res@sfXCEndV = 118 ; should lie on the map plot.
> >> res@sfYCStartV = 38
> >> res@sfYCEndV = 42
> >> res@mpDataSetName = "Earth..4"
> >> res@mpDataBaseVersion = "MediumRes" ; Medium resolution database
>
> >> res@mpOutlineOn = True ; Turn on map outlines
> >> res@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
> >> res@mpLimitMode = "LatLon" ; Limit the map view.
> >> res@mpMinLonF = 115
> >> res@mpMaxLonF = 118
> >> res@mpMinLatF = 38
> >> res@mpMaxLatF = 42
> >> res@tmXTOn=False
> >> res@tmYROn=False
> >> res@cnLevelSelectionMode="ExplicitLevels"
> >> res@cnLevels=ispan(-5,65,5)
> >> wks=gsn_open_wks("x11","radarecho")
> >> gsn_define_colormap(wks,"WhiteBlueGreenYellowRed")
> >> plot=gsn_csm_contour_map_ce(wks,dbz({latitude|38:42},{longtitude|115:118}),res)
>
> >> end
> >>
> >>
> >> The distribution of the output plot radar echo is same as the reality. However the value of the output plot radar echo is significantly larger than the reality, even the value of some reality strong radar echo region is negative.
>
> >> How can I solve this problem?
> >> Thank you!
> >>
> >> Yours,
> >>
> >> Hui He
> >>
> >>
> >>
> >>
> >>
> >>
> >> _______________________________________________
> >> ncl-talk mailing list
> >> List instructions, subscriber options, unsubscribe:
> >> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
> >
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

-- 
Phillip Stauffer
Research Physical Scientist
Colorado Dept. of Public Health & Environment
Air Pollution Control Division
Technical Services Program
APCD-TS-B1
4300 Cherry Creek Drive South
Denver, CO 80246-1530
303-692-6360 (Office)

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Wed Jul 3 08:02:46 2013

This archive was generated by hypermail 2.1.8 : Fri Jul 05 2013 - 13:06:49 MDT