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

Home » Public Forums » archive » Another triangulate/griddata question
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Another triangulate/griddata question [message #75380] Wed, 02 March 2011 11:56
BLesht is currently offline  BLesht
Messages: 89
Registered: March 2007
Member
I have a problem that I thought would be easy to solve using griddata
as David Fanning did in his tip (http://www.idlcoyote.com/code_tips/
usegriddata.html). As input I have some 2D data arrays (can be either
512x512 or 1024x1024) with a longitude and latitude value associated
with each element. I want to output data arrays that represent sub-
regions of the input arrays in a particular map projection. Being sub-
regions, the output arrays are smaller than the input arrays. I know
the dimensions of the output arrays (xSize,ySize) as well as their
geographic limits (limits) and geographic position
(xStartDeg,yStartDeg) of the lower left corner.

Following David's example, I do the following:

mapStruct = MAP_PROJ_INIT('CYLINDRICAL', LIMIT=limit)
xy = MAP_PROJ_FORWARD(lons, lats, MAP_STRUCTURE=mapStruct)
x = REFORM(xy[0,*], xIn, yIn) ; xIn, yIn
based on input array size
y = REFORM(xy[1,*], xIn, yIn)
;
; Get the x, y coordinates of the ouput array southwest corner
;
llxy = MAP_PROJ_FORWARD(xStartDeg, yStartDeg, MAP_STRUCTURE=mapStruct)
xStart=llxy[0]
yStart=llxy[1]
;
TRIANGULATE, x, y, triangles, TOLERANCE=1.0
griddedData = GRIDDATA(x,y,wtmp,/NEAREST_NEIGHBOR,
TRIANGLES=triangles, DIMENSION=[xSize,ySize], MISSING=nan,
START=[xStart,yStart])

This fails with the error: % GRIDDATA: Value of Triangle index is out
of allowed range.

I'm not sure why this is happening. Could it be because some of the
triangles that are defined in the triangulate step are completely
outside the domain of the defined subregion? If so, is there a way
around this? Thanks.
[Message index]
 
Read Message
Previous Topic: Plotimage and non-byte images
Next Topic: Re: Set in Stone

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

Current Time: Fri Oct 10 12:48:58 PDT 2025

Total time taken to generate the page: 1.21245 seconds