SphericalGalaxyClusterModel#

class pisces.models.galaxy_clusters.spherical.SphericalGalaxyClusterModel(filepath: str | Path, *args, **kwargs)[source]#

Spherical, hydrostatic galaxy cluster model.

This model represents a galaxy cluster composed of 3 components:

  1. Gas: the hot, diffuse plasma filling the cluster.

  2. Dark Matter: the dominant mass component, providing gravitational binding.

  3. Stellar: the stellar component, if provided.

The model is fully spherical and assumes hydrostatic equilibrium, meaning the gas pressure balances the gravitational pull of the total mass (gas + dark matter + stellar). This model ignores the presence of non-thermal pressure components (e.g., cosmic rays, magnetic fields).

Fields#

The following physical fields are computed and stored in the model:

Spherical Galaxy Cluster Model Fields#

Field Name

Description

Symbol

Notes

radii

Radial coordinate grid

\(r\)

gas_density

Gas density profile

\(\rho_{\mathrm{gas}}(r)\)

stellar_density

Stellar density profile

\(\rho_\star(r)\)

total_density

Total density profile

\(\rho_{\mathrm{tot}}(r)\)

dark_matter_density

Dark matter density profile

\(\rho_{\mathrm{DM}}(r)\)

gas_mass

Enclosed gas mass

\(M_{\mathrm{gas}}(<r)\)

stellar_mass

Enclosed stellar mass

\(M_\star(<r)\)

total_mass

Enclosed total mass

\(M_{\mathrm{tot}}(<r)\)

dark_matter_mass

Enclosed dark matter mass

\(M_{\mathrm{DM}}(<r)\)

gravitational_field

Gravitational acceleration

\(g(r)\)

gravitational_potential

Gravitational potential

\(\Phi(r)\)

pressure

Gas pressure profile

\(P(r)\)

temperature

Gas temperature profile

\(T(r)\)

electron_density

Electron number density

\(n_e(r)\)

entropy

Entropy profile

\(K(r)\)

sound_speed

Adiabatic sound speed

\(c_s(r)\)

baryon_fraction

Baryonic mass fraction

\(M_{\rm bary} / M_{\rm tot}\)

Methodology#

This model makes a number of assumptions across all of its construction methods:

  • Spherical symmetry: all profiles depend only on radius \(r\).

  • Fully thermal hydrostatic equilibrium (HE): non-thermal pressure components are ignored.

  • Single-phase gas: temperature and density are well-defined scalars at each point.

  • Ionic equilibrium: used for electron density and entropy computation.

  • Ideal gas law: pressure and temperature are related via a constant mean molecular weight.

The process to generate a model follows one of three modes depending on the inputs.

Hint

This mode is available through from_density_and_total_density().

Given gas density \(\rho_{\mathrm{gas}}(r)\), total density \(\rho_{\mathrm{tot}}(r)\), and an optional stellar density \(\rho_{\star}(r)\), we perform the following steps:

  1. Compute Dark Matter Density:

    Requiring that the total density is the sum of gas, stellar, and dark matter densities:

    \[\rho_{\mathrm{DM}}(r) = \rho_{\mathrm{tot}}(r) - \rho_{\mathrm{gas}}(r) - \rho_{\star}(r)\]
  1. Compute mass profiles via:

    \[M_i(<r) = 4\pi \int_0^r \rho_i(r') \, r'^2 \, dr'\]

    for each component \(i \in \{\mathrm{gas}, \mathrm{tot}, {\rm dm}, \mathrm{stellar}\}\).

  2. Compute the gravitational field:

    \[\nabla \Phi(r) = \frac{G M_{\mathrm{tot}}(<r)}{r^2}\]
  3. Use hydrostatic equilibrium to integrate for pressure:

    \[\nabla P = - \rho_{\mathrm{gas}}(r) \nabla \Phi(r)\]
  4. Solve for temperature using the ideal gas law:

    \[T(r) = \frac{P(r)}{n(r)} = \frac{P(r)}{\rho_{\mathrm{gas}}(r)} \cdot \mu m_p\]

Hint

This mode is available through from_temperature_and_density().

Given \(T(r)\) and \(\rho_{\mathrm{gas}}(r)\), we compute:

  1. Pressure from the ideal gas law:

    \[P(r) = \rho_{\mathrm{gas}}(r) \cdot T(r) / (\mu m_p)\]
  2. Gravitational field via hydrostatic equilibrium:

    \[g(r) = -\frac{1}{\rho_{\mathrm{gas}}(r)} \cdot \frac{dP}{dr}\]
  3. Total mass profile:

    \[M_{\mathrm{tot}}(<r) = \frac{r^2 \cdot g(r)}{G}\]
  4. Derive \(\rho_{\mathrm{tot}}(r)\) via:

    \[\rho_{\mathrm{tot}}(r) = \frac{1}{4\pi r^2} \frac{dM_{\mathrm{tot}}}{dr}\]

Hint

This mode is available through from_entropy_and_density().

Given entropy \(K(r)\) and gas density \(\rho_{\mathrm{gas}}(r)\), we use:

  1. Entropy definition:

    \[K(r) = \frac{T(r)}{n_e(r)^{2/3}}\]

    with

    \[n_e(r) = \frac{\rho_{\mathrm{gas}}(r)}{\mu_e m_p}\]
  2. Invert to get temperature:

    \[T(r) = K(r) \cdot \left(\frac{\rho_{\mathrm{gas}}(r)}{\mu_e m_p}\right)^{2/3}\]
  3. Compute pressure from ideal gas law and proceed as in the temperature + density pathway.

Note

In all modes, the gravitational potential is computed via:

\[\Phi(r) = -G \left[ \frac{M(<r)}{r} + 4\pi \int_0^r \rho_{\mathrm{tot}}(r') \cdot r' \, dr' \right]\]

Methods

__init__(filepath, *args, **kwargs)

Load a Pisces model from an existing HDF5 file.

add_field(name[, element_shape, units, ...])

Add a new physical field to the model.

add_profile(name, profile[, overwrite])

Add a new analytic profile to the model.

compute_df(species[, num_points, scale, ...])

Compute the isotropic Eddington distribution function for a given species.

copy_field(old_name, new_name)

Create a duplicate of an existing field under a new name.

copy_profile(old_name, new_name)

Create a duplicate of an existing profile under a new name.

from_components(filepath, grid, fields, ...)

Create and save a Pisces model from in-memory components.

from_density_and_total_density(...[, ...])

Generate a spherical cluster model from analytic density profiles.

from_entropy_and_density(density_profile, ...)

Generate a spherical cluster model from gas density and entropy profiles.

from_temperature_and_density(...[, ...])

Generate a spherical galaxy cluster model from gas density and temperature profiles.

generate_particles(filename, num_particles)

Convert this galaxy cluster model into a particle dataset.

get_active_hooks([names])

Return all active hook classes mixed into the model.

get_all_hooks([names])

Return all hook classes mixed into the model, regardless of activation status.

get_df(species)

Retrieve the distribution function and energy grid for a given species.

get_field(name)

Retrieve a physical field by name.

get_hook_class(hook_name)

Return the hook class associated with a given hook name.

get_hook_description(hook_cls)

Return the human-readable description for a given hook class.

get_hook_name(hook_cls)

Return the symbolic name for a given hook class.

get_profile(name)

Retrieve an analytic profile by name.

has_hook(hook)

Check if a given hook is mixed into the model (regardless of activation status).

list_fields()

List all physical fields currently stored in the model.

list_profiles()

List all analytic profiles currently stored in the model.

remove_field(name)

Remove a physical field from the model.

remove_profile(name)

Remove an analytic profile from the model.

rename_field(old_name, new_name)

Rename an existing field in the model.

rename_profile(old_name, new_name)

Rename an existing profile in the model.

Attributes

active_grid_axes

List of active axes in the model's grid.

config

Model-specific configuration settings.

coordinate_system

The coordinate system of the model's grid.

dark_matter_df

Return (E, DF) for the dark matter component.

fields

Model field buffers.

grid

The spatial grid of the model.

handle

The open HDF5 file handle.

has_dark_matter_df

Check whether the dark matter DF is stored in the model file.

has_stellar_df

Check whether the stellar DF is stored in the model file.

logger

Logger interface for this model.

metadata

Model metadata dictionary.

path

The path to the model's HDF5 file.

profiles

Model profile objects.

stellar_df

Return (E, DF) for the stellar component.