The time now is Tue 24 Apr 2018, 05:14
All times are UTC - 4 |
Author |
Message |
edmont
Joined: 19 Nov 2012 Posts: 46
|
Posted: Thu 07 Dec 2017, 12:58 Post subject:
Mayavi2 3d example Subject description: 3d frequency shown . |
|
This is a non trivial example of how to use Mayavi2 , from a python script ,
to display a fairly large amount of data .
Not certain how long this will take on your machine , you might want to
change the number of samples from 64 to 32 .
This runs okay with python 2.7.x.x .
Code: |
#
# fftc3d.py
#
# (c) 2017 , edmont , sciwiseg@gmail.com
#
#
# Three dimensional plot of centered 3d fft .
#
#
#
import numpy as np
from mayavi.mlab import *
n=64
a = np.zeros((n, n, n))
#
# Spacial domain 3d data , this represents a cube .
#
for i in range(0 , n/6):
for j in range(0,n/4):
for k in range(0,n/2):
a[i,j,k] = 1
b = np.fft.fftn(a)
c = np.abs(b)
c = np.fft.fftshift(c)
#
# Frequency domain 3d data .
#
# With a more complicated result use a lower number of contours .
#
#
obj = contour3d(c, contours=40, transparent=True,opacity=0.5)
from mayavi import mlab
mlab.show()
|
|
Back to top
|
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|
[ Time: 0.0291s ][ Queries: 13 (0.0059s) ][ GZIP on ] |