Dear yt:
I am trying to plot streamlines using SlicePlot(x axis) and
annotate_streamlines (script below). The resulting image (google drive link
below) gives the orientation of streamlines along y axis. I would like to
have the streamlines orient along z-axis. I have tried switching the
variables on "SlicePlot" and "annotate_streamlines" but the streamlines
stays the same.
Can you give me any suggestions?
Thank you in advance
-----------------------------------
Image link
https://drive.google.com/open?id=0B4g8shg4DL7oak5PLWVVdG5UMHc
-----------------------------------
script
import yt
import numpy as np
import matplotlib.pylab as pl
import matplotlib
from yt.visualization.api import Streamlines
from yt.units import km
from mpl_toolkits.mplot3d import Axes3D
ms = 24000000
vector_max=ms-(ms/3)
ms1=ms-vector_max
dims = (200,200,200)
x =
np.genfromtxt("/work/jbi157/MODEL3/UPDATE_B/yo_n_t005.mtx",skip_header=2,usecols=1,
dtype="f8")
x = x.reshape((8000000, 3), order="F")
field1 = x[:,2].reshape(dims, order="F")
field2 = x[:,1].reshape(dims, order="F")
field3 = x[:,0].reshape(dims, order="F")
data = dict(field_x = field1,
field_y = field2,
field_z = field3)
bbox = np.array([[-100, 99], [-100, 99], [-100, 99]])
pf = yt.load_uniform_grid(data, dims, km, bbox=bbox, nprocs=1)
slc = yt.SlicePlot(pf, 0, ["field_z"], width=(200,'km'))
slc.set_cmap('field_z','B-W LINEAR_r')
#slc.set_log('field_z', True, linthresh=0.001)
slc.annotate_streamlines('field_z',
'field_y',factor=16,density=4,plot_args={'color':'blue'})
#slc.annotate_streamlines('field_y', 'field_z',factor=16,density=4)
slc.annotate_line((0.36, 0), (0.36, 1),
coord_system='axis',plot_args={'color':'white'})
slc.annotate_line((0.64, 0), (0.64, 1),
coord_system='axis',plot_args={'color':'white'})
# larger the value of factor lesser the quiver
#slc.annotate_quiver('field_y', 'field_z', factor=20, normalize=True)
#slc.annotate_line_integral_convolution('field_y', 'field_z',
lim=(0.30,0.70),cmap="YlGnBu",alpha=1,const_alpha=True)
slc.annotate_sphere([0.5, 0.5, 0.5], radius=(9,
'km'),circle_args={'color':'black'})
#slc.annotate_text((50,50),'t=0',coord_system='plot',text_args={'color':'black'})
slc.annotate_title("t=005, psi=30")
slc.hide_colorbar()
slc.save('plane_x_t_0005.png')
#slc.save('plane_x_t_0000.png', mpl_kwargs={'facecolor':'gray'})
On Thu, Jan 10, 2019 at 11:00 AM
Send yt-users mailing list submissions to yt-users@python.org
To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman3/lists/yt-users.python.org/ or, via email, send a message with subject or body 'help' to yt-users-request@python.org
You can reach the person managing the list at yt-users-owner@python.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of yt-users digest..."
Today's Topics:
1. ANN: yt dev workshop, March 4-6 (Matthew Turk)
----------------------------------------------------------------------
Date: Thu, 10 Jan 2019 09:58:14 -0600 From: Matthew Turk
Subject: [yt-users] ANN: yt dev workshop, March 4-6 To: yt-dev@python.org, Discussion of the yt analysis package Cc: "Campbell, Mary Terese" , Samantha Walkow , Madicken Munk Message-ID: Content-Type: text/plain; charset="UTF-8" Hi everyone!
We are delighted to invite you to a yt development workshop at the University of Illinois Urbana-Champaign, March 4-6 of 2019. Please feel encouraged to pass this information on to others that may find it interesting!
Information on logistics and registration may be found at the workshop website:
http://yt-project.org/workshops/spring2019/
This workshop will be focused on extending existing functionality, building collaborations with other software projects, and ingestion of new types and classes of data into yt.
The workshop will take place at the National Center for Supercomputing Applications building on the north end of the UIUC campus. The NCSA building is about a block away from the conference hotel and is next door to a parking structure that offers metered all-day parking. There are a number of food trucks nearby, a university-run cafeteria about 2 blocks away, and a university business district with many good lunch restaurants about a half a mile away.
We are planning to offer funding for hotel and travel for those requesting support. If you request funding, you will be notified of available funds by February 16. Travel awards will be made in the form of arranged lodging and airfare, with reservations being made by the conference organizers.
Best regards, The Organizing Committee
MT Campbell Nathan Goldbaum Madicken Munk Matt Turk Samantha Walkow
------------------------------
Subject: Digest Footer
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
------------------------------
End of yt-users Digest, Vol 131, Issue 8 ****************************************
-- *SK2* *"**Claiming that something can move faster than light is a good conversation-stopper in physics. People edge away from you in cocktail parties; friends never return phone calls. You just don’t mess with Albert Einstein.**"*
Hi,
I think you need to do a bit of hackery to make this work. The x and
y axes are governed by the variables ds.coordinates.x_axis and
ds.coordinates.y_axis. These are dictionaries keyed by the axis along
which a slice is made. You can possibly change the orientation by
modifying those, but the change will have to be made before making the plot.
On Tue, Jul 2, 2019 at 5:00 PM Sushilkumar
Dear yt: I am trying to plot streamlines using SlicePlot(x axis) and annotate_streamlines (script below). The resulting image (google drive link below) gives the orientation of streamlines along y axis. I would like to have the streamlines orient along z-axis. I have tried switching the variables on "SlicePlot" and "annotate_streamlines" but the streamlines stays the same.
Can you give me any suggestions?
Thank you in advance ----------------------------------- Image link https://drive.google.com/open?id=0B4g8shg4DL7oak5PLWVVdG5UMHc ----------------------------------- script
import yt import numpy as np import matplotlib.pylab as pl import matplotlib
from yt.visualization.api import Streamlines from yt.units import km from mpl_toolkits.mplot3d import Axes3D
ms = 24000000 vector_max=ms-(ms/3) ms1=ms-vector_max dims = (200,200,200)
x = np.genfromtxt("/work/jbi157/MODEL3/UPDATE_B/yo_n_t005.mtx",skip_header=2,usecols=1, dtype="f8") x = x.reshape((8000000, 3), order="F")
field1 = x[:,2].reshape(dims, order="F") field2 = x[:,1].reshape(dims, order="F") field3 = x[:,0].reshape(dims, order="F")
data = dict(field_x = field1, field_y = field2, field_z = field3)
bbox = np.array([[-100, 99], [-100, 99], [-100, 99]])
pf = yt.load_uniform_grid(data, dims, km, bbox=bbox, nprocs=1)
slc = yt.SlicePlot(pf, 0, ["field_z"], width=(200,'km'))
slc.set_cmap('field_z','B-W LINEAR_r') #slc.set_log('field_z', True, linthresh=0.001)
slc.annotate_streamlines('field_z', 'field_y',factor=16,density=4,plot_args={'color':'blue'}) #slc.annotate_streamlines('field_y', 'field_z',factor=16,density=4)
slc.annotate_line((0.36, 0), (0.36, 1), coord_system='axis',plot_args={'color':'white'}) slc.annotate_line((0.64, 0), (0.64, 1), coord_system='axis',plot_args={'color':'white'})
# larger the value of factor lesser the quiver #slc.annotate_quiver('field_y', 'field_z', factor=20, normalize=True)
#slc.annotate_line_integral_convolution('field_y', 'field_z', lim=(0.30,0.70),cmap="YlGnBu",alpha=1,const_alpha=True)
slc.annotate_sphere([0.5, 0.5, 0.5], radius=(9, 'km'),circle_args={'color':'black'}) #slc.annotate_text((50,50),'t=0',coord_system='plot',text_args={'color':'black'}) slc.annotate_title("t=005, psi=30")
slc.hide_colorbar()
slc.save('plane_x_t_0005.png') #slc.save('plane_x_t_0000.png', mpl_kwargs={'facecolor':'gray'})
On Thu, Jan 10, 2019 at 11:00 AM
wrote: Send yt-users mailing list submissions to yt-users@python.org
To subscribe or unsubscribe via the World Wide Web, visit https://mail.python.org/mailman3/lists/yt-users.python.org/ or, via email, send a message with subject or body 'help' to yt-users-request@python.org
You can reach the person managing the list at yt-users-owner@python.org
When replying, please edit your Subject line so it is more specific than "Re: Contents of yt-users digest..."
Today's Topics:
1. ANN: yt dev workshop, March 4-6 (Matthew Turk)
----------------------------------------------------------------------
Date: Thu, 10 Jan 2019 09:58:14 -0600 From: Matthew Turk
Subject: [yt-users] ANN: yt dev workshop, March 4-6 To: yt-dev@python.org, Discussion of the yt analysis package Cc: "Campbell, Mary Terese" , Samantha Walkow , Madicken Munk Message-ID: Content-Type: text/plain; charset="UTF-8" Hi everyone!
We are delighted to invite you to a yt development workshop at the University of Illinois Urbana-Champaign, March 4-6 of 2019. Please feel encouraged to pass this information on to others that may find it interesting!
Information on logistics and registration may be found at the workshop website:
http://yt-project.org/workshops/spring2019/
This workshop will be focused on extending existing functionality, building collaborations with other software projects, and ingestion of new types and classes of data into yt.
The workshop will take place at the National Center for Supercomputing Applications building on the north end of the UIUC campus. The NCSA building is about a block away from the conference hotel and is next door to a parking structure that offers metered all-day parking. There are a number of food trucks nearby, a university-run cafeteria about 2 blocks away, and a university business district with many good lunch restaurants about a half a mile away.
We are planning to offer funding for hotel and travel for those requesting support. If you request funding, you will be notified of available funds by February 16. Travel awards will be made in the form of arranged lodging and airfare, with reservations being made by the conference organizers.
Best regards, The Organizing Committee
MT Campbell Nathan Goldbaum Madicken Munk Matt Turk Samantha Walkow
------------------------------
Subject: Digest Footer
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
------------------------------
End of yt-users Digest, Vol 131, Issue 8 ****************************************
-- SK2
"Claiming that something can move faster than light is a good conversation-stopper in physics. People edge away from you in cocktail parties; friends never return phone calls. You just don’t mess with Albert Einstein."
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org
участники (2)
-
Matthew Turk
-
Sushilkumar