simulation
xsb_fluc.simulation.grid
¶
FourierGrid3D
¶
The equivalent of a Spatial grid in Fourier space
Source code in src/xsb_fluc/simulation/grid.py
59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
|
__init__(spatial_grid)
¶
Constructor of a FourierGrid3D object as the dual of a SpatialGrid3D
Source code in src/xsb_fluc/simulation/grid.py
64 65 66 67 68 69 70 71 72 73 74 75 |
|
SpatialGrid3D
¶
Helper function to define a spatial grid to simulate a 3D cluster
Source code in src/xsb_fluc/simulation/grid.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
__init__(pixsize=2.0 / 1000.0, shape=(100, 100), crop_r_500=5.0)
¶
Constructor for SpatialGrid3D.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pixsize
|
float
|
Size of the pixel in \(R_{500}\) units. |
2.0 / 1000.0
|
shape
|
tuple
|
Shape of the cube on the sky. |
(100, 100)
|
crop_r_500
|
float
|
Size along the line of sight in \(\pm R_{500}\). |
5.0
|
Source code in src/xsb_fluc/simulation/grid.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
|
from_data(data, crop_r_500=5.0, pixsize=None)
classmethod
¶
Constructor for SpatialGrid3D using a Cluster object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
crop_r_500
|
size along the line of sight. |
5.0
|
|
pixsize
|
should be None since it is read from the Cluster |
None
|
Source code in src/xsb_fluc/simulation/grid.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
xsb_fluc.simulation.cube
¶
EmissivityCube
¶
Bases: Module
Compute an emissivity cube for a given cluster. Used as a part of simulations.
Source code in src/xsb_fluc/simulation/cube.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|
__call__()
¶
Return the emissivity cube.
Source code in src/xsb_fluc/simulation/cube.py
32 33 34 35 36 37 38 39 40 41 |
|
__init__(data)
¶
Constructor for EmissivityCube using a Cluster object
Source code in src/xsb_fluc/simulation/cube.py
19 20 21 22 23 24 25 26 27 28 29 30 |
|
FluctuationCube
¶
Bases: Module
Compute a fluctuation cube for a given cluster. The density fluctuations are computed assuming a Gaussian Random Field defined with a turbulent power spectrum.
Source code in src/xsb_fluc/simulation/cube.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
|
__call__()
¶
Return the fluctuation cube.
Source code in src/xsb_fluc/simulation/cube.py
61 62 63 64 65 66 67 68 69 70 71 72 |
|
__init__(data)
¶
Constructor for FluctuationCube using a Cluster object
Source code in src/xsb_fluc/simulation/cube.py
50 51 52 53 54 55 56 57 58 59 |
|
xsb_fluc.simulation.mexican_hat
¶
MexicanHat
¶
Bases: Module
Mexican Hat filter for the power spectrum, using the implementation of Arévalo et al. 2012.
Source code in src/xsb_fluc/simulation/mexican_hat.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
__call__(img, scale)
¶
Computes the Mexican Hat filter for a given scale.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
img
|
ndarray
|
Image to filter. |
required |
scale
|
float
|
Scale of the filter. |
required |
Source code in src/xsb_fluc/simulation/mexican_hat.py
94 95 96 97 98 99 100 101 102 103 104 105 106 |
|
__init__(data, mask=None)
¶
Constructor for the MexicanHat class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Cluster
|
Cluster object containing the data. |
required |
mask
|
ndarray
|
Mask to apply to the data. |
None
|
Note
The PowerSpectrum
class is a Cluster
oriented wrapper around this class.
Source code in src/xsb_fluc/simulation/mexican_hat.py
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
MexicanHatMask
¶
Bases: Module
Auxiliary class for the MexicanHat class. Handle the convolution in Fourier space, the padding, etc.
Source code in src/xsb_fluc/simulation/mexican_hat.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
|
xsb_fluc.simulation.power_spectrum
¶
PowerSpectrum
¶
Bases: Module
Compute the power spectrum using the Mexican Hat filter for Cluster
data.
Source code in src/xsb_fluc/simulation/power_spectrum.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
__call__(image, scales)
¶
Computes the power spectrum for a given image and scales.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
image
|
ndarray
|
Image to compute the power spectrum of. |
required |
scales
|
ndarray
|
Scales to compute the power spectrum at. |
required |
Source code in src/xsb_fluc/simulation/power_spectrum.py
22 23 24 25 26 27 28 29 30 31 |
|
__init__(data, mask=None)
¶
Constructor for the PowerSpectrum class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
data
|
Cluster
|
Cluster object containing the data. |
required |
mask
|
ndarray
|
Mask to apply to the data. |
None
|
Source code in src/xsb_fluc/simulation/power_spectrum.py
11 12 13 14 15 16 17 18 19 20 |
|