Hello Everybody, I hope you are great! I have a question for you I am analyzing an Enzo data trying to get the center of mass of the Stars Particles. I am suing FOF linking_length = 0.017094633 haloes = FOFHaloFinder(pf, link=linking_length ,dm_only=False) for halo in haloes: ct = halo["creation_time"] sm = halo["ParticleMassMsun"] metal = halo["metallicity_fraction"] stars = (ct > 0) ct = ct[stars] sm = sm[stars] Is there a way to get sm.center_of_mass() or something similar to get the Center of Mass of the Stars Particles?? Thank you in Advance !
Hi Francia, Looks to me like as it stands, you will have to calculate your center of mass manually. (This is something we have addressed in the development branch, where it's a lot easier to do this kind of filtering, but it is not yet in the mainline branch.) You can do it like this: mx, my, mz = ((halo["particle_position_%" % ax][stars] * sm).sum()/sm.sum() for ax in 'xyz') That should give you your center of mass in x, y, z for the stars. -Matt On Mon, Oct 21, 2013 at 12:07 PM, Francia Riesco <ff2214@columbia.edu>wrote:
Hello Everybody, I hope you are great! I have a question for you I am analyzing an Enzo data trying to get the center of mass of the Stars Particles. I am suing FOF
linking_length = 0.017094633 haloes = FOFHaloFinder(pf, link=linking_length ,dm_only=False) for halo in haloes: ct = halo["creation_time"] sm = halo["ParticleMassMsun"] metal = halo["metallicity_fraction"] stars = (ct > 0) ct = ct[stars] sm = sm[stars]
Is there a way to get sm.center_of_mass() or something similar to get the Center of Mass of the Stars Particles?? Thank you in Advance !
______________________________**_________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/**listinfo.cgi/yt-users-**spacepope.org<http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
participants (2)
-
Francia Riesco
-
Matthew Turk