adding quantities to halo catalogs
Hi Everyone, I'm trying to add a quantity to my halo catalog which is cold gas mass. We can assume I've already defined the field cold_gas_mass, but I'm having trouble understanding how to add it to my halo catalog. The examples all seem to be for profiles and it isn't clear to me what to do if you aren't looking for a profile. Does anyone have an example of doing something like this they could share? The total gas mass or any other sum of fluid quantities would probably be close enough for me understand the syntax. Thanks, Ari
Hi Ari, I suggest something like the following. First, you need to define a data container to associate with each halo. This is usually a sphere, and you can follow the cookbook recipe for how to do that: http://yt-project.org/doc/cookbook/cosmological_analysis.html#halo-profiling... If you use the "sphere" callback as the example above shows, it will create a sphere data container associated with each halo object as: halo.data_container Then, assuming you have your cold_gas_mass field, you can just define a quantity that returns the total of that over the halo's sphere. The sphere object is like any other data container, so you can use a derived quantity to return the total of your field. It should look something like this: def _total_cold_gas(halo): return halo.data_container.quantities.total_quantity("cold_gas_mass") add_quantity("total_cold_gas", _total_cold_gas) Let us know if you encounter any troubles and thanks for pointing out some places where the docs could use some additions! Britton On Mon, Jun 22, 2015 at 9:41 PM, Professor Maller <amaller@citytech.cuny.edu
wrote:
Hi Everyone,
I'm trying to add a quantity to my halo catalog which is cold gas mass. We can assume I've already defined the field cold_gas_mass, but I'm having trouble understanding how to add it to my halo catalog. The examples all seem to be for profiles and it isn't clear to me what to do if you aren't looking for a profile. Does anyone have an example of doing something like this they could share? The total gas mass or any other sum of fluid quantities would probably be close enough for me understand the syntax.
Thanks,
Ari
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
participants (2)
-
Britton Smith -
Professor Maller