[yt-dev] bug in SFRD calculation

Greg Bryan gbryan at astro.columbia.edu
Fri Apr 4 06:15:17 PDT 2014


Yes, although the star formation rate in cosmology is usually calculated in a comoving volume, not proper (see, e.g., http://arxiv.org/pdf/1403.0007v2.pdf).

Greg

On Apr 3, 2014, at 11:15 PM, Nathan Goldbaum <nathan12343 at gmail.com> wrote:

> Hi Geoffrey,
> 
> I'm not very familiar with the star formation rate calculator, but if you think there is a bug I'd encourage you to submit a pull request with a fix.
> 
> -Nathan
> 
> 
> On Thu, Apr 3, 2014 at 6:37 PM, Geoffrey So <gsiisg at gmail.com> wrote:
> There seems to be a bug in the star formation rate density calculation routine.  The volume is only the real 'proper volume' at the current redshift and not at any other redshifts, because it uses the current redshift in the calculation of proper volume in all redshifts.
> 
> #---------------------------------
> from yt.mods import *
> from yt.analysis_modules.star_analysis.api import *
> import pylab
> 
> pf=load('HD1200/HD1200')
> dd=pf.h.all_data()
> sfr = StarFormationRate(pf, data_source=dd, bins=10)
> sfr.write_out(name="StarFormationRate.out")
> time, lookback, z, Msolyr, MsolyrMpc3, Msol, cumMsol=na.loadtxt('StarFormationRate.out',usecols=(0,1,2,3,4,5,6),skiprows=2,unpack=True)
> 
> cMpc3,=pylab.plot(z,Msolyr/(pf['CosmologyComovingBoxSize']/pf['CosmologyHubbleConstantNow'])**3)
> currentz,=pylab.plot(z,MsolyrMpc3/(1+pf.current_redshift)**3+1e-5)
> Expect,=pylab.plot(z,MsolyrMpc3/(1+z)**3)
> 
> pylab.legend([cMpc3,currentz,Expect],
>              ['[s$^{-1}$cMpc$^{-3}$]',
>               'use only current z to fit',
>               'Expected to fit'])
> 
> pylab.savefig('SFRD.eps')
> #---------------------------------
> 
> 
> in the file:
> yt/analysis_modules/star_analysis/sfr_spectrum.py
> line 151:
>             self.Msol_yr_vol.append(self.mass_bins[i] / \
>                 (self.time_bins_dt[i] * tc / YEAR) / vol)
> 
> The vol is a fixed number instead of varying by the redshift, even though the numerator in solar masses per year is from different redshifts.
> 
> So I think a couple lines above it should create an empty array of vol
> vol = []
> In the loop
> for i, time…
> calculate the right volume vol[i]
> Then instead of dividing by the constant vol, divide by vol[i] corresponding to the right redshift.
>             self.Msol_yr_vol.append(self.mass_bins[i] / \
>                 (self.time_bins_dt[i] * tc / YEAR) / vol[i])
> 
> From
> G.S.
> 
> 
> 
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org
> 
> 
> _______________________________________________
> yt-dev mailing list
> yt-dev at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-dev-spacepope.org

----------------------------------
Greg Bryan
Associate Professor of Astronomy
Department of Astronomy, Columbia University
1325 Pupin Physics Laboratories, Mail Code 5246
550 West 120th Street
New York, New York 10027 (USA)

email: gbryan at astro.columbia.edu
phone: +1(212)854-6837
fax  : +1(212)854-8121





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-dev-spacepope.org/attachments/20140404/647486d5/attachment.htm>


More information about the yt-dev mailing list