[yt-users] possible bugs in analytical mass function code and halo profiler code

Stephen Skory s at skory.us
Tue May 24 13:20:01 PDT 2011


Hi Mike,

> 1) In yt/analysis_modules/halo_mass_function/halo_mass_function.py
>   line 327, shouldn't dn_M_z be multiplied by h^3 instead of h^4?

For easy reference here's the function we're talking about:
https://bitbucket.org/yt_analysis/yt/src/f8d1ca7f701c/yt/analysis_modules/halo_mass_function/halo_mass_function.py#cl-294

Thanks for pointing this out, and now that I take a closer look at it
I'm slightly confused, too, and I may need a pinch hitter to weigh in
on this (AKA passing the buck). The history of that code is I took
some C code written by Brian O'Shea and I translated it into Python.
The C version required re-compiling for any changes, linked to the GNU
scientific library (which is ubiquitous, of course), and involved a
multi-step process to get the end product. Converting it to Python
eliminated these issues, and including it in yt made it more
convenient. This section is basically verbatim from Brian (code and
comments), which is clear from the extraneous end-of-expression
semicolons I was too lazy to remove.

You're probably getting the h^3 power based on the comments a few
lines above #327. But as I look at those comments, it looks like to me
that a) the power should actually be h^2 (= h^2 * h * h^-1) and that
b) line 327 should actually be a divide to remove the powers of h.

Brian, if you have a moment, can you dig into your memory vault and
take a look at what Mike has pointed out? Or are we just confused by
the comments which are misleading? Thanks!


-- 
Stephen Skory
s at skory.us
http://stephenskory.com/
510.621.3687 (google voice)



More information about the yt-users mailing list