<div dir="ltr">Hi Francia,<div><br></div><div>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:</div>

<div><br></div><div>mx, my, mz = ((halo["particle_position_%" % ax][stars] * sm).sum()/sm.sum() for ax in 'xyz')</div><div><br></div><div>That should give you your center of mass in x, y, z for the stars.</div>

<div><br></div><div>-Matt</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Oct 21, 2013 at 12:07 PM, Francia Riesco <span dir="ltr"><<a href="mailto:ff2214@columbia.edu" target="_blank">ff2214@columbia.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Everybody,<br>
 I hope you are great!<br>
 I have a question for you<br>
I am analyzing an Enzo data trying to get the center of mass of the Stars Particles. I am suing FOF<br>
<br>
linking_length = 0.017094633<br>
haloes = FOFHaloFinder(pf, link=linking_length ,dm_only=False)<br>
for halo in haloes:<br>
    ct = halo["creation_time"]<br>
    sm = halo["ParticleMassMsun"]<br>
    metal = halo["metallicity_fraction"]<br>
    stars = (ct > 0)<br>
    ct = ct[stars]<br>
    sm = sm[stars]<br>
<br>
<br>
<br>
Is there a way to get sm.center_of_mass()  or something similar to get the Center of Mass of the Stars Particles??<br>
Thank you in Advance !<br>
<br>
<br>
<br>
______________________________<u></u>_________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/<u></u>listinfo.cgi/yt-users-<u></u>spacepope.org</a><br>
</blockquote></div><br></div>