Re: Fwd: Voronoi domain-edge messyness

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Oct 07 2011 - 15:20:38 MDT

Hi Jakob,
I am looking into this.
 -dave

On Oct 6, 2011, at 10:35 AM, Dennis Shea wrote:

> A reposted message:
>
> -------- Original Message --------
> Subject: Voronoi domain-edge messyness
> Date: Thu, 06 Oct 2011 18:03:15 +0200
> From: Jakob Tendel <tendel@muk.uni-hannover.de>
>
> Hello,
>
> I am using NCL function "csvoro" to construct a set of Voronoi cells
> around radiosonde stations in the eastern US. However, the cell
> boundaries at the edge of my point cloud spread outwards in an
> unpredictable fashion and some even cross back through the area of
> interest. Is there a way to control the edge behavior short of saving
> the polygon coords and manually editing them? (e.g. "close the cell at a
> certain distance from the station"). My ncl script follows at the end.
> This problem seems similar to this one I found in the archives:
>
> http://www.ncl.ucar.edu/Support/talk_archives/2010/2587.html
>
> Thanks for any help,
>
> Jakob
>
>
>
> Institut für Meteorologie und Klimatologie
> Leibniz Universität Hannover
>
> **
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> ;********************************************************************************************
> begin
>
> lats=(/43.93,43.86,46.38,47.52,50.21,48.56,51.26,51.45,30.50,32.90,\
> 30.45,33.36,33.16,30.33,32.31,30.11,32.46,34.78,36.08,37.20,\
> 36.25,34.83,37.93,38.98,39.41,37.23,39.07,40.86,42.70,40.53,\
> 42.93,41.31,42.70,44.91,44.48,44.85,45.45,46.86,48.56,43.90,\
> 41.61,41.66,40.15/)
>
> lons=(/-60.01,-66.10,-75.96,-52.78,-66.25,-58.56,-80.65,-90.20,-81.70,-80.03,\
> -84.30,-84.56,-86.76,-89.77,-90.08,-93.21,-93.78,-76.88,-79.95,-80.41,\
> -86.57,-92.27,-75.48,-77.46,-83.81,-93.38,-95.62,-72.86,-73.83,-80.23,\
> -78.73,-96.36,-83.46,-84.71,-88.13,-93.56,-98.43,-68.01,-93.38,-70.25,\
> -90.58,-69.96,-89.33/)
>
> n_raso = dimsizes(lats)
> ;********************************************************************************************
> rla = new(2*n_raso,float)
> rlo = new(2*n_raso,float)
> alen = new(2*n_raso,float)
> nca = new(1,integer)
> nv = new(1,integer)
> n = new(n_raso,integer)
> ;********************************************************************************************
> wks = gsn_open_wks("X11","blank")
> raso_loc = new((/1/),graphic)
> vtx = new((/n_raso/),graphic)
>
> res = True
> res@gsnMaximize = True
> res@gsnDraw = False
> res@gsnFrame = False
>
> res@mpLimitMode = "Corners"
> res@mpLeftCornerLatF = 10.
> res@mpLeftCornerLonF = 250.
> res@mpRightCornerLatF = 70.
> res@mpRightCornerLonF = 350.
> res@mpCenterLonF = 310.
> res@mpCenterLatF = 30.
>
> rasores = True
> rasores@gsMarkerIndex = 16
>
> vrs = True
> vrs@gsMarkerIndex = 13
> ;********************************************************************************************
> map = gsn_csm_map_ce(wks,res)
> raso_loc = gsn_add_polymarker(wks,map,lons,lats,rasores)
>
> do i=0,n_raso-1
> csvoro(lats,lons,i,1,rla,rlo,alen,nca,nv,n)
> vtx(i) = gsn_add_polyline(wks,map,rlo(n(:nv-1)),rla(n(:nv-1)),vrs)
> end do
>
> draw(map)
> frame(wks)
> end
> _______________________________________________
> 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
Received on Fri Oct 7 15:20:45 2011

This archive was generated by hypermail 2.1.8 : Sun Oct 09 2011 - 13:05:26 MDT