fitting_functions

class hmf.fitting_functions.Angulo(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Angulo mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Angulo [R1] form is:

\[f_{\rm Ang}(\sigma) = A\left[\left(\frac{e}{\sigma}\right)^b + c\right]\exp(\frac{d}{\sigma^2})\]

References

[R1](1, 2) Angulo, R. E., et al., 2012.

arXiv:1203.3216v1

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Bhattacharya(**model_parameters)

Class representing a Bhattacharya mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Bhattacharya [R2] form is:

\[f_{\rm Btc}(\sigma) = f_{\rm SMT}(\sigma) (\nu\sqrt{a})^q\]

References

[R2](1, 2) Bhattacharya, S., et al., May 2011. ApJ 732 (2), 122.

http://labs.adsabs.harvard.edu/ui/abs/2011ApJ...732..122B

Methods

fsigma(cut_fit) Calculate \(f(\sigma)\) for Bhattacharya form.
fsigma(cut_fit)

Calculate \(f(\sigma)\) for Bhattacharya form.

Bhattacharya, S., et al., May 2011. ApJ 732 (2), 122. http://labs.adsabs.harvard.edu/ui/abs/2011ApJ...732..122B

Note

valid for \(10^{11.8}M_\odot < M <10^{15.5}M_\odot\)

Returns:

vfv : array_like, len=len(pert.M)

The function :math:`f(sigma)equiv

u f(

u)` defined on pert.M

class hmf.fitting_functions.Courtin(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Courtin mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Courtin [R3] form is:

\[f_{\rm Ctn}(\sigma) = A\sqrt{2a/\pi}\nu\exp(-a\nu^2/2)(1+(a\nu^2)^{-p})\]

References

[R3](1, 2) Courtin, J., et al., Oct. 2010. MNRAS 1931

http://doi.wiley.com/10.1111/j.1365-2966.2010.17573.x

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Crocce(**model_parameters)

Class representing a Crocce mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Crocce [R4] form is:

\[f_{\rm Cro}(\sigma) = A\left[\left(\frac{e}{\sigma}\right)^b + c\right]\exp(\frac{d}{\sigma^2})\]

References

[R4](1, 2) Crocce, M., et al. MNRAS 403 (3), 1353-1367.

http://doi.wiley.com/10.1111/j.1365-2966.2009.16194.x

Methods

fsigma(cut_fit)
class hmf.fitting_functions.FittingFunction(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Base-class for a halo mass function fit

This class should not be called directly, rather use a subclass which is specific to a certain fitting formula.

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Methods

fsigma(cut_fit) Calculate \(f(\sigma)\equiv\nu f(\nu)\).
fsigma(cut_fit)

Calculate \(f(\sigma)\equiv\nu f(\nu)\).

Parameters:

cut_fit : bool

Whether to cut the fit at bounds corresponding to the fitted range (in mass or corresponding unit, not redshift). If so, values outside this range will be set to NaN.

Returns:

vfv : array_like, len=len(self.M)

The function f(sigma).

class hmf.fitting_functions.Jenkins(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Jenkins mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Jenkins [R5] form is:

\[f_{\rm Jenkins}(\sigma) = A\exp(-|\ln\sigma^{-1}+b|^c)\]

References

[R5](1, 2) Jenkins, A. R., et al., Feb. 2001. MNRAS 321 (2), 372-384.

http://doi.wiley.com/10.1046/j.1365-8711.2001.04029.x

Methods

fsigma(cut_fit)
class hmf.fitting_functions.PS(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Press-Schechter mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Press-Schechter [R6] form is:

\[f_{\rm PS}(\sigma) = \sqrt{\frac{2}{\pi}}\nu\exp(-0.5\nu^2)\]

References

[R6](1, 2) Press, W. H., Schechter, P., 1974. ApJ 187, 425-438.

http://adsabs.harvard.edu/full/1974ApJ...187..425P

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Peacock(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Peacock mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Peacock [R7] form is:

\[f_{\rm Pck}(\sigma) = \nu\exp(-c\nu^2)(2cd\nu+ba\nu^{b-1})/d^2\]

References

[R7](1, 2) Peacock, J. A., Aug. 2007. MNRAS 379 (3), 1067-1074.

http://adsabs.harvard.edu/abs/2007MNRAS.379.1067P

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Reed03(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Reed03 mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Reed03 [R8] form is:

\[f_{\rm R03}(\sigma) = f_{\rm SMT}(\sigma)\exp\left(-\frac{c}{\sigma \cosh^5(2\sigma)}\right)\]

References

[R8](1, 2) Reed, D., et al., Dec. 2003. MNRAS 346 (2), 565-572.

http://adsabs.harvard.edu/abs/2003MNRAS.346..565R

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Reed07(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Reed07 mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Reed07 [R9] form is:

\[f_{\rm R07}(\sigma) = A\sqrt{2a/\pi}\left[1+(\frac{1}{a\nu^2})^p+0.6G_1+0.4G_2\right]\nu\exp(-ca\nu^2/2-\frac{0.03\nu^{0.6}}{(n_{\rm eff}+3)^2})\]

References

[R9](1, 2) Reed, D. S., et al., Jan. 2007. MNRAS 374 (1), 2-15.

http://adsabs.harvard.edu/abs/2007MNRAS.374....2R

Methods

fsigma(cut_fit)
class hmf.fitting_functions.SMT(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Sheth-Mo-Tormen mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Sheth-Mo-Tormen [R10] form is:

\[f_{\rm SMT}(\sigma) = A\sqrt{2a/\pi}\nu\exp(-a\nu^2/2)(1+(a\nu^2)^{-p})\]

References

[R10](1, 2) Sheth, R. K., Mo, H. J., Tormen, G., May 2001. MNRAS 323 (1), 1-12.

http://doi.wiley.com/10.1046/j.1365-8711.2001.04006.x

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Tinker08(**model_parameters)

Class representing a Tinker08 mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Tinker08 [R11] form is:

\[f_{\rm Tkr}(\sigma) = A(\frac{\sigma}{b}^{-a}+1)\exp(-c/\sigma^2)\]

References

[R11](1, 2) Tinker, J., et al., 2008. ApJ 688, 709-728.

http://iopscience.iop.org/0004-637X/688/2/709

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Warren(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Warren mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Warren [R12] form is:

\[f_{\rm Warren}(\sigma) = A\left[\left(\frac{e}{\sigma}\right)^b + c\right]\exp(\frac{d}{\sigma^2})\]

References

[R12](1, 2) Warren, M. S., et al., Aug. 2006. ApJ 646 (2), 881-885.

http://adsabs.harvard.edu/abs/2006ApJ...646..881W

Methods

fsigma(cut_fit)
class hmf.fitting_functions.Watson(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a Watson mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The Watson [R13] form is:

\[f_{\rm WatS}(\sigma) = \Gamma A \left((\frac{\beta}{\sigma}^\alpha+1\right)\exp(-\gamma/\sigma^2)\]

References

[R13](1, 2) Watson, W. A., et al., Dec. 2012.

http://arxiv.org/abs/1212.0095

Methods

fsigma(cut_fit)
gamma() Calculate \(\Gamma\) for the Watson fit.
gamma()

Calculate \(\Gamma\) for the Watson fit.

class hmf.fitting_functions.Watson_FoF(M, nu2, delta_c, sigma=None, n_eff=None, lnsigma=None, z=0, delta_halo=200, cosmo=None, omegam_z=None, **model_parameters)

Class representing a WatsonFoF mass function fit

Parameters:

M : array

A vector of halo masses [units M_sun/h]

nu2 : array

A vector of peak-heights, \(\delta_c^2/\sigma^2\) corresponding to M

z : float, optional

The redshift.

delta_halo : float, optional

The overdensity of the halo w.r.t. the mean density of the universe.

cosmo : cosmo.Cosmology instance, optional

A cosmology. Default is the default provided by the cosmo.Cosmology class. Not required if omegam_z is passed.

omegam_z : float, optional

A value for the mean matter density at the given redshift z. If not provided, will be calculated using the value of cosmo.

**model_parameters : unpacked-dictionary

These parameters are model-specific. For any model, list the available parameters (and their defaults) using <model>._defaults

Notes

The WatsonFoF [R14] form is:

\[f_{\rm WatF}(\sigma) = A\left[\left(\frac{e}{\sigma}\right)^b + c\right]\exp(\frac{d}{\sigma^2})\]

References

[R14](1, 2) Watson, W. A., et al., Dec. 2012.

http://arxiv.org/abs/1212.0095

Methods

fsigma(cut_fit)
hmf.fitting_functions.get_fit(name, **kwargs)

Returns the correct subclass of FittingFunction.

Parameters:

name : str

The class name of the appropriate fit

**kwargs :

Any parameters for the instantiated fit (including model parameters)