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 
Switch to threaded view of this topic Create a new topic Submit Reply
Irregular data... IDLgrContour vs. contour [message #43100] Wed, 16 March 2005 07:31 Go to next message
jamiesmyth_uni@yahoo. is currently offline  jamiesmyth_uni@yahoo.
Messages: 6
Registered: July 2004
Junior Member
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
Re: Irregular data... IDLgrContour vs. contour [message #43192 is a reply to message #43100] Wed, 16 March 2005 13:57 Go 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
Re: Irregular data... IDLgrContour vs. contour [message #43193 is a reply to message #43100] Wed, 16 March 2005 12:46 Go to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior 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?

Have you tried passing the irregular data to IDLgrContour without the
keyword? I expect this should work (but don't recall ever trying it
myself) because the IDLgrContour documentation states that it accepts
1-D vectors for DATA_VALUES, GEOMX and GEOMY.


> If so, can anyone point me to a good gridding
> routine?

GRIDDATA


--
Mark Hadfield "Ka puwaha te tai nei, Hoea tatou"
m.hadfield@niwa.co.nz
National Institute for Water and Atmospheric Research (NIWA)
  Switch to threaded view of this topic Create a new topic Submit Reply
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: Wed Oct 08 17:06:12 PDT 2025

Total time taken to generate the page: 0.00718 seconds