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

Home » Public Forums » archive » Irregular data... IDLgrContour vs. contour
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: Irregular data... IDLgrContour vs. contour [message #43192 is a reply to message #43100] Wed, 16 March 2005 13:57 Go to previous messageGo to previous message
Paul Selby is currently offline  Paul Selby
Messages: 5
Registered: August 2003
Junior Member
jamiesmyth_uni@yahoo.ca wrote:

> Hi all,
>
> I'm a little stuck using IDLgrContour with irregular data. In direct
> graphics I would simply type:
>
> contour, zdata, xdata, ydata, /irregular, yrange=[0,60], nlevels=8
>
> where:
>
> XDATA FLOAT = Array[113]
> YDATA DOUBLE = Array[113]
> ZDATA DOUBLE = Array[113]
>
> Of course, IDLgrContour doesn't accept the /irregular keyword... must I
> grid the data myself? If so, can anyone point me to a good gridding
> routine? I notice that icontour brings up a 'gridding wizzard'...
>
> Thanks,
> Jamie

I needed to do something similar at work.

I used TRIANGULATE to get triangles which I then converted to a connectivity
for IDLgrContour. I don't have the code with me here but the following
seems to do the trick

; get some irregular data
; irreg_grid1.txt comes with IDL 6.1 not sure about other versions
filename = filepath("irreg_grid1.txt", subdirectory = ['examples', 'data'])
data = fltarr(3, 105)
openr, lun, filename, /get_lun
readf, lun, data
free_lun, lun
x = reform(data[0, *])
y = reform(data[1, *])
z = reform(data[2, *])

; construct polygon list
triangulate, x, y, tri
dims = size(tri, /dimensions)
poly = lonarr(4, dims[1])
poly[0, *] = 3
poly[1:3, *] = tri
poly = reform(poly, n_elements(poly), /overwrite)

; display contours in Object and Direct graphics
cont = obj_new('IDLgrContour', z, geomx = x, geomy = y, polygons = poly)
xobjview, cont
contour, z, x, y, /irregular


Hope this helps
Paul
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Get X and Y (sample,line) of an ENVI ROI
Next Topic: Widget_Table specifying Days_of_Week or Months

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

Current Time: Sun Oct 12 11:20:42 PDT 2025

Total time taken to generate the page: 0.80181 seconds