[yt-users] problem using streamlines
Matthew Turk
matthewturk at gmail.com
Wed Nov 20 12:26:24 PST 2013
Hi Kathy,
On Tue, Nov 19, 2013 at 6:17 PM, Kathy Eastwood <kathy.eastwood at nau.edu> wrote:
> 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.
You can get this info with "yt instinfo" on the command line. I don't
think the streamlines have changed too recently, so you should be
okay!
>
> 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?)
So, the data container issue does sound correct. Are you using the
cookbook data?
>
> 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...
Okay, I think I see the issue. It looks like you're using a FLASH
dataset, is that right? Try setting your length in cm, rather than
1.0. If, for instance, you wanted this to be roughly the bounding
edge of the volume, you could do:
length = pf.domain_width[0]
Can you try that, and let us know?
-Matt
>
> 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
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
More information about the yt-users
mailing list