Related to Off axis plot and Dark matter density field
Dear Yt users, I want to the off axis slice plot of density. But I didn't understand the use of north_vector. We already gave the normal vector to the plane and the point and these two things are enough to write a plane equation. I think I am confused with the concept. Please help me in understanding it very well. I am facing one more problem. I want the dark matter density Sliceplot. But when I used the field "dark_matter_density", it's not giving the correct plot I think. Here I attach the plot also for your reference. (check2.png) Then I searched and got that it can also be done if I plot the particle_density so I define field like this as given in yt-doc. def particle_density(field, data): pos = data[ptype, coord_name] mass = data[ptype, mass_name] pos.convert_to_units("code_length") mass.convert_to_units("code_mass") d = data.deposit(pos, [data[ptype, mass_name]], method = "sum") d = data.ds.arr(d, "code_mass") d /= data["index", "cell_volume"] return d but this also give an error says : *NameError: global name 'ptype' is not defined* *but "all_density" field is working fine. *But it will be total density (dark + baryon *)* Please help me regarding this issue. Thanks in advance. Prateek Gupta.
On Fri, Oct 14, 2016 at 3:47 AM, Prateek Gupta <prateekgidolia@gmail.com> wrote:
Dear Yt users,
I want to the off axis slice plot of density. But I didn't understand the use of north_vector. We already gave the normal vector to the plane and the point and these two things are enough to write a plane equation. I think I am confused with the concept. Please help me in understanding it very well.
The north_vector is the "up" direction in the image. The normal_vector only sets the location that the image "looks" at, but not the overall rotation. Setting north_vector allows you to control the orientation of the image. If the normal_vector and north_vector are not orthogonal, then in practice yt uses the component of the north_vector that is perpendicular to the normal_vector. If normal_vector and north_vector are parallel, an error will be raised.
I am facing one more problem. I want the dark matter density Sliceplot. But when I used the field "dark_matter_density", it's not giving the correct plot I think. Here I attach the plot also for your reference. (check2.png)
It looks like you're looking at a dataset where the dark matter aren't as well-resolved as other species, which means that there are many cells with no or very few dark matter particles. You might find that visualizing your deposited particle fields will work better on a more coarse mesh, for example a mesh created using an arbitrary_grid data object: http://yt-project.org/doc/reference/api/generated/yt.data_objects.constructi... http://yt-project.org/doc/analyzing/objects.html#arbitrary-grids-objects
Then I searched and got that it can also be done if I plot the particle_density so I define field like this as given in yt-doc.
def particle_density(field, data): pos = data[ptype, coord_name] mass = data[ptype, mass_name] pos.convert_to_units("code_length") mass.convert_to_units("code_mass") d = data.deposit(pos, [data[ptype, mass_name]], method = "sum") d = data.ds.arr(d, "code_mass") d /= data["index", "cell_volume"] return d
Where in the documentation did this come from? In order to use this field definition you need to set the 'ptype' variable. If there is a particle type in your output corresponding to dark matter, use that. If there is only one particle type in your output, you can create a dark matter particle type using a particle filter: http://yt-project.org/doc/analyzing/filtering.html#filtering-particle-fields
but this also give an error says :
*NameError: global name 'ptype' is not defined* *but "all_density" field is working fine. *But it will be total density (dark + baryon *)* Please help me regarding this issue.
Thanks in advance.
Prateek Gupta.
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Nathan Goldbaum
-
Prateek Gupta