skais_mapper.generate
Generate maps from simulations.
Functions:
Name | Description |
---|---|
map_TNG_galaxies |
Generate any number of maps from an IllustrisTNG snapshot(s). |
map_TNG_sample |
Project a subfind ID from an IllstrisTNG snapshot. |
run |
Main routine for generating any number of maps from a simulation snapshot(s).. |
map_TNG_galaxies
map_TNG_galaxies(
snapshots: list[int],
gids: int | Iterable[int],
groups: list[str] | None = None,
output: str | None = None,
src_dir: str | None = None,
sim_type: str = "illustris/tng50-1",
csv_file: str | Path | None = None,
part_max: int | None = None,
part_min: int | None = 20000,
retries: int | None = None,
subfind_limit: int | None = 15000,
grid_size: int = 512,
rotations: np.ndarray | None = None,
random_rotations: bool = True,
rng_seed: int = 42,
dry_run: bool = False,
verbose: bool = True,
)
Generate any number of maps from an IllustrisTNG snapshot(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
snapshots
|
list[int]
|
Snapshots number of the IllustrisTNG run. |
required |
gids
|
int | Iterable[int]
|
Subfind IDs, i.e. galaxies, from which to generate maps. |
required |
groups
|
list[str] | None
|
Galaxy properties to map, e.g. star, gas, or dm. |
None
|
output
|
str | None
|
Output filename. Can have format fields '{}' for group and snapshot. |
None
|
src_dir
|
str | None
|
Path to the root of the simulation snapshots. |
None
|
sim_type
|
str
|
Simulation type (should correspond to the subpath in |
'illustris/tng50-1'
|
csv_file
|
str | Path | None
|
Path the the CSV file used for logging supplemental information. |
None
|
part_max
|
int | None
|
Maximum number of particles to use for map generation. |
None
|
part_min
|
int | None
|
Minimum number of particles to use for map generation. |
20000
|
retries
|
int | None
|
If not None, sets the maximum number of replacement candidates for skipped groups. |
None
|
subfind_limit
|
int | None
|
If not None, sets the maximum subfind ID allowed as replacement. |
15000
|
grid_size
|
int
|
The size of the maps/images. Default: 512. |
512
|
rotations
|
np.ndarray | None
|
List of angle pairs (theta, phi) per rotation for each subfind ID; e.g. for 4 separate rotations per subfind ID, its shape is (len(gids), 4, 2). |
None
|
random_rotations
|
bool
|
If True, use random rotations (2 per subfind ID) to augment the dataset. |
True
|
rng_seed
|
int
|
Random number seed. |
42
|
dry_run
|
bool
|
If True, nothing is saved and expensive computation is skipped. |
False
|
verbose
|
bool
|
If True, print status updates to command line. |
True
|
Source code in skais_mapper/generate.py
249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
map_TNG_sample
map_TNG_sample(
obj: TNGGalaxy,
gid: int,
group: str = "gas",
projected_unit: au.Unit = None,
cmap: Colormap | None = None,
hdf5_file: str | Path | None = None,
hdf5_save: bool = True,
npy_save: bool = False,
png_save: bool = False,
subdir_save: bool = False,
grid_size: int = 512,
fh: float = 3,
rot: list[float] | tuple[float, float] | None = None,
xaxis: int = 0,
yaxis: int = 1,
periodic: bool = False,
rng_seed: int = 42,
flag_lim: float = 0,
flag_N: int = 64,
post_hook: Callable | None = None,
dry_run: bool = False,
verbose: bool = True,
)
Project a subfind ID from an IllstrisTNG snapshot.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
TNGGalaxy
|
Instance at a set snapshot, pointing at set subfind ID. |
required |
gid
|
int
|
Galaxy/halo index. |
required |
group
|
str
|
Galaxy property of the map, one of [gas,star,gas,hi,hi/21cm,temp,bfield]. |
'gas'
|
projected_unit
|
au.Unit
|
Units in which the map is to be projected. |
None
|
cmap
|
Colormap | None
|
Colormap for map plot. |
None
|
hdf5_file
|
str | Path | None
|
Basename of the HDF5 file. |
None
|
hdf5_save
|
bool
|
If True, save map to HDF5 file. |
True
|
npy_save
|
bool
|
If True, save map as numpy binary files. |
False
|
png_save
|
bool
|
If True, save map plot as PNG file. |
False
|
subdir_save
|
bool
|
If True, saves numpy binary and PNG files in corresponding subdirectories. |
False
|
grid_size
|
int
|
The size of the maps/images. Default: 512. |
512
|
fh
|
float
|
Expansion factor for the SPH particle radii. |
3
|
rot
|
list[float] | tuple[float, float] | None
|
Angles by which the sample is rotated before projection. |
None
|
xaxis
|
int
|
Projection axis for x. |
0
|
yaxis
|
int
|
Projection axis for y. |
1
|
periodic
|
bool
|
Use periodic boundary conditions for the projection (for metadata). |
False
|
rng_seed
|
int
|
Seed for the random number generation. |
42
|
flag_lim
|
float
|
Flag the map in the metadata if N pixel values fall below the limit. |
0
|
flag_N
|
int
|
The number of pixels before an image is flagged. |
64
|
post_hook
|
Callable | None
|
Post projection callback function to, e.g., rescale the map. |
None
|
dry_run
|
bool
|
If True, nothing is saved and expensive computation is skipped. |
False
|
verbose
|
bool
|
If True, print status updates to command line. |
True
|
Source code in skais_mapper/generate.py
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 85 86 87 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 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 |
|
run
run(cfg: DictConfig | dict)
Main routine for generating any number of maps from a simulation snapshot(s)..
Source code in skais_mapper/generate.py
457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 |
|