pynbody.analysis.theoretical_profiles.NFWprofile

pynbody.analysis.theoretical_profiles.NFWprofile#

class pynbody.analysis.theoretical_profiles.NFWprofile(halo_radius, scale_radius=None, density_scale_radius=None, concentration=None, halo_mass=None)[source]#

Bases: AbstractBaseProfile

Methods

fit(radial_data, profile_data[, ...])

Fit profile data with a leastsquare method.

jacobian_profile_functional_static(radius, ...)

Analytical expression of the jacobian of the profile for more robust fitting.

get_dlogrho_dlogr

get_dlogrho_dlogr_static

get_enclosed_mass

keys

log_profile_functional_static

profile_functional

profile_functional_static

__init__(halo_radius, scale_radius=None, density_scale_radius=None, concentration=None, halo_mass=None)[source]#

To initialise an NFW profile, we always need:

halo_radius: outer boundary of the halo (r200m, r200c, rvir … depending on definitions)

The profile can then be initialised either through scale_radius + central_density or halo_mass + concentration

scale_radius: radius at which the slope is equal to -2

density_scale_radius: 1/4 of density at r=rs (normalisation).

halo_mass: mass enclosed inside the outer halo radius

concentration: outer_radius / scale_radius

From one mode of initialisation, the derived parameters of the others are calculated, e.g. if you initialise with halo_mass + concentration, the scale_radius and central density will be derived.

classmethod fit(radial_data, profile_data, profile_err=None, use_analytical_jac=None, guess=None)#

Fit profile data with a leastsquare method.

  • profile_err * Error bars on the profile data as a function of radius. Can be a covariance matrix.

  • guess * Provide a list of parameters initial guess for optimisation

static jacobian_profile_functional_static(radius, density_scale_radius, scale_radius)[source]#

Analytical expression of the jacobian of the profile for more robust fitting.