<div dir="ltr">Hi Ari,<div><br></div><div>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:</div><div><a href="http://yt-project.org/doc/cookbook/cosmological_analysis.html#halo-profiling-and-custom-analysis">http://yt-project.org/doc/cookbook/cosmological_analysis.html#halo-profiling-and-custom-analysis</a><br></div><div><br></div><div>If you use the "sphere" callback as the example above shows, it will create a sphere data container associated with each halo object as:</div><div>halo.data_container</div><div><br></div><div>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:</div><div><br></div><div><font face="monospace, monospace">def _total_cold_gas(halo):</font></div><div><font face="monospace, monospace">    return halo.data_container.quantities.total_quantity("cold_gas_mass")</font></div><div><font face="monospace, monospace">add_quantity("total_cold_gas", _total_cold_gas)</font></div><div><br></div><div>Let us know if you encounter any troubles and thanks for pointing out some places where the docs could use some additions!</div><div><br></div><div>Britton</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 22, 2015 at 9:41 PM, Professor Maller <span dir="ltr"><<a href="mailto:amaller@citytech.cuny.edu" target="_blank">amaller@citytech.cuny.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Everyone,<div><br></div><div>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.</div><div><br></div><div>Thanks,</div><div><br></div><div>Ari</div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div>