Radial Profiles#
Under the hood, CG relies on functions of the cluster’s radius to represent most physical variables. These are then used
to carry out the mathematics necessary to produce the self consistent clusters necessary for simulation. The radial_profiles
module
and its core class radial_profiles.RadialProfile
provide all of the necessary additional structure needed for these
radial profiles wrapped around standard python callables. On this page, you’ll find information on the built-in radial profiles that
CG provides, how to use them, and how to define your own custom radial_profiles.RadialProfile
.
Contents
Built-In Radial Profiles#
The following radial profiles are built-in to the CG framework. You can call them just as you would a standard function. Click on the name of each profile to access more comprehensive information about it.
|
Pseudo-polytropic gas density profile from [AsDi08]. |
|
Pseudo-polytropic gas temperature profile from [AsDi08]. |
|
The density profile for galaxy clusters suggested by [AsMa06]. |
|
The temperature profile for galaxy clusters suggested by [AsMa06]. |
|
The baseline entropy profile for galaxy clusters [VoKB05]. |
|
A beta-model density profile [CaFu76]. |
|
Generate a broken entropy profile |
|
Provide constant profile. |
|
A Hernquist density profile [Hern90] with a core radius. |
|
A cored "super-NFW" density profile [LiWyS18]. |
|
A cored "super-NFW" mass profile [LiWyS18]. |
|
Find the total mass parameter for the cored super-NFW model [LiWyS18] by inputting a reference mass and radius (say, M200c and R200c), along with the scale radius. |
|
A density profile where the logarithmic slope is a power-law [Eina65]. |
|
A mass profile where the logarithmic slope is a power-law [Eina65]. |
|
A Hernquist density profile [Hern90]. |
|
A Hernquist mass profile [Hern90]. |
|
An NFW density profile [NaFrW90]. |
|
An NFW mass profile [NaFrW90]. |
|
A profile which is a power-law with radius, scaled so that it has a certain value |
|
Given an NFW concentration parameter, calculate the corresponding sNFW concentration parameter. |
|
A "super-NFW" density profile [LiWyS18]. |
|
A "super-NFW" mass profile [LiWyS18]. |
|
Find the total mass parameter for the super-NFW model [LiWyS18] by inputting a reference mass and radius (say, M200c and R200c), along with the scale radius. |
|
|
|
A truncated NFW (tNFW) mass profile [BaMaO09]. |
|
A modified beta-model density profile for galaxy clusters from [ViKrF06]. |
|
A temperature profile for galaxy clusters from [ViKrF06]. |
|
Generate a walker entropy profile. |
Using Radial Profiles#
radial_profiles.RadialProfile
instances work just like any other function; you can call them on arrays or on individual
values and get an output just as you usually would. For example,
from cluster_generator.radial_profiles import constant_profile
p = constant_profile(10)
print(p(6))
>>> 10
On top of the expected behaviors as a function, radial_profiles.RadialProfile
have additional functionality which can be of great
use. The radial_profiles.RadialProfile.cutoff()
and radial_profiles.RadialProfile.add_core()
can be used to truncate a profile
at a certain radius or to add a core to the center of the profile respectively.
You can also save radial_profiles.RadialProfile
instances to disk using a binary serialization with radial_profiles.RadialProfile.to_binary()
. These can be read again
with the radial_profiles.RadialProfile.from_binary()
. Finally, there is the radial_profiles.RadialProfile.built_in()
which allows the user to look up
a built-in profile by string name instead of haviing to load the function in a priori.
Creating a Radial Profile#
If you want to create your own radial profile object, the process is extremely easy. All you have to do is build the class from a function as so
from cluster_generator.radial_profiles import constant_profile, RadialProfile
new_profile = lambda x,a,b: x*a*b
prof = RadialProfile(new_profile,name="My Random Profile")
If your goal is to contribute a radial profile to the code permanently, we request that you use the following template. All radial profiles
should be placed directly into the cluster_generator/radial_profiles.py
file.
def your_function_here(x,a,b,*args):
"""
Radial Profile from <insert citation here> representing ... (give explanation).
Parameters
----------
a: float
Desc.
b: float
Desc
< Complete the doc string >
Return
------
float
References
----------
.. [] --> Your reference here.
"""
# Define your function here
return "<The value of the function>"
Once you have created the custom function, you need only add it to the radial_profiles.RadialProfile
class’s
built_in
profile with the appropriate details.