[yt-users] Newbie: SFR for halos

Nathan Goldbaum nathan12343 at gmail.com
Mon May 1 08:44:21 PDT 2017


Hi Nick,

I think the way to do this is via a custom halo quantity:

http://yt-project.org/doc/analyzing/analysis_modules/halo_catalogs.html#quantities

You can see how the current halo quantities are defined here:

https://github.com/yt-project/yt/blob/master/yt/analysis_modules/halo_analysis/halo_quantities.py#L40

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:

http://yt-project.org/doc/cookbook/calculating_information.html#using-particle-filters-to-calculate-star-formation-rates

Hope that helps,

Nathan





On Mon, May 1, 2017 at 10:33 AM, Nick Gnedin <ngnedin at gmail.com> wrote:

>
> Folks,
>
> Could someone advise me how to compute SFR for halos?
>
> I have a dataset for which I computed SFR:
>
> d = yt.load('/data/gnedin/REICMP/D/RT/CASE.REF2/rei10_a0.1003/re
> i10_a0.1003.art')
> ad = d.all_data()
> sfr = StarFormationRate(d,data_source=ad)
>
> I also know how to add stellar masses to halos:
>
> sm = d.add_deposited_particle_field(("STAR","MASS"),"sum")
> h = yt.load('/data/gnedin/REICMP/D/RT/CASE.REF2/HC/a=0.1/hc.0.h5')
> hc = HaloCatalog(data_ds=d,halos_ds=h,output_dir="/data/gnedin/RE
> ICMP/D/RT/CASE.REF2/HC/a=0.1")
> hc.add_recipe("calculate_virial_quantities", ["radius", sm],
> overdensity_field=('artio', 'HVAR_GAS_DENSITY'))
> hc.create()
>
> But how do I add sfr.Msol_yr field from sfr as a deposited particle field
> for d?
>
> Thank you so much,
>
> Nick Gnedin
>
>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170501/ec3ebaa6/attachment.html>


More information about the yt-users mailing list