pisces.models.galaxy_clusters.spherical.SphericalGalaxyClusterModel.from_temperature_and_density#
- classmethod SphericalGalaxyClusterModel.from_temperature_and_density(density_profile: BaseSphericalDensityProfile, temperature_profile: BaseSphericalTemperatureProfile, filename: str | Path, min_radius: unyt_quantity | str = unyt_quantity(1, 'kpc'), max_radius: unyt_quantity | str = unyt_quantity(1, 'Mpc'), num_points: int = 1000, overwrite: bool = False, stellar_density_profile: BaseSphericalDensityProfile = None, **kwargs)[source]#
Generate a spherical galaxy cluster model from gas density and temperature profiles.
- Parameters:
density_profile (
BaseSphericalDensityProfile
) – Profile object representing the radial gas density.temperature_profile (
BaseSphericalTemperatureProfile
) – Profile object representing the radial gas temperature.filename (
str
orPath
) – Output HDF5 file path.min_radius (
unyt_quantity
orstr
, optional) – Minimum radius for sampling (default: 1 kpc).max_radius (
unyt_quantity
orstr
, optional) – Maximum radius for sampling (default: 1 Mpc).num_points (
int
, optional) – Number of radial samples (default: 1000).overwrite (
bool
, optional) – Whether to overwrite existing file (default: False).stellar_density_profile (
BaseSphericalDensityProfile
, optional) – Optional stellar density profile. If provided, the stellar density will be included in the model. Otherwise, the stellar density is assumed to be zero and no stellar component is included.**kwargs – Additional keyword arguments for radial grid construction (e.g., spacing).
Notes
Given \(T(r)\) and \(\rho_{\mathrm{gas}}(r)\), we compute:
Pressure from the ideal gas law:
\[P(r) = \rho_{\mathrm{gas}}(r) \cdot T(r) / (\mu m_p)\]Gravitational field via hydrostatic equilibrium:
\[g(r) = -\frac{1}{\rho_{\mathrm{gas}}(r)} \cdot \frac{dP}{dr}\]Total mass profile:
\[M_{\mathrm{tot}}(<r) = \frac{r^2 \cdot g(r)}{G}\]Derive \(\rho_{\mathrm{tot}}(r)\) via:
\[\rho_{\mathrm{tot}}(r) = \frac{1}{4\pi r^2} \frac{dM_{\mathrm{tot}}}{dr}\]