<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 14, 2016 at 3:47 AM, Prateek Gupta <span dir="ltr"><<a href="mailto:prateekgidolia@gmail.com" target="_blank">prateekgidolia@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div>Dear Yt users,<br><br></div>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.<br><br></div></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div>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)<br></div></div></blockquote><div><br></div><div>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.</div><div><br></div><div>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:</div><div><br></div><div><a href="http://yt-project.org/doc/reference/api/generated/yt.data_objects.construction_data_containers.YTArbitraryGrid.html?highlight=arbitrary_grid">http://yt-project.org/doc/reference/api/generated/yt.data_objects.construction_data_containers.YTArbitraryGrid.html?highlight=arbitrary_grid</a><br></div><div><a href="http://yt-project.org/doc/analyzing/objects.html#arbitrary-grids-objects">http://yt-project.org/doc/analyzing/objects.html#arbitrary-grids-objects</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br><br></div>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. <br><div><pre><span class="gmail-m_4422934984282870339gmail-k">def</span> <span class="gmail-m_4422934984282870339gmail-nf">particle_density</span><span class="gmail-m_4422934984282870339gmail-p">(</span><span class="gmail-m_4422934984282870339gmail-n">field</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-p">):</span>
    <span class="gmail-m_4422934984282870339gmail-n">pos</span> <span class="gmail-m_4422934984282870339gmail-o">=</span> <span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-p">[</span><span class="gmail-m_4422934984282870339gmail-n">ptype</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-n">coord_name</span><span class="gmail-m_4422934984282870339gmail-p">]</span>
    <span class="gmail-m_4422934984282870339gmail-n">mass</span> <span class="gmail-m_4422934984282870339gmail-o">=</span> <span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-p">[</span><span class="gmail-m_4422934984282870339gmail-n">ptype</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-n">mass_name</span><span class="gmail-m_4422934984282870339gmail-p">]</span>
    <span class="gmail-m_4422934984282870339gmail-n">pos</span><span class="gmail-m_4422934984282870339gmail-o">.</span><span class="gmail-m_4422934984282870339gmail-n">convert_to_units</span><span class="gmail-m_4422934984282870339gmail-p">(</span><span class="gmail-m_4422934984282870339gmail-s">"code_<wbr>length"</span><span class="gmail-m_4422934984282870339gmail-p">)</span>
    <span class="gmail-m_4422934984282870339gmail-n">mass</span><span class="gmail-m_4422934984282870339gmail-o">.</span><span class="gmail-m_4422934984282870339gmail-n">convert_to_units</span><span class="gmail-m_4422934984282870339gmail-p">(</span><span class="gmail-m_4422934984282870339gmail-s">"code_<wbr>mass"</span><span class="gmail-m_4422934984282870339gmail-p">)</span>
    <span class="gmail-m_4422934984282870339gmail-n">d</span> <span class="gmail-m_4422934984282870339gmail-o">=</span> <span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-o">.</span><span class="gmail-m_4422934984282870339gmail-n">deposit</span><span class="gmail-m_4422934984282870339gmail-p">(</span><span class="gmail-m_4422934984282870339gmail-n">pos</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-p">[</span><span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-p">[</span><span class="gmail-m_4422934984282870339gmail-n">ptype</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-n">mass_name</span><span class="gmail-m_4422934984282870339gmail-p">]],</span> <span class="gmail-m_4422934984282870339gmail-n">method</span> <span class="gmail-m_4422934984282870339gmail-o">=</span> <span class="gmail-m_4422934984282870339gmail-s">"sum"</span><span class="gmail-m_4422934984282870339gmail-p">)</span>
    <span class="gmail-m_4422934984282870339gmail-n">d</span> <span class="gmail-m_4422934984282870339gmail-o">=</span> <span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-o">.</span><span class="gmail-m_4422934984282870339gmail-n">ds</span><span class="gmail-m_4422934984282870339gmail-o">.</span><span class="gmail-m_4422934984282870339gmail-n">arr</span><span class="gmail-m_4422934984282870339gmail-p">(</span><span class="gmail-m_4422934984282870339gmail-n">d</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-s">"code_mass"</span><span class="gmail-m_4422934984282870339gmail-p">)</span>
    <span class="gmail-m_4422934984282870339gmail-n">d</span> <span class="gmail-m_4422934984282870339gmail-o">/=</span> <span class="gmail-m_4422934984282870339gmail-n">data</span><span class="gmail-m_4422934984282870339gmail-p">[</span><span class="gmail-m_4422934984282870339gmail-s">"index"</span><span class="gmail-m_4422934984282870339gmail-p">,</span> <span class="gmail-m_4422934984282870339gmail-s">"cell_volume"</span><span class="gmail-m_4422934984282870339gmail-p">]</span>
    <span class="gmail-m_4422934984282870339gmail-k">return</span> <span class="gmail-m_4422934984282870339gmail-n">d</span></pre></div></div></blockquote><div><br></div><div>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:</div><div><br></div><div><a href="http://yt-project.org/doc/analyzing/filtering.html#filtering-particle-fields">http://yt-project.org/doc/analyzing/filtering.html#filtering-particle-fields</a><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><pre></pre>but this also give an error says :<br><b><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr">NameError: global name 'ptype' is not defined<br><br></span></b></div><div><b><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr">but "all_density" field is working fine. </span></b><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr">But it will be total density (dark + baryon</span><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr"></span><b><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr">)<br></span></b></div><div>Please help me regarding this issue.<br><br></div><div><br><br><br><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr">Thanks in advance.<span class="gmail-HOEnZb"><font color="#888888"><br></font></span></span></div><span class="gmail-HOEnZb"><font color="#888888"><div><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr"><br></span></div><div><span class="gmail-m_4422934984282870339gmail-tL8wMe gmail-m_4422934984282870339gmail-EMoHub" id="gmail-m_4422934984282870339gmail-:8g.co" style="text-align:left" dir="ltr">Prateek Gupta.<br></span></div></font></span></div>
<br>______________________________<wbr>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div></div>