A few imports :
In [10]:
Copied!
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from astropy.io import fits
import jax.numpy as jnp
import numpy as np
import cmasher as cmr
import jax.random as random
from xifu_cluster_sim.xifu_config import XIFU_Config
from xifu_cluster_sim.cluster_cube import ClusterCube
import matplotlib.pyplot as plt
import matplotlib.colors as colors
from astropy.io import fits
import jax.numpy as jnp
import numpy as np
import cmasher as cmr
import jax.random as random
from xifu_cluster_sim.xifu_config import XIFU_Config
from xifu_cluster_sim.cluster_cube import ClusterCube
In [2]:
Copied!
cluster = ClusterCube()
cluster = ClusterCube()
Create the cubes of cluster properties¶
The properties are the ones used for a bapec emission model :
- norm
- temperature
- abundance
- redshift (cluster + gaussian random field)
In [3]:
Copied!
cluster.create_density_cube()
cluster.create_norm_cube()
cluster.create_kT_cube()
cluster.create_Z_cube()
cluster.create_density_cube()
cluster.create_norm_cube()
cluster.create_kT_cube()
cluster.create_Z_cube()
For the velocity, we need a random key.
In [5]:
Copied!
rng_key = random.PRNGKey(42)
cluster.create_velocity_cube(rng_key)
rng_key = random.PRNGKey(42)
cluster.create_velocity_cube(rng_key)
Convert the velocity to redshift values, using the cluster redshift (set at 0.1 as default)
In [6]:
Copied!
cluster.convert_velocity_to_redshift()
cluster.convert_velocity_to_redshift()
Plot properties¶
In [12]:
Copied!
summed_norm = cluster.norm.sum(axis = -1)
plt.imshow(summed_norm,
cmap = cmr.ember,
norm = colors.LogNorm(vmin=summed_norm.min(),
vmax=summed_norm.max()))
plt.colorbar(label = 'Summed norm')
summed_norm = cluster.norm.sum(axis = -1)
plt.imshow(summed_norm,
cmap = cmr.ember,
norm = colors.LogNorm(vmin=summed_norm.min(),
vmax=summed_norm.max()))
plt.colorbar(label = 'Summed norm')
Out[12]:
<matplotlib.colorbar.Colorbar at 0x1544e2b57e20>
In [22]:
Copied!
mean_kT = cluster.kT_cube.mean(axis = -1)
plt.imshow(mean_kT,
cmap = cmr.ember)
plt.colorbar(label = 'Mean temperature [keV]')
mean_kT = cluster.kT_cube.mean(axis = -1)
plt.imshow(mean_kT,
cmap = cmr.ember)
plt.colorbar(label = 'Mean temperature [keV]')
Out[22]:
<matplotlib.colorbar.Colorbar at 0x1544e2b29810>
In [17]:
Copied!
mean_Z = cluster.Z_cube.mean(axis = -1)
plt.imshow(mean_Z,
cmap = cmr.ember)
plt.colorbar(label = 'Mean abundance')
mean_Z = cluster.Z_cube.mean(axis = -1)
plt.imshow(mean_Z,
cmap = cmr.ember)
plt.colorbar(label = 'Mean abundance')
Out[17]:
<matplotlib.colorbar.Colorbar at 0x1544e28a2e00>
In [21]:
Copied!
mean_v = cluster.v_cube.mean(axis = -1)
plt.imshow(mean_v,
cmap = cmr.iceburn)
plt.colorbar(label = 'Mean velocity [km/s]')
mean_v = cluster.v_cube.mean(axis = -1)
plt.imshow(mean_v,
cmap = cmr.iceburn)
plt.colorbar(label = 'Mean velocity [km/s]')
Out[21]:
<matplotlib.colorbar.Colorbar at 0x1544f314f0a0>
In [ ]:
Copied!