Binning
binning
¶
LoadBinning
¶
Get the different arrays used for a simulation instance from a pickle binning as created by xifusim. The count map is needed for returning the count_weighted barycentre of each bin.
Source code in src/xifu_cluster_sim/binning.py
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
__call__()
¶
Loads the binning
Returns:
| Name | Type | Description |
|---|---|---|
X_pixels |
array
|
Array of x coordinate of each pixel on the xifusim images |
Y_pixels |
array
|
Array of y coordinate of each pixel on the xifusim images |
bin_num_pix |
array
|
Array of the bin number of each pixel |
nb_bins |
int
|
Number of bins |
xBar_bins |
array
|
Arrays of the count-wieghted barycenters, x coordinate |
yBar_bins |
array
|
Arrays of the count-wieghted barycenters, y coordinate |
bin_nb_map |
array
|
Map of the bin numbers (mainly used as a sanity check) |
Source code in src/xifu_cluster_sim/binning.py
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 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | |
__init__(shape=(360, 360), binning_file='/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_region_200/region_files/19p_region_dict.p', count_map_file='/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_count_image.fits')
¶
Initialize the loading
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple
|
Shape of the full image of the cluster that is used for the binning |
(360, 360)
|
binning_file
|
str
|
Path to the pickle file |
'/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_region_200/region_files/19p_region_dict.p'
|
count_map_file
|
str
|
Path to the count map used for binning |
'/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_count_image.fits'
|
Source code in src/xifu_cluster_sim/binning.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
MakeBinning
¶
Make a Voronoi binning of the count map
Source code in src/xifu_cluster_sim/binning.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |
__init__(shape=(360, 360), binning_file='/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_region_200/region_files/19p_region_dict.p', count_map_file='/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_count_image.fits', count_map=None, xifu_config=XIFU_Config())
¶
Initialize the loading
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
shape
|
tuple
|
Shape of the full image of the cluster that is used for the binning |
(360, 360)
|
binning_file
|
str
|
Path to the pickle file that will be saved |
'/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_region_200/region_files/19p_region_dict.p'
|
count_map_file
|
str
|
Path to the count map used for binning, loaded if count map not directly given |
'/xifu/home/mola/Turbu_300kpc_mosaics/repeat10_125ks/19p_count_image.fits'
|
count_map
|
array
|
Count map |
None
|
xifu_config
|
XIFU_Config
|
Instance of X-IFU configuration |
XIFU_Config()
|
Source code in src/xifu_cluster_sim/binning.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
compute_voronoi_binmap(x_offsets, y_offsets, save_dict=False, pix2xy_file='/xifu/home/mola/xifu_cluster_sim/data/pix2xy_newxifu.p', snr=200, voronoi_binning_quiet=True)
¶
Computes a Voronoi binning
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x_offset
|
int
|
Offset in x, if binning not centered on full image |
required |
y_offset
|
int
|
Offset in y, if binning not centered on full image |
required |
save_dict
|
bool
|
Whether to save the created binning to a pickle file |
False
|
pix2xy_file
|
str
|
Path to the pickle file containing the conversion of pixids vs position on array |
'/xifu/home/mola/xifu_cluster_sim/data/pix2xy_newxifu.p'
|
snr
|
int
|
Signal-to-noise ratio to use for binning |
200
|
voronoi_binning_quiet
|
bool
|
Whether to shut off outputs of the voronoi binning which can be verbous |
True
|
Returns:
| Name | Type | Description |
|---|---|---|
X_pixels |
array
|
Array of x coordinate of each pixel on the xifusim images |
Y_pixels |
array
|
Array of y coordinate of each pixel on the xifusim images |
bin_num_pix |
array
|
Array of the bin number of each pixel |
nb_bins |
int
|
Number of bins |
xBar_bins |
array
|
Arrays of the count-wieghted barycenters, x coordinate |
yBar_bins |
array
|
Arrays of the count-wieghted barycenters, y coordinate |
bin_nb_map |
array
|
Map of the bin numbers (mainly used as a sanity check) |
Source code in src/xifu_cluster_sim/binning.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | |