pisces.models.galaxy_clusters.spherical.MagnetizedSphericalGalaxyClusterModel.add_profile#

MagnetizedSphericalGalaxyClusterModel.add_profile(name: str, profile: BaseProfile, overwrite: bool = False)#

Add a new analytic profile to the model.

Profiles represent analytic functions (e.g., NFW, Vikhlinin) that can generate fields or describe physical quantities. This method saves the profile in both memory and the on-disk HDF5 file.

Parameters:
  • name (str) – Name of the profile (e.g., "density").

  • profile (BaseProfile) – An instance of a subclass of BaseProfile.

  • overwrite (bool, optional) – If True, replaces an existing profile with the same name. Defaults to False.

Raises:

KeyError – If the profile already exists and overwrite=False.