[yt-users] how to add halo quantity

Nathan Goldbaum nathan12343 at gmail.com
Fri Nov 17 09:37:40 PST 2017


Hi Daegene,

You need to import add_quantity from the halo analysis API:

    from yt.analysis_modules.halo_analysis.api import add_quantity

Hope that helps,

Nathan

On Thu, Nov 16, 2017 at 2:55 PM, Daegene Koh <dkoh30 at gatech.edu> wrote:

> Hi all,
>
> I’m trying to add a new quantity to a halo catalog following the docs as
> such,
>
>  23 *def* _total_mass(halo):
>  24     gasmass, dmmass =  halo.data_object.quantities.total_mass()
>  25     *return* gasmass+dmmass
>  26
>  27 add_quantity('total_mass',_total_mass)
>  28 hc.add_quantity('total_mass’)
>
> however, it seems at add_quantity is not defined. How do I go about doing
> this?
>
> Cheers,
> DK
>
>
> _______________________________________________
> 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/20171117/e7d9d1d0/attachment.html>


More information about the yt-users mailing list