pisces.models.galaxy_clusters.spherical.SphericalGalaxyClusterModel.compute_df#

SphericalGalaxyClusterModel.compute_df(species: Literal['stellar', 'dark_matter'], num_points: int = 1000, scale: Literal['linear', 'log'] = 'linear', boundary_value: unyt_quantity = unyt_quantity(0, 'km**2/s**2'), save: bool = True) tuple[unyt_array, unyt_array][source]#

Compute the isotropic Eddington distribution function for a given species.

This method applies the Eddington inversion formula to recover the distribution function \(f(\mathcal{E})\) from the density profile \(\rho(r)\) and gravitational potential \(\Phi(r)\) of the model, assuming spherical symmetry and velocity isotropy.

Parameters:
  • species ({"stellar", "dark_matter"}) – The species to compute the distribution function for. Must correspond to a field in the model named "<species>_density".

  • num_points (int, optional) – Number of energy samples to evaluate (default is 1000).

  • scale ({"linear", "log"}, optional) –

    Sampling strategy for the relative energy grid \(\mathcal{E}\).

    • ”linear”: Uniform spacing from 0 to \(\Psi_0\).

    • ”log”: Logarithmic spacing over a fixed dynamic range (default: “linear”).

  • boundary_value (unyt_quantity, optional) – The potential at the outer boundary \(\Phi_0\), used to define the relative potential \(\Psi = - (\Phi - \Phi_0)\). Default is 0.

  • save (bool, optional) – If True (default), stores the computed distribution function and energy grid to the model HDF5 file in the "DISTRIBUTION_FUNCTIONS" group using keys "E_<species>" and "DF_<species>".

Returns:

  • energy (unyt_array) – The relative energy grid \(\mathcal{E}\), with units of velocity squared.

  • distribution (unyt_array) – The corresponding distribution function \(f(\mathcal{E})\), with units of \([\rho][\mathcal{E}]^{-3/2}\).

Raises:

ValueError – If the model does not contain the required fields for the given species.