[yt-users] TotalMass

Geoffrey So gsiisg at gmail.com
Mon Jul 21 14:20:12 PDT 2014


Hi Yong,

>From what I found on yt's API
http://yt-project.org/docs/dev/reference/field_list.html?highlight=totalmass#totalmass

def _TotalMass(field,data):
    return (data["Density"]+data["particle_density"]) * data["CellVolume"]

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.

From
G.S.


On Mon, Jul 21, 2014 at 2:00 PM, Yong Zheng <yz2505 at columbia.edu> wrote:

> Hi,
>
> 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 $YT_DEST/src/yt-hg/tests:
>
> pf = load("DD0010/moving7_0010")
>
> dd = pf.h.all_data()
>
>
> then dd["TotalMassMsun"].sum() returns 1.25198e12 Msun, but
> dd.quantities["TotalMass"]() returns 1.22517e12 Msun
>
> 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?
>
> Thanks for your help!
> Yong
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20140721/63ea0575/attachment.html>


More information about the yt-users mailing list