[yt-users] Related to Off axis plot and Dark matter density field

Prateek Gupta prateekgidolia at gmail.com
Fri Oct 14 01:47:28 PDT 2016


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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20161014/686688a9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check2.png
Type: image/png
Size: 122413 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20161014/686688a9/attachment-0001.png>


More information about the yt-users mailing list