comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: GRIDDATA woes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: GRIDDATA woes [message #59056 is a reply to message #59053] Mon, 03 March 2008 11:00 Go to previous messageGo to previous message
wgallery is currently offline  wgallery
Messages: 32
Registered: December 1998
Member
On Mar 2, 9:57 pm, "ben.bighair" <ben.bigh...@gmail.com> wrote:
> Hi All,
>
> I have been having a problem similar to this one...http://tinyurl.com/2spe3v
>
> The solution to the problem in the above posting was to use GRID_INPUT
> to filter and reorder the data *before* calling QHULL and GRIDDATA.
> That doesn't seem to be the case this time as I faithfully perform
> these steps. However, the error message indicates that it is
> something similar is going on.
>
> The big picture is that I have an irregular grid (actually it is
> regular in longitude but irregular in latitude) that I want to
> interpolate onto a regular grid. I have assembled a mockup of the
> situation in this procedure...http://www.tidewater.net/~pemaquid/counterclockw ise_fail.pro
>
> The error message when the above is run is ...
>
> SeaDAS> z=counterclockwise_fail()
> % GRIDDATA: Triangle 5 not in counterclockwise order.
> % GRIDDATA: Triangle 6 not in counterclockwise order.
> % GRIDDATA: Triangle 7 not in counterclockwise order.
> % GRIDDATA: Triangle 17 not in counterclockwise order.
> % GRIDDATA: Triangle 30 not in counterclockwise order.
> % GRIDDATA: Triangle 31 not in counterclockwise order.
> % GRIDDATA: Triangle 34 not in counterclockwise order.
> % GRIDDATA: Triangle 40 not in counterclockwise order.
> % GRIDDATA: Triangle 42 not in counterclockwise order.
> % GRIDDATA: Triangle 49 not in counterclockwise order.
>
> I have tried changing the values in the code to double. That results
> in a similar set of errors but for a different set of triangles.
>
> % GRIDDATA: Triangle 4 not in counterclockwise order.
> % GRIDDATA: Triangle 5 not in counterclockwise order.
> % GRIDDATA: Triangle 6 not in counterclockwise order.
> % GRIDDATA: Triangle 16 not in counterclockwise order.
> % GRIDDATA: Triangle 33 not in counterclockwise order.
> % GRIDDATA: Triangle 35 not in counterclockwise order.
> % GRIDDATA: Triangle 36 not in counterclockwise order.
> % GRIDDATA: Triangle 39 not in counterclockwise order.
> % GRIDDATA: Triangle 42 not in counterclockwise order.
> % GRIDDATA: Triangle 45 not in counterclockwise order.
>
> Bah!
>
> I have seen a number of messages on the newsgroup about interpolation
> from an irregular grid to a regular one. None appear to address the
> issues around gridding on a sphere. I don't think I can use anything
> as simple as INTERPOLATE since the input array is sampled at irregular
> intervals.
>
> So how is this kind of interpolation supposed to be done?
>
> Thanks!
> Ben
>
> ** Structure !VERSION, 8 tags, length=76, data length=76:
> ARCH STRING 'ppc'
> OS STRING 'darwin'
> OS_FAMILY STRING 'unix'
> OS_NAME STRING 'Mac OS X'
> RELEASE STRING '6.3'
> BUILD_DATE STRING 'Mar 23 2006'
> MEMORY_BITS INT 32
> FILE_OFFSET_BITS
> INT 64

Ben,

1. There is an error in your routine to generate longitude.

;;lon = FINDGEN(nLon)/(nLon-1) * PS[0] + lonRange[0]
lon = fINDGEN(nLon) * PS[0] + lonRange[0]

Otherwise, lon has only two unique points

2. Try using the first form of grid_data: without /sphere:

;filter and reorder the data
;;GRID_INPUT, lon, lat, zValue, xyz, newZ, /SPHERE, /DEGREES, EPSILON
= PS[0]/2.0
GRID_INPUT, lon, lat, zValue, x1, y1, newZ, /DEGREES, EPSILON = PS[0]/
2.0

;build the triangulation
;;QHULL, xyz[0,*], xyz[1,*], tr, /DELAUNAY
QHULL, x1, y1, tr, /DELAUNAY

;interpolate
;;Z = GRIDDATA(xyz[0,*], xyz[1,*], newZ, /SPHERE,/DEGREES, $
Z = GRIDDATA(x1, y1, newZ, /SPHERE,/DEGREES, $
METHOD = "NaturalNeighbor", MISSING = !VALUES.F_NAN, $
XOUT = oLon, YOUT = oLat, TRIANGLES = tr )

You will no longer get the dreaded "Triangle 0 not in counterclockwise
order" error.

Cheers,

Bill Gallery
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Speeding up a call to the where function
Next Topic: GRIDDATA woes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 08:49:45 PDT 2025

Total time taken to generate the page: 1.44304 seconds