Re: [yt-users] Getting error in Worked Example of Halo Analysis
Hi Britton,
When I set critical_density=500, does it mean 500 times of the average
density, or 500 times of the critical density?
Thanks,
Jingjing
2015-03-20 4:22 GMT-04:00 Britton Smith
Hi Reju,
It looks like the version of the notebook you are working from is a little out of date as the syntax for some of those callbacks has changed. Please, have a look here for an updated version: http://yt-project.org/doc/cookbook/halo_analysis_example.html I just ran this myself and confirmed everything to be working.
As for your other questions:
1) How to find the center of mass of the halos(
hc.add_quantity('center_of_mass') is not working )
By default, the halo catalog is storing the center of the halo as calculated by the halo finder that you used. If you reload the halo catalog that you produce, the x, y, and z position of each halo are the "particle_position_x", "particle_position_y", "particle_position_z" fields. For example, you could do: ds = yt.load(your_halo_catalog) ad = ds.all_data() print ad["particle_position_x"]
Additionally, the halo catalog has a callback called "iterative_center_of_mass" which starts from the original center and iteratively recalculates the center of mass while reducing the radius of the sphere. I have found this to work very well for calculating halo centers. If you use this callback, it will rewrite the particle_position fields to contain the new center for each halo. To get more information on this callback, do the following:
from yt.analysis_modules.halo_analysis.halo_callbacks import * help(iterative_center_of_mass)
2) How to find virial mass (both M_500 and M_200 ) of the halas
You can find these using the virial_quantities callback. In the example you are working from, you can add another field to the virial_quantities callback you use and it would calculate the value of that field where the overdensity = 200. For total mass, the field you want is called "matter_mass". To get M_500 instead of M_200, you can call the virial_quantities callback again and give the keyword argument critical_density=500.
Britton
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- Jingjing Chen [ chenjj235@gmail.com ] Department of Astronomy Columbia University 550 West 120th Street New York, New York 10027 Cell Phone: +1(347)5746709
participants (3)
-
Britton Smith
-
Chen Jingjing
-
Nathan Goldbaum