2012-11-26 3 views
1

극좌표의 점 격자에 위치한 스칼라 값을가집니다. 세타 및 파이 각도를 자유롭게 선택할 수 있지만 r 값은 데이터 평가의 또 다른 단계에서 제공됩니다. isosurface를 플롯하고 mayavi를 사용하여 데이터를 잘라내는 방법은 무엇입니까?불규칙한 간격의 Mayavi로 등고 면면을 그려야합니다.

from scipy import * 
from enthought.mayavi import mlab 

r_val = [0.5, 1.0, 1.5, 2.0] # externally given 
r, theta, phi = mgrid[ \ 
     r_val[0]:r_val[-1]:len(r_val)*1.j, \ 
     0:pi:len(r_val)*1.j, \ 
     0:2.*pi:len(r_val)*1.j ] 
x = r*sin(theta)*cos(phi) 
y = r*sin(theta)*sin(phi) 
z = r*cos(theta) 
# here would be the data 
s = ones_like(x) 
s *= r*r 
# the x,y,z axes of this plot are r,theta,phi 
mlab.contour3d(s) 
# but I want them to be x,y,z! 
# this does not work 
#mlab.contour3d(x,y,z,s) 

답변

0

참조 ... 바로 그 순간에

, 나는 eucledian 그리드를 얻을 수 scipy.interpolate.griddata를 사용하기 위해 노력하고있어하지만 결과없이 이미 몇 시간 동안 작동하고 http://permalink.gmane.org/gmane.comp.python.enthought.devel/20667

src = mlab.pipeline.scalar_scatter(x,y,z,s) 
iso=mlab.pipeline.iso_surface(gs)