[yt-users] problem using streamlines
Kathy Eastwood
kathy.eastwood at nau.edu
Tue Nov 19 15:17:50 PST 2013
Dear yt folk:
I am a yt beginner, using Mac OS X 10.7.5. I am not sure which version of
yt I am using -- how do I check? -- but I started using it about 5 weeks
ago.
Here is my problem. I am trying to create some streamlines. I have
followed the cookbook example, and it runs, but there is nothing in my plot
-- it is empty. I have tried increasing the scale factor, the "length", and
the alpha...all to no avail. (I also note that I have NOT been able to get
it to work with a data container such as a sphere rather than the entire pf
-- does that sound correct?)
I am including the bit of code that tries to do the streamlines...any
suggestions as to why I cannot see any velocity streamlines? If I do a
sliceplot and annotate the velocities with the same dataset, I can see the
vectors there with no problem....but I would like to be able to look at the
magnetic fields, etc. I would also like to zoom in on a sphere if at all
possible...
thanks
Kathy Eastwood
from yt.visualization.api import Streamlines
from mpl_toolkits.mplot3d import Axes3D
c = np.array([0.5]*3)
N = 100
scale = 1.0
pos_dx = np.random.random((N,3))*scale-scale/2.
pos = c+pos_dx
streamlines = Streamlines(pf,pos,'velx', 'vely', 'velz', length=1.0)
streamlines.integrate_through_volume()
fig=plt.figure()
ax = Axes3D(fig)
for stream in streamlines.streamlines:
stream = stream[np.all(stream != 0.0, axis=1)]
ax.plot3D(stream[:,0], stream[:,1], stream[:,2], alpha=0.1)
plt.savefig('streamlines.png')
--
Kathy DeGioia Eastwood, Ph.D.
Professor of Physics and Astronomy
Northern Arizona University
Flagstaff, AZ 86011-6010
Ph: 928-523-7159 FX: 928-523-1371
Kathy.Eastwood at nau.edu
deliveries: 602 S. Humphreys St., Bldg 19 Rm 209
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20131119/73a1432e/attachment.htm>
More information about the yt-users
mailing list