problem with hidden lines in SURFACE in IDL version 5.5 and 5.6 [message #34851] |
Wed, 23 April 2003 07:56 |
Kristian Kjaer
Messages: 58 Registered: June 1998
|
Member |
|
|
I used to enjoy a barely-documented feature of the IDL SURFACE
procedure:
If the data are on a 'topologically rectangular' grid, then I could use
the SURFACE procedure on them without the need to TRIGRID the data onto
a strictly rectangular grid.
However this feature seems to be broken since version 5.5.
Do y'all see the same, and does anyone know a work-around?
I try to avoid TRIGRID because
* it is slow,
* it interpolates the data points (bad!), and
* it used to give a one-half pixel offset to the data, although I think
this has been fixed in IDL 5.x
- Kristian
; Document a problem with hidden lines in SURFACE in IDL version 5.5 and
5.6:
; Make up some surface data:
x=-2.447+findgen(204)/203*(16.3659+2.447)
y=14.0+findgen(181)/180*(18.5-14.0)
z=1/(1+(x/8)^4)#(1/(1+(y-16.5)^6))*2500
; Plot the data:
surface,z,x,y,ax=45,az=-30,/hor
; It also works to have x and y the same SIZE as z:
xx=x#(1+y-y)
yy=(1+x-x)#y
; Plot the data. This looks the same as before:
surface,z,xx,yy,ax=45,az=-30,/hor
; Apply the following nonlinear transformation:
kvec=4.81949
degree=!pi/180.
xxx =kvec*sin(xx*degree)
yyy =kvec*sqrt(1+cos(xx*degree)^2-2*cos(xx*degree)*cos(yy*degree ))
; Now xxx and yyy are not on a rectangular grid.
; One could use trigrid etc. to interpolate to a new rectangular grid.
; However, the following is much easier and faster, and it
; also works correctly in IDL through version 5.3:
surface,z,xxx,yyy,ax=45,az=-30,/hor
; However, in IDL5.5 and IDL5.6, the hidden lines come out wrong.
|
|
|