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

Reju Sam John rejusamjohn at gmail.com
Tue Feb 21 23:25:25 PST 2017


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170222/d7389ded/attachment.htm>


More information about the yt-users mailing list