<div dir="ltr">Hi Yong,<div><br></div><div>From what I found on yt's API</div><div><a href="http://yt-project.org/docs/dev/reference/field_list.html?highlight=totalmass#totalmass">http://yt-project.org/docs/dev/reference/field_list.html?highlight=totalmass#totalmass</a><br>
</div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0.2em;font-size:13px;color:rgb(51,51,51);border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre-wrap;background-color:rgb(245,245,245);border:none;text-align:justify">
<span class="" style="margin:0px;padding:0px;color:rgb(0,128,0);font-weight:bold">def</span> <span class="" style="margin:0px;padding:0px;color:rgb(0,0,255)">_<span class="" style="margin:0px;padding:0px;background-color:rgb(251,229,78)">TotalMass</span></span><span class="" style="margin:0px;padding:0px">(</span><span class="" style="margin:0px;padding:0px">field</span><span class="" style="margin:0px;padding:0px">,</span><span class="" style="margin:0px;padding:0px">data</span><span class="" style="margin:0px;padding:0px">):</span>
    <span class="" style="margin:0px;padding:0px;color:rgb(0,128,0);font-weight:bold">return</span> <span class="" style="margin:0px;padding:0px">(</span><span class="" style="margin:0px;padding:0px">data</span><span class="" style="margin:0px;padding:0px">[</span><span class="" style="margin:0px;padding:0px;color:rgb(186,33,33)">"Density"</span><span class="" style="margin:0px;padding:0px">]</span><span class="" style="margin:0px;padding:0px;color:rgb(102,102,102)">+</span><span class="" style="margin:0px;padding:0px">data</span><span class="" style="margin:0px;padding:0px">[</span><span class="" style="margin:0px;padding:0px;color:rgb(186,33,33)">"particle_density"</span><span class="" style="margin:0px;padding:0px">])</span> <span class="" style="margin:0px;padding:0px;color:rgb(102,102,102)">*</span> <span class="" style="margin:0px;padding:0px">data</span><span class="" style="margin:0px;padding:0px">[</span><span class="" style="margin:0px;padding:0px;color:rgb(186,33,33)">"CellVolume"</span><span class="" style="margin:0px;padding:0px">]</span></pre>
</div><div>The field TotalMass includes the density and particle_density, where particle_density is the particles smoothed onto the cell volume to become a field quantity.  So the discrepancy might be coming from the smoothing.</div>
<div><br></div><div>From</div><div>G.S.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 21, 2014 at 2:00 PM, Yong Zheng <span dir="ltr"><<a href="mailto:yz2505@columbia.edu" target="_blank">yz2505@columbia.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi, <div><br></div><div>I am trying to calculate the total mass of an object, but found the result slightly different when I use different methods. To explain the question, I use the test data set in <span style="line-height:22.399999618530273px;text-align:justify;margin:0px;padding:0px;color:rgb(187,96,213)">$YT_DEST</span><span style="color:rgb(0,0,0);line-height:22.399999618530273px;text-align:justify">/src/yt-hg/tests: </span></div>

<div><br></div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;text-align:justify"><pre style="margin-top:0px;margin-bottom:0px;padding:0px"><font color="#000000"><span style="line-height:22.399999618530273px">pf = load("DD0010/moving7_0010")<br>

</span></font></pre><pre style="margin-top:0px;margin-bottom:0px;padding:0px"><font color="#000000"><span style="line-height:22.399999618530273px">dd = pf.h.all_data()</span></font></pre></pre></div><div><br></div><div>then dd["TotalMassMsun"].sum() returns 1.25198e12 Msun, but dd.quantities["TotalMass"]() returns 1.22517e12 Msun</div>

<div><br></div><div>The document says that the first method returns the total mass of baryon and dark matter, while the second returns the total mass of baryon and particles. I wonder what is the difference here? In this data, there is only type of particle (particle_type = 1), so supposedly particle mass should represent the dark matter mass, right? </div>

<div><br></div><div>Thanks for your help! </div><span class="HOEnZb"><font color="#888888"><div>Yong</div></font></span></div>
<br>_______________________________________________<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" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>