pisces.models.galaxy_clusters.spherical.MagnetizedSphericalGalaxyClusterModel.from_temperature_and_density#
- classmethod MagnetizedSphericalGalaxyClusterModel.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, beta_profile: BaseProfile | Callable | float = 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.beta_profile (
BaseSphericalDensityProfile
orfloat
orcallable
, optional) – The magnetic pressure fraction \(\beta\). This is the ratio between the thermal pressure and the magnetic pressure. By default, it is set to \(\infty\), corresponding to an unmagnetized cluster. For larger values of \(\beta\), the cluster will become less magnetized.**kwargs – Additional keyword arguments passed to the radial grid construction.
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}\]