<div dir="ltr">Hi Nick,<div><br></div><div>I think the way to do this is via a custom halo quantity:</div><div><br></div><div><a href="http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html#quantities">http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html#quantities</a><br></div><div><br></div><div>You can see how the current halo quantities are defined here:</div><div><br></div><div><a href="https://github.com/yt-project/yt/blob/master/yt/analysis_modules/halo_analysis/halo_quantities.py#L40">https://github.com/yt-project/yt/blob/master/yt/analysis_modules/halo_analysis/halo_quantities.py#L40</a><br></div><div><br></div><div>Rather than using the StarFormationRate class from the star analysis module (which is deprecated and not maintained) I think a better way to do this is to calculate the star formation rate using a particle filter for stars that formed dynamically in the simulation. The star formation rate can then be calculated by using a weighted histogram of the particle creation times. See this cookbook recipe for an example:</div><div><br></div><div><a href="http://yt-project.org/doc/cookbook/calculating_information.html#using-particle-filters-to-calculate-star-formation-rates">http://yt-project.org/doc/cookbook/calculating_information.html#using-particle-filters-to-calculate-star-formation-rates</a></div><div><br></div><div>Hope that helps,</div><div><br></div><div>Nathan</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 1, 2017 at 10:33 AM, Nick Gnedin <span dir="ltr"><<a href="mailto:ngnedin@gmail.com" target="_blank">ngnedin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Folks,<br>
<br>
Could someone advise me how to compute SFR for halos?<br>
<br>
I have a dataset for which I computed SFR:<br>
<br>
d = yt.load('/data/gnedin/REICMP/D<wbr>/RT/CASE.REF2/rei10_a0.1003/re<wbr>i10_a0.1003.art')<br>
ad = d.all_data()<br>
sfr = StarFormationRate(d,data_sourc<wbr>e=ad)<br>
<br>
I also know how to add stellar masses to halos:<br>
<br>
sm = d.add_deposited_particle_field<wbr>(("STAR","MASS"),"sum")<br>
h = yt.load('/data/gnedin/REICMP/D<wbr>/RT/CASE.REF2/HC/a=0.1/hc.0.h5<wbr>')<br>
hc = HaloCatalog(data_ds=d,halos_ds<wbr>=h,output_dir="/data/gnedin/RE<wbr>ICMP/D/RT/CASE.REF2/HC/a=0.1")<br>
hc.add_recipe("calculate_viria<wbr>l_quantities", ["radius", sm], overdensity_field=('artio', 'HVAR_GAS_DENSITY'))<br>
hc.create()<br>
<br>
But how do I add sfr.Msol_yr field from sfr as a deposited particle field for d?<br>
<br>
Thank you so much,<br>
<br>
Nick Gnedin<br>
<br>
<br>
<br>
______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/lis<wbr>tinfo.cgi/yt-users-spacepope.<wbr>org</a><br>
</blockquote></div><br></div>