Re: possible bug in gsn_polygon

From: Michael Duda <duda_at_nyahnyahspammersnyahnyah>
Date: Thu Apr 30 2009 - 17:06:14 MDT

Hi, Mary,

It is definitely the case that I had intended to plot many of these
triangles, which constitute cells in a triangular mesh; in the example,
I had plotted just one to illustrate the issue.

I suppose the definition of "small" depends on who you ask. In the
application I'm working on, this triangle is relatively large, representing
an area measuring ~100 km on a side. With double precision, we should be able
to easily distinguish areas measuring tens of meters on the earth's surface
(although I definitely agree it wouldn't be terribly effective to plot the
entire surface of the earth at this resolution), so a failure for a 100-km
triangle does seem like an algorithmic problem rather than a numerical one.

Certainly, it's not my intention to be negative, here; I just wanted to point
out that the triangle I had plotted would be very reasonable in many
applications. Overall, I've had many great experiences with NCL!

Michael

On Thu, Apr 30, 2009 at 03:37:39PM -0600, Mary Haley wrote:
>
> Michael,
>
> One more thing: I think also the issue is that you are trying to draw
> a filled area that is *very* small relative to the area you are
> plotting on.
>
> If you zoom in on the map, for example, with:
>
> res@mpLimitMode = "LatLon"
> res@mpMinLatF = 50
> res@mpMaxLatF = 80
> res@mpMinLonF = -20
> res@mpMaxLonF = 20
>
> then your original values for cx and cy will work.
>
> I imagine, however, that you want to plot several of these little
> triangles, correct? If so, you will probably have to decrease the
> resolution of cx/cy.
>
> I'll still run this by the developers.
>
> --Mary
>
>
> On Thu, 30 Apr 2009, Michael Duda wrote:
>
> >Hi, Folks,
> >
> >I'm using NCL 5.1.0 on NCAR's bluefire (although the problem appears on
> >other
> >machines, too), and I'm running into a error when using gsn_polygon(...)
> >to add
> >a polygon to a map. The error message I see is:
> >
> >Copyright (C) 1995-2009 - All Rights Reserved
> >University Corporation for Atmospheric Research
> >NCAR Command Language Version 5.1.0
> >The use of this software is governed by a License Agreement.
> >See http://www.ncl.ucar.edu/ for more details.
> >fatal:MapDataPolygon: ARPRAM - ALGORITHM FAILURE
> >
> >However, if I just changing the center lat or lon of the map (mpCenterLatF
> >or
> >mpCenterLonF) by even one degree, the problem disappears and the polygon
> >appears
> >on the plot as expected. Appended below is the script I'm using. Could
> >anyone,
> >especially an NCL developer, comment on whether this is a bug? Any other
> >suggestions on a workaround would also be great.
> >
> >Best regards,
> >Michael
> >
> >--------------------------------------------------------
> >
> >
> >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> >load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> >
> >begin
> >
> > wks = gsn_open_wks("pdf","triangle")
> > gsn_define_colormap(wks,"gui_default")
> >
> > res = True
> > res@gsnMaximize = True
> >
> > res@mpProjection = "Satellite"
> > res@mpDataBaseVersion = "MediumRes"
> > res@mpCenterLatF = 45.0
> > res@mpCenterLonF = 0.0
> > res@gsnFrame = False
> >
> > map = gsn_csm_map(wks, res)
> >
> > lres = False
> >
> > cx = new((/4/), float)
> > cy = new((/4/), float)
> >
> > cx(0) = -2.356872735192781
> > cx(1) = -4.627934296211549
> > cx(2) = -2.270649143374328
> > cx(3) = -2.356872735192781
> >
> > cy(0) = 65.91331700014982
> > cy(1) = 65.43284608178955
> > cy(2) = 64.91495523013631
> > cy(3) = 65.91331700014982
> >
> > lres = True
> > lres@gsFillColor = 2
> > gsn_polygon(wks, map, cx, cy, lres)
> >
> > frame(wks)
> >end
> >
> >_______________________________________________
> >ncl-talk mailing list
> >List instructions, subscriber options, unsubscribe:
> >http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> >
Received on Thu Apr 30 17:09:25 2009

This archive was generated by hypermail 2.1.8 : Mon Oct 26 2009 - 15:01:33 MDT