Non-linear models

class camb.nonlinear.NonLinearModel(*args, **kwargs)[source]

Abstract base class for non-linear correction models.

Variables:

Min_kh_nonlinear – (float64) minimum k/h at which to apply non-linear corrections

class camb.nonlinear.Halofit(*args, **kwargs)[source]

Bases: NonLinearModel

Various specific approximate non-linear correction models based on HaloFit.

Variables:
  • halofit_version – (integer/string, one of: original, bird, peacock, takahashi, mead, halomodel, casarini, mead2015, mead2016, mead2020, mead2020_feedback)

  • HMCode_A_baryon – (float64) HMcode parameter A_baryon

  • HMCode_eta_baryon – (float64) HMcode parameter eta_baryon

  • HMCode_logT_AGN – (float64) HMcode parameter log10(T_AGN/K)

set_params(halofit_version='mead2020', HMCode_A_baryon=3.13, HMCode_eta_baryon=0.603, HMCode_logT_AGN=7.8)[source]

Set the halofit model for non-linear corrections.

Parameters:
  • halofit_version

    One of

  • HMCode_A_baryon – HMcode parameter A_baryon. Default 3.13. Used only in models mead2015 and mead2016 (and its alias mead).

  • HMCode_eta_baryon – HMcode parameter eta_baryon. Default 0.603. Used only in mead2015 and mead2016 (and its alias mead).

  • HMCode_logT_AGN – HMcode parameter logT_AGN. Default 7.8. Used only in model mead2020_feedback.

class camb.nonlinear.ExternalNonLinearRatio(*args, **kwargs)[source]

Bases: NonLinearModel

Non-linear model that applies a user-supplied ratio sqrt(P_NL/P_L) from an external source, for example CCL or axionHMcode.

Use set_ratio() to provide the ratio grid, then assign the instance to params.NonLinearModel before calling camb.get_results(). This can also be used after computing time transfers, so lensed C_l values are generated with a consistent external non-linear prescription. Requested k_h or z values outside the supplied grid are clamped to the nearest grid boundary.

clear_ratio()[source]

Clear the stored ratio grid and release the interpolation data.

set_ratio(k_h, z, ratio)[source]

Set the non-linear ratio grid sqrt(P_NL/P_L).

Parameters:
  • k_h – 1D array of k values in h/Mpc units (ascending)

  • z – 1D array of redshift values (ascending)

  • ratio – 2D array of sqrt(P_NL/P_L), shape (len(z), len(k_h)), matching the convention of CAMB’s get_matter_power_spectrum. Values requested outside the supplied grid are clamped to the nearest tabulated boundary.

class camb.nonlinear.SecondOrderPK(*args, **kwargs)[source]

Bases: NonLinearModel

Third-order Newtonian perturbation theory results for the non-linear correction. Only intended for use at very high redshift (z>10) where corrections are perturbative, it will not give sensible results at low redshift.

See Appendix F of astro-ph/0702600 for equations and references.

Not intended for production use, it’s mainly to serve as an example alternative non-linear model implementation.