[yt-users] Calculating center of mass of a halo in yt 3.3.3

Britton Smith brittonsmith at gmail.com
Wed Feb 22 07:32:25 PST 2017


Hi Reju,

When you create a halo catalog in the above manner, the field will be
called "particle_position".  This dataset will also be saved to disk after
the call to hc.create(), so you can use yt.load to reload the new catalog
without having to remake it.

Britton

On Tue, Feb 21, 2017 at 11:25 PM, Reju Sam John <rejusamjohn at gmail.com>
wrote:

> Dear All,
>
> I am very new in YT 3.3's HaloCatalog functionality. With the following
> piece of code, I am able to get paerical mass and virial radius.
>
> import yt
> from yt.analysis_modules.halo_analysis.api import HaloCatalog
> data_ds = yt.load('/run/media/john/Seagate_Expansion_Drive/cosmo-
> sim_20/RD0057/RedshiftOutput0057')
> hc = HaloCatalog(data_ds=data_ds, finder_method='hop')
> hc.create()
> ad = hc.halos_ds.all_data()
> pm = ad['particle_mass'][:]
> vr = ad['virial_radius'][:]
>
> I would like to calculate the center of mass of the halo. I tried with the
> following line
> com = ad['center_of_mass'][:]
> since like virial_radius(), center_of_mass() was available in YT2.6.
> But this is not working.
>
> Could you please suggest me how to calculate the center of mass of a halo
> in yt 3.3.3 ?
>
>
> --
> Reju Sam John
>
> _______________________________________________
> 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/20170222/bf610749/attachment.html>


More information about the yt-users mailing list