[yt-users] total mass

Matthew Turk matthewturk at gmail.com
Tue May 6 10:53:45 PDT 2014


Hi Chang-Goo,

On Tue, May 6, 2014 at 1:50 PM, Chang-Goo Kim <cgkim at astro.princeton.edu> wrote:
> Hi all again,
>
> I tried to find mass fraction of each temperature component, but I got
> inconsistent results as below:
>
> ==
>
> dd=pf.all_data()
>
>
>
> hot=dd.cut_region(["obj['temperature'] >= 1.e4"])
>
> wnm=dd.cut_region(["obj['temperature'] < 1.e4"])
>
>
>
> print dd.quantities.total_mass()
>
> print wnm.quantities.total_mass()+hot.quantities.total_mass()
>

The total_mass includes particle fields, which will be incorrectly cut
by the cut_region.  We're trying to figure out a way to make this
clearer, but you should get identical results if you use the
.total_quantity("cell_mass") function.  This was the subject of a
recent bug report and discussion, as well:

https://bitbucket.org/yt_analysis/yt/issue/812/derived-quantities-on-cut_regions-dont

I thought we'd had a pull request discussion, too, but I can't find it
right now.

-Matt

>
>
> 2.88677799841e+38 g
> 2.91575727709e+38 g
>
> ==
>
> I can't understand why those two are different. Have any idea?
>
> Chang-Goo
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>



More information about the yt-users mailing list