AREPO Processing
iris.arepo_processing
AREPO processing framework and data pipeline.
Manages conversion of AREPO simulation snapshots into data tensors
and associated datasets for model training, testing, and visualization.
Contains all core data pipeline logic, but MPI process coordination
for dataset writing is separated into arepo_processing_write
so that read-only features can be used without loading MPI modules on an HPC environment.
Import this module if you only need to read datasets
(e.g. for model training). Import arepo_processing_write
if writing is required, which will trigger an import
of mpi4py.
Attributes:
| Name | Type | Description |
|---|---|---|
CUPY_ENABLED |
bool
|
If |
Dataset
Bases: Dataset
The base class for all finite, non-concatenated datasets.
Extended by StandardDataset
and PreObservedDataset.
Use pre-observed datasets for all model training, as they store
only top-down density and lv observations on disk.
Use standard datasets only when retaining other tensor information is required.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
read_only |
bool
|
If True, prevents writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of tensors (or pre-observed pairs) in the dataset. |
training |
Subset
|
Random subset used for |
validation |
Subset
|
Random subset used for |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory on disk at which to establish the Dataset.
If a readable |
required |
hyper
|
Hyper | None
|
A |
required |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
read_only
|
bool
|
Sets |
False
|
seed
|
int
|
Seed for the random number generator used for deterministically random sampling of
|
1216
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Source code in iris/arepo_processing.py
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 247 248 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 455 456 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 499 500 501 502 | |
__len__()
__getitem__(item)
Gets an indexed entry of the Dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
int
|
The index of the item to fetch. |
required |
Returns:
| Type | Description |
|---|---|
Tensor | tuple[Tensor, Tensor]
|
A physical tensor or pre-observed pair. |
Source code in iris/arepo_processing.py
_load()
Attempts to load the Dataset from self.path.
If a readable Dataset already exists at the directory,
will open the existing dataset for extension. If no Hyper
object was provided to Dataset during instantiation,
will adopt the Hyper read from the disk. Otherwise, will retain
Hyper provided during instantiation, but will
_copy_units from the Hyper
on disk. If no readable Dataset exists at the directory,
will call _make if not
self.read_only or raise a RuntimeError otherwise.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no readable |
Source code in iris/arepo_processing.py
save()
Saves Dataset attributes to the disk.
Writes self.hyper, self.index, and cardinality to human-readable JSON files at
self.path. The index and cardinality attributes are combined into a single
attributes.json, while hyper is stored as its own hyper.json.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
Source code in iris/arepo_processing.py
_copy_units(hyper)
Copies units to self.hyper attribute from an external Hyper object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyper
|
Hyper
|
The hyperparameters object from which to copy units. |
required |
Source code in iris/arepo_processing.py
take_units(hyper)
In addition to copying units from an external
Hyper object, will also compute conversions from processing units
into IRIS units for
units normalization post-processing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyper
|
Hyper
|
The hyperparameters object from which to take units. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
A bool value indicating whether normalization is required since IRIS units are different from processing units. |
Source code in iris/arepo_processing.py
_make()
Attempts to make a new Dataset directory at self.path.
If no directory exists at self.path, will make the new
directory. Otherwise, will search all paths path + f'_{n} for n in range(1, 99) for
an available directory path. Will update self.path to the new path.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
RuntimeError
|
If no available path is found. |
Source code in iris/arepo_processing.py
shuffle()
make_training_and_validation_dataloaders(cpus_per_gpu)
Make DataLoader objects for training and validation datasets.
Makes torch.utils.data.DataLoader and torch.utils.data.distributed.DistributedSampler
objects for self.training and self.validation. The DataLoader class
allows data streaming such that only a manageable collection of data batches is loaded
into memory at any given time, as opposed to loading the entire dataset into memory at once.
(Even memory-optimized pre-observed datasets
may occupy 100s of GiBs at scale.) Assigns all excess CPU processes as DataLoader workers.
These workers load tensors from the disk onto the CPU asynchronously while each primary
torchrun GPU manager process executes the main training loop, to include forward
and backward passes, step computations, and stats logging. In practice, loading time
from disk to CPU is the primary compute bottleneck during training--not forwards/backwards
pass computation, so allocating extra worker processes via SLURM is highly recommended
even if training on only one GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpus_per_gpu
|
int
|
The number of CPU processes per GPU. Used to compute
|
required |
Returns:
| Type | Description |
|---|---|
tuple[DistributedSampler, DataLoader, DistributedSampler, DataLoader]
|
A tuple of:
|
Source code in iris/arepo_processing.py
make_test_dataloader(cpus_per_gpu)
Make DataLoader objects for test dataset.
Makes a single torch.utils.data.DataLoader and torch.utils.data.distributed.DistributedSampler
objects for the complete Dataset. The DataLoader class
allows data streaming such that only a manageable collection of data batches is loaded
into memory at any given time, as opposed to loading the entire dataset into memory at once.
(Even memory-optimized pre-observed datasets
may occupy 100s of GiBs at scale.) Assigns all excess CPU processes as DataLoader workers.
These workers load tensors from the disk onto the CPU asynchronously while each primary
torchrun GPU manager process executes the main test computations, to include forward pass,
loss computation, and stats logging. In practice, loading time from disk to CPU is the
primary compute bottleneck during testing--not forwards pass computation, so allocating
extra worker processes via SLURM is highly recommended even if testing on only one GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpus_per_gpu
|
int
|
The number of CPU processes per GPU. Used to compute
|
required |
Returns:
| Type | Description |
|---|---|
tuple[DistributedSampler, DataLoader]
|
A tuple of:
|
Source code in iris/arepo_processing.py
ConcatDataset
Bases: ConcatDataset
Allows concatenation of Dataset objects.
Will automatically unify multiple Dataset objects
into a single torch.utils.data.ConcatDataset for training or testing. Works with
either StandardDataset objects or
PreObservedDataset objects,
but assumes all constituent datasets are of the same type. Automatically handles
units conversion of all datasets into the units of the primary (index-0) dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
from_type |
type[Dataset]
|
Type of the primary (index-0) dataset
(e.g. |
hyper |
Hyper
|
Hyperparameters object. |
training |
Subset
|
Random subset used for
|
validation |
Subset
|
Random subset used for
|
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
datasets
|
Sequence[Dataset]
|
The |
required |
seed
|
int
|
Seed for the random number generator used for deterministically random sampling of
|
1216
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
Source code in iris/arepo_processing.py
505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 | |
make_training_and_validation_dataloaders(cpus_per_gpu)
Make DataLoader objects for training and validation datasets.
Makes torch.utils.data.DataLoader and torch.utils.data.distributed.DistributedSampler
objects for self.training and self.validation. The DataLoader class
allows data streaming such that only a manageable collection of data batches is loaded
into memory at any given time, as opposed to loading the entire dataset into memory at once.
(Even memory-optimized pre-observed datasets
may occupy 100s of GiBs at scale.) Assigns all excess CPU processes as DataLoader workers.
These workers load tensors from the disk onto the CPU asynchronously while each primary
torchrun GPU manager process executes the main training loop, to include forward
and backward passes, step computations, and stats logging. In practice, loading time
from disk to CPU is the primary compute bottleneck during training--not forwards/backwards
pass computation, so allocating extra worker processes via SLURM is highly recommended
even if training on only one GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpus_per_gpu
|
int
|
The number of CPU processes per GPU. Used to compute
|
required |
Returns:
| Type | Description |
|---|---|
tuple[DistributedSampler, DataLoader, DistributedSampler, DataLoader]
|
A tuple of:
|
Source code in iris/arepo_processing.py
make_test_dataloader(cpus_per_gpu)
Make DataLoader objects for test dataset.
Makes a single torch.utils.data.DataLoader and torch.utils.data.distributed.DistributedSampler
objects for the complete ConcatDataset. The DataLoader class
allows data streaming such that only a manageable collection of data batches is loaded
into memory at any given time, as opposed to loading the entire dataset into memory at once.
(Even memory-optimized pre-observed datasets
may occupy 100s of GiBs at scale.) Assigns all excess CPU processes as DataLoader workers.
These workers load tensors from the disk onto the CPU asynchronously while each primary
torchrun GPU manager process executes the main test computations, to include forward pass,
loss computation, and stats logging. In practice, loading time from disk to CPU is the
primary compute bottleneck during testing--not forwards pass computation, so allocating
extra worker processes via SLURM is highly recommended even if testing on only one GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpus_per_gpu
|
int
|
The number of CPU processes per GPU. Used to compute
|
required |
Returns:
| Type | Description |
|---|---|
tuple[DistributedSampler, DataLoader]
|
A tuple of:
|
Source code in iris/arepo_processing.py
InfiniteSet
Bases: IterableDataset
An infinite iterable over a Dataset
or ConcatDataset.
Will randomly and infinitely iterate over a base Dataset
or ConcatDataset. Used as the raw
torch.utils.data.IterableDataset for InfiniteDataset
as well as InfiniteDataset.training and InfiniteDataset.validation subsets.
Attributes:
| Name | Type | Description |
|---|---|---|
finite_set |
Dataset | ConcatDataset
|
The base |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
finite_set
|
Dataset | ConcatDataset
|
Sets |
required |
Source code in iris/arepo_processing.py
__iter__()
Infinitely yields random entries from the self.finite_set.
Automatically handles worker seeding using torch.utils.data.get_worker_info()
to ensure unique randomness when used with multiple DataLoader workers.
Yields:
| Type | Description |
|---|---|
Tensor | tuple[Tensor, Tensor]
|
A single physical tensor or pre-observed pair. |
Source code in iris/arepo_processing.py
InfiniteDataset
Bases: InfiniteSet
An infinitely iterable dataset used for adding litter during training or testing.
Constructed via Reader. See
train_reverter for notes on using litter.
Attributes:
| Name | Type | Description |
|---|---|---|
finite_set |
Dataset | ConcatDataset
|
The base |
from_type |
type[Dataset]
|
Type or |
hyper |
Hyper
|
Hyperparameters object. |
units_corrected_finite_dataset |
UnitsCorrectedStandardDataset | UnitsCorrectedSyntheticallyObservedDataset | UnitsCorrectedSimplyObservedDataset
|
The |
training |
InfiniteSet
|
Random subset of |
validation |
InfiniteSet | None
|
Random subset of |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
finite_dataset
|
Dataset | ConcatDataset
|
The finite |
required |
units_dataset
|
Dataset | ConcatDataset
|
Yields all data in these units. |
required |
seed
|
int
|
Seed for the random number generator used for deterministically random sampling of
|
1216
|
Raises:
| Type | Description |
|---|---|
TypeError
|
If |
Source code in iris/arepo_processing.py
717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 | |
make_infinite_training_validation_dataloaders(cpus_per_gpu)
Make DataLoader objects for training and validation datasets.
Makes torch.utils.data.DataLoader objects for
self.training and self.validation. Does not make
torch.utils.data.distributed.DistributedSampler objects, since data sampling is
infinite and random (uniquely per distributed process, as guaranteed by the seeding
strategy in __iter__). The DataLoader class
allows data streaming such that only a manageable collection of data batches is loaded
into memory at any given time, as opposed to loading the entire finite dataset into memory at once.
(Even memory-optimized pre-observed datasets
may occupy 100s of GiBs at scale.) Assigns all excess CPU processes as DataLoader workers.
These workers load tensors from the disk onto the CPU asynchronously while each primary
torchrun GPU manager process executes the main training loop, to include forward
and backward passes, step computations, and stats logging. In practice, loading time
from disk to CPU is the primary compute bottleneck during training--not forwards/backwards
pass computation, so allocating extra worker processes via SLURM is highly recommended
even if training on only one GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpus_per_gpu
|
int
|
The number of CPU processes per GPU. Used to compute
|
required |
Returns:
| Type | Description |
|---|---|
tuple[DataLoader, DataLoader]
|
A tuple of:
|
Source code in iris/arepo_processing.py
make_infinite_test_dataloader(cpus_per_gpu)
Make DataLoader objects for test dataset.
Makes a single torch.utils.data.DataLoader object for infinite iteration over the complete
self.units_corrected_finite_dataset. Does not make a torch.utils.data.distributed.DistributedSampler
object, since data sampling is infinite and random (uniquely per distributed process, as guaranteed by
the seeding strategy in __iter__). The DataLoader class
allows data streaming such that only a manageable collection of data batches is loaded
into memory at any given time, as opposed to loading the entire dataset into memory at once.
(Even memory-optimized pre-observed datasets
may occupy 100s of GiBs at scale.) Assigns all excess CPU processes as DataLoader workers.
These workers load tensors from the disk onto the CPU asynchronously while each primary
torchrun GPU manager process executes the main test computations, to include forward pass,
loss computation, and stats logging. In practice, loading time from disk to CPU is the
primary compute bottleneck during testing--not forwards pass computation, so allocating
extra worker processes via SLURM is highly recommended even if testing on only one GPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cpus_per_gpu
|
int
|
The number of CPU processes per GPU. Used to compute
|
required |
Returns:
| Type | Description |
|---|---|
DataLoader
|
The |
Source code in iris/arepo_processing.py
observed_sample(observer=None)
Returns a sample of just observed litter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
observer
|
Observer | None
|
Used for computing an observation if |
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
Source code in iris/arepo_processing.py
UnitsCorrectedDataset
Bases: Dataset
Wraps a Dataset or
ConcatDataset and corrects units of fetched
tensors to those of units_dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset |
Dataset | ConcatDataset
|
The wrapped |
velocity_to_units |
float
|
The conversion factor into |
density_to_units |
float
|
The conversion factor into |
temperature_to_units |
float
|
The conversion factor into |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset | ConcatDataset
|
Sets |
required |
units_dataset
|
Dataset | ConcatDataset
|
The dataset from which to compute conversion factors. |
required |
Source code in iris/arepo_processing.py
UnitsCorrectedStandardDataset
Bases: UnitsCorrectedDataset
Wraps a StandardDataset or
ConcatDataset with from_type of
StandardDataset and corrects units
of fetched tensors to those of units_dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset |
StandardDataset | ConcatDataset
|
The wrapped |
velocity_to_units |
float
|
The conversion factor into |
density_to_units |
float
|
The conversion factor into |
temperature_to_units |
float
|
The conversion factor into |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
StandardDataset | ConcatDataset
|
Sets |
required |
units_dataset
|
StandardDataset | ConcatDataset
|
The dataset from which to compute conversion factors. |
required |
Source code in iris/arepo_processing.py
__getitem__(item)
Fetches an indexed physical tensor in the target units.
See StandardDataset for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
int
|
The tensor index. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
A physical tensor. |
Source code in iris/arepo_processing.py
UnitsCorrectedSyntheticallyObservedDataset
Bases: UnitsCorrectedDataset
Wraps a SyntheticallyObservedDataset or
ConcatDataset with from_type of
SyntheticallyObservedDataset
and corrects units of fetched tensors to those of units_dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset |
SyntheticallyObservedDataset | ConcatDataset
|
The wrapped
|
velocity_to_units |
float
|
The conversion factor into |
density_to_units |
float
|
The conversion factor into |
temperature_to_units |
float
|
The conversion factor into |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
SyntheticallyObservedDataset | ConcatDataset
|
Sets |
required |
units_dataset
|
SyntheticallyObservedDataset | ConcatDataset
|
The dataset from which to compute conversion factors. |
required |
Source code in iris/arepo_processing.py
__getitem__(item)
Fetches an indexed, synthetically observed pair in the target units.
See SyntheticallyObservedDataset for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
int
|
The pair index. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Tensor, Tensor]
|
A synthetically observed pair. |
Source code in iris/arepo_processing.py
UnitsCorrectedSimplyObservedDataset
Bases: UnitsCorrectedDataset
Wraps a SimplyObservedDataset or
ConcatDataset with from_type of
SimplyObservedDataset
and corrects units of fetched tensors to those of units_dataset.
Attributes:
| Name | Type | Description |
|---|---|---|
dataset |
SimplyObservedDataset | ConcatDataset
|
The wrapped
|
velocity_to_units |
float
|
The conversion factor into |
density_to_units |
float
|
The conversion factor into |
temperature_to_units |
float
|
The conversion factor into |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
SimplyObservedDataset | ConcatDataset
|
Sets |
required |
units_dataset
|
SimplyObservedDataset | ConcatDataset
|
The dataset from which to compute conversion factors. |
required |
Source code in iris/arepo_processing.py
__getitem__(item)
Fetches an indexed, simply observed pair in the target units.
See SimplyObservedDataset for details.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
item
|
int
|
The pair index. |
required |
Returns:
| Type | Description |
|---|---|
tuple[Tensor, Tensor]
|
A simply observed pair. |
Source code in iris/arepo_processing.py
DatasetParent
Bases: Dataset
A parent dataset established by the manager process of a
Writer into which
children instantiated by worker processes of a
Writer can be merged.
Exists for type-inheritance only. Used only in Writer mode.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of tensors (or pre-observed pairs) in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory on disk at which to establish the DatasetParent.
If a readable |
required |
hyper
|
Hyper | None
|
A |
required |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Source code in iris/arepo_processing.py
DatasetChild
Bases: Dataset
A child dataset established by a worker process of a
Writer that can be merged into the
parent instantiated by the manager process of a
Writer.
Only for merging into a DatasetParent
in Writer mode. Not saved to the disk as a readable
Dataset itself.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
name |
str
|
Name of the subdirectory belonging to |
parent_path |
str
|
Path of the subdirectory belonging to |
hyper |
Hyper | None
|
Hyperparameters object. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of tensors (or pre-observed pairs) in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sets |
required |
parent_path
|
str
|
Directory on disk of the parent dataset. Attempts to establish
the dataset at |
required |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Source code in iris/arepo_processing.py
1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 | |
_make()
Attempts to make a new DatasetChild directory at self.path.
If no directory exists at self.path, will make the new
directory. Otherwise, will search all paths path + f'_{n} for n in range(1, 99) for
an available directory path. Will update self.path
to the new path. Overrides Dataset._make because
DatasetChild also tracks
self.name attribute, which must be updated if self.path is updated.
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
RuntimeError
|
If no available path is found. |
Source code in iris/arepo_processing.py
StandardDataset
Bases: Dataset
A Dataset of physical tensors.
Stores physical tensors as NumPy (.np) files on disk and converts to PyTorch
tensors during fetching. Each tensor has element type np.float32 or torch.float32
(single-precision float). Storing the full physical tensor demands substantial disk space
and creates a substantial latency when loading a tensor from the disk into memory.
Use a PreObservedDataset instead
for Reverter training. See
make_physical_tensor
for details regarding the definition of a physical tensor.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
read_only |
bool
|
If True, prevents writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of tensors in the dataset. |
training |
Subset
|
Random subset used for |
validation |
Subset
|
Random subset used for |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory on disk at which to establish the Dataset.
If a readable |
required |
hyper
|
Hyper | None
|
A |
required |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
read_only
|
bool
|
Sets |
False
|
seed
|
int
|
Seed for the random number generator used for deterministically random sampling of
|
1216
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Source code in iris/arepo_processing.py
1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 | |
add_tensor(tensor, node_comm=None)
Writes a physical tensor to the disk, adds its path to
self.index, and increments self.cardinality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tensor
|
Tensor | ndarray
|
The physical tensor to be added. |
required |
node_comm
|
Intracomm | None
|
A node intracomm. Not used. Only included for type-agnostic call with
|
None
|
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If attempting to write a tensor to the disk when |
Source code in iris/arepo_processing.py
update_tensor(tensor, num)
Overwrites a physical tensor on the disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tensor
|
Tensor | ndarray
|
The physical tensor to be added. |
required |
num
|
int
|
The tensor index to overwrite. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If attempting to write a tensor to the disk when |
Source code in iris/arepo_processing.py
get_entry(num=None, tensor_index=None, numpy=False)
Gets a physical tensor from the disk.
A method specific to StandardDataset,
the helper called by __getitem__,
but with more options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num
|
int | None
|
The integer index of the tensor to get. Not required if |
None
|
tensor_index
|
str | None
|
The path on disk of the tensor to get. Not required if |
None
|
numpy
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Tensor | ndarray
|
The physical tensor. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If neither |
Source code in iris/arepo_processing.py
sample(n, numpy=False, validation=False, abnormal=False)
Gets a sample batch of physical tensors.
Randomly samples a specified number of physical tensors and returns them stacked along dim=0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of tensors to get. |
required |
numpy
|
bool
|
If |
False
|
validation
|
bool
|
If |
False
|
abnormal
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
Tensor | ndarray
|
The sample batch. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in iris/arepo_processing.py
calculate_iris_units()
Calculates standard conversion factors from SI units to IRIS units.
If no IRIS units are found in self.hyper, adopts the processing units specified in
self.hyper.writer_hyper as IRIS units.
Computes conversion factors from SI units to IRIS units. Unlike
SyntheticallyObservedDataset.calculate_iris_units
or SimplyObservedDataset.calculate_iris_units,
does not apply any normalization of units based on dataset statistics.
Returns:
| Type | Description |
|---|---|
bool
|
A |
Source code in iris/arepo_processing.py
spawn_parent(*args, **kwargs)
staticmethod
Spawns a new StandardDatasetParent.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
StandardDatasetParent
|
The new |
Source code in iris/arepo_processing.py
spawn_child(*args, **kwargs)
staticmethod
Spawns a new StandardDatasetChild.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
StandardDatasetChild
|
The new |
Source code in iris/arepo_processing.py
StandardDatasetParent
Bases: DatasetParent, StandardDataset
Extends both DatasetParent and
StandardDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of tensors (or pre-observed pairs) in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Directory on disk at which to establish the dataset.
If a readable |
required |
hyper
|
Hyper | None
|
A |
required |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Source code in iris/arepo_processing.py
merge(child)
Merges a child dataset (owned by a Writer worker)
into self (owned by the Writer manager).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
child
|
StandardDatasetChild
|
The dataset to merge into |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
Source code in iris/arepo_processing.py
StandardDatasetChild
Bases: DatasetChild, StandardDataset
Extends both DatasetChild and
StandardDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
name |
str
|
Name of the subdirectory within the |
parent_path |
str
|
Path of the subdirectory belonging to |
hyper |
Hyper | None
|
Hyperparameters object. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of tensors (or pre-observed pairs) in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sets |
required |
parent_path
|
str
|
Directory on disk of the parent dataset. Attempts to establish
the dataset at |
required |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Source code in iris/arepo_processing.py
1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 | |
normalize(hyper, node_comm, gpu_normalize)
Converts the dataset into IRIS units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyper
|
Hyper
|
The dataset from which to pull IRIS units. |
required |
node_comm
|
Intracomm
|
A node-wide MPI intracomm used to communicate with the GPU manager for that node. |
required |
gpu_normalize
|
bool
|
If |
required |
Source code in iris/arepo_processing.py
PreObservedDataset
Bases: Dataset
A Dataset of observed pairs.
Rather than storing the entire physical tensor on disk as in
StandardDataset, stores only a
top-down density image and an
observation computed from the original physical tensor.
Produces an order-of-magnitude savings in storage space on disk as well as in latency
loading from disk into memory. As such, is the primary dataset type that should be used
for storing large datasets and Reverter training. Is the
base class for
SyntheticallyObservedDataset and
SimplyObservedDataset.
Top-down density images and observations are stored as separate NumPy (.np) files
on disk, and are fetched as columnized, observed tuples of PyTorch tensors.
Each tensor has element type np.float32 or torch.float32 (single-precision float).
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
observer_kwargs |
dict
|
A |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
read_only |
bool
|
If True, prevents writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
training |
Subset
|
Random subset used for |
validation |
Subset
|
Random subset used for |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
read_only
|
Sets |
required | |
seed
|
Seed for the random number generator used for deterministically random sampling of
|
required | |
node_comm
|
Intracomm | None
|
An MPI intracomm used to communicate with the GPU manager if available. |
None
|
observer_kwargs
|
dict | None
|
A |
None
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 | |
_init_observer(node_comm)
Abstract method definition for initializing an observer. MPI node intracomm required for communication with GPU manager to enable GPU support.
_reduce_mean(ppv)
Applies a mean reduction of a PPV cube over the latitude dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ppv
|
Tensor
|
The PPV cube to reduce. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
A latitude-velocity (PV) mean observation. |
Source code in iris/arepo_processing.py
_reduce_max(ppv)
Applies a max reduction of a PPV cube over the latitude dimension.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ppv
|
Tensor
|
The PPV cube to reduce. |
required |
Returns:
| Type | Description |
|---|---|
Tensor
|
A latitude-velocity (PV) max observation. |
Source code in iris/arepo_processing.py
add_tensor(tensor, node_comm)
Computes an observed pair from a physical tensor, write the pair to the disk,
adds the pair of paths to self.index, and increments self.cardinality.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tensor
|
Tensor | ndarray
|
The physical tensor to be columnized/observed. |
required |
node_comm
|
Intracomm
|
An MPI node intracomm used to communicate with the GPU manager for GPU support during observation. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If attempting to write a tensor to the disk when |
RuntimeError
|
If |
Source code in iris/arepo_processing.py
1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 | |
update_entry(columnized, observed, num)
Overwrites an observed pair on the disk.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
columnized
|
Tensor | ndarray
|
The top-down density image to add. |
required |
observed
|
Tensor | ndarray
|
The observation to add. |
required |
num
|
int
|
The pair index to overwrite. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If attempting to write an observed pair to the disk when |
Source code in iris/arepo_processing.py
get_entry(num=None, tensor_indices=None, numpy=False)
Gets an observed pair from the disk.
A method specific to PreObservedDataset,
the helper called by __getitem__,
but with more options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
num
|
int | None
|
The integer index of the observed pair to get. Not required if |
None
|
tensor_indices
|
Sequence[str] | None
|
The paths on disk of the observed pair to get. Not required if |
None
|
numpy
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
tuple[Tensor, Tensor]
|
The observed pair, a tuple of |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If neither |
Source code in iris/arepo_processing.py
sample(n, numpy=False, validation=False, abnormal=False)
Gets sample batches of observed pairs.
Randomly samples a specified number of observed pairs. Returns a tuple columnized, observed,
where columnized and observed are each the respective samples stacked along dim=0.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
The number of tensors to get. |
required |
numpy
|
bool
|
If |
False
|
validation
|
bool
|
If |
False
|
abnormal
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
tuple[Tensor, Tensor]
|
The tuple of sample batches. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Source code in iris/arepo_processing.py
PreObservedDatasetParent
Bases: DatasetParent, PreObservedDataset
Extends both DatasetParent and
PreObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
Intracomm | None
|
An MPI intracomm used to communicate with the GPU manager if available. |
None
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
merge(child)
Merges a child dataset (owned by a Writer worker)
into self (owned by the Writer manager).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
child
|
PreObservedDatasetChild
|
The dataset to merge into |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If |
Source code in iris/arepo_processing.py
PreObservedDatasetChild
Bases: DatasetChild, PreObservedDataset
Extends both DatasetChild and
PreObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
name |
str
|
Name of the subdirectory within the |
parent_path |
str
|
Path of the subdirectory belonging to |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sets |
required |
parent_path
|
str
|
Directory on disk of the parent dataset. Attempts to establish
the dataset at |
required |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
SyntheticallyObservedDataset
Bases: PreObservedDataset
A PreObservedDataset of synthetically observed pairs.
Uses SyntheticObserver to compute true synthetic
observations of each physical tensor in the dataset. Contrast with
SimplyObservedDataset, which only computes
simple observations (density projections).
The primary dataset type for Reverter training.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
read_only |
bool
|
If True, prevents writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
training |
Subset
|
Random subset used for |
validation |
Subset
|
Random subset used for |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
read_only
|
Sets |
required | |
seed
|
Seed for the random number generator used for deterministically random sampling of
|
required | |
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 | |
_init_observer(node_comm=None)
Creates an IteratedSyntheticObserver
for processing of physical tensors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_comm
|
Intracomm | None
|
The node-wide MPI intracomm used to communicate with the GPU manager for GPU support. |
None
|
Source code in iris/arepo_processing.py
calculate_iris_units()
Calculates standard conversion factors from SI units to IRIS units.
If no IRIS units are found in self.hyper,
defines IRIS units by normalizing density and (brightness) temperature in processing units
according to a sample estimate (using Bessel's correction) of the global
standard deviations of these variables in the dataset. Normalization is
to make values optimal for Reverter training.
Standard deviations are computed from a random sample of
self.hyper.writer_hyper.unit_calculation_sample_size
observed pairs. Computes conversion factors from SI units to IRIS units.
Returns:
| Type | Description |
|---|---|
bool
|
A |
Source code in iris/arepo_processing.py
2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 | |
spawn_parent(*args, **kwargs)
staticmethod
Spawns a new SyntheticallyObservedDatasetParent.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
SyntheticallyObservedDatasetParent
|
The new |
Source code in iris/arepo_processing.py
spawn_child(*args, **kwargs)
staticmethod
Spawns a new SyntheticallyObservedDatasetChild.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
SyntheticallyObservedDatasetChild
|
The new |
Source code in iris/arepo_processing.py
SyntheticallyObservedDatasetParent
Bases: PreObservedDatasetParent, SyntheticallyObservedDataset
Extends both PreObservedDatasetParent and
SyntheticallyObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
SyntheticallyObservedDatasetChild
Bases: PreObservedDatasetChild, SyntheticallyObservedDataset
Extends both PreObservedDatasetChild and
SyntheticallyObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
name |
str
|
Name of the subdirectory within the
|
parent_path |
str
|
Path of the subdirectory belonging to
|
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sets |
required |
parent_path
|
str
|
Directory on disk of the parent dataset. Attempts to establish
the dataset at |
required |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 | |
normalize(hyper, node_comm, gpu_normalize)
Converts the dataset into IRIS units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyper
|
Hyper
|
The dataset from which to pull IRIS units. |
required |
node_comm
|
Intracomm
|
A node-wide MPI intracomm used to communicate with the GPU manager for that node. |
required |
gpu_normalize
|
bool
|
If |
required |
Source code in iris/arepo_processing.py
CPUBatchObservedDataset
Bases: SyntheticallyObservedDataset
A SyntheticallyObservedDataset
that uses CPU batching during observation.
Uses SyntheticObserver with cpu_batch=True
to compute synthetic observations of each physical tensor in the dataset.
Necessary if physical tensors are too large to fit on the GPU, e.g. for
full-cone observation.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
read_only |
bool
|
If True, prevents writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
training |
Subset
|
Random subset used for |
validation |
Subset
|
Random subset used for |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
read_only
|
Sets |
required | |
seed
|
Seed for the random number generator used for deterministically random sampling of
|
required | |
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 | |
_init_observer(node_comm=None)
Creates an IteratedSyntheticObserver
with cpu_batch=True for processing of physical tensors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_comm
|
Intracomm | None
|
The node-wide MPI intracomm used to communicate with the GPU manager for GPU support. |
None
|
Source code in iris/arepo_processing.py
add_tensor(tensor, node_comm)
Computes an observed pair from a physical tensor, write the pair to the disk,
adds the pair of paths to self.index, and increments self.cardinality.
Differs from PreObservedDataset.add_tensor
by not moving physical tensors to the GPU prior to calling self.observer
and by not precomputing input blur.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
tensor
|
Tensor | ndarray
|
The physical tensor to be columnized/observed. |
required |
node_comm
|
Intracomm
|
An MPI node intracomm used to communicate with the GPU manager for GPU support during observation. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If attempting to write a tensor to the disk when |
RuntimeError
|
If |
Source code in iris/arepo_processing.py
2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 | |
spawn_parent(*args, **kwargs)
staticmethod
Spawns a new CPUBatchObservedDatasetParent.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
CPUBatchObservedDatasetParent
|
The new |
Source code in iris/arepo_processing.py
spawn_child(*args, **kwargs)
staticmethod
Spawns a new CPUBatchObservedDatasetChild.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
CPUBatchObservedDatasetChild
|
The new |
Source code in iris/arepo_processing.py
CPUBatchObservedDatasetParent
Bases: PreObservedDatasetParent, CPUBatchObservedDataset
Extends both PreObservedDatasetParent and
CPUBatchObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
CPUBatchObservedDatasetChild
Bases: CPUBatchObservedDataset, SyntheticallyObservedDatasetChild
Extends both CPUBatchObservedDataset and
SyntheticallyObservedDatasetChild.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
name |
str
|
Name of the subdirectory within the
|
parent_path |
str
|
Path of the subdirectory belonging to
|
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sets |
required |
parent_path
|
str
|
Directory on disk of the parent dataset. Attempts to establish
the dataset at |
required |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
SimplyObservedDataset
Bases: PreObservedDataset
A PreObservedDataset of simply observed pairs.
Uses SimpleObserver to compute simple
observations (density projections) of each physical tensor in the dataset. Contrast with
SyntheticallyObservedDataset,
which computes full synthetic observations. Use to investigate the theoretical
information limit in predicting top-down density images from lv-reduced observations,
without the confounding effects of a true synthetic observation.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
read_only |
bool
|
If True, prevents writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
training |
Subset
|
Random subset used for |
validation |
Subset
|
Random subset used for |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
read_only
|
Sets |
required | |
seed
|
Seed for the random number generator used for deterministically random sampling of
|
required | |
node_comm
|
Intracomm | None
|
An MPI intracomm used to communicate with the GPU manager if available. |
None
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 | |
_init_observer(node_comm=None)
Creates an IteratedSyntheticObserver
for processing of physical tensors.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
node_comm
|
Intracomm | None
|
The node-wide MPI intracomm used to communicate with the GPU manager for GPU support. |
None
|
Source code in iris/arepo_processing.py
calculate_iris_units()
Calculates standard conversion factors from SI units to IRIS units.
If no IRIS units are found in self.hyper,
defines IRIS units by normalizing density and velocity-density in processing units
according to a sample estimate (using Bessel's correction) of the global
standard deviation in the dataset. Normalization is to make values optimal for
Reverter training. Standard deviations are computed
from a random sample of
self.hyper.writer_hyper.unit_calculation_sample_size
observed pairs. Computes conversion factors from SI units to IRIS units.
Returns:
| Type | Description |
|---|---|
bool
|
A |
Source code in iris/arepo_processing.py
2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 | |
spawn_parent(*args, **kwargs)
staticmethod
Spawns a new SimplyObservedDatasetParent.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
SimplyObservedDatasetParent
|
The new |
Source code in iris/arepo_processing.py
spawn_child(*args, **kwargs)
staticmethod
Spawns a new SimplyObservedDatasetChild.
Used in Writer to allow type-agnostic calls
from the base class type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
*args
|
any
|
Passed to |
()
|
**kwargs
|
any
|
Passed to |
{}
|
Returns:
| Type | Description |
|---|---|
SimplyObservedDatasetChild
|
The new |
Source code in iris/arepo_processing.py
SimplyObservedDatasetParent
Bases: PreObservedDatasetParent, SimplyObservedDataset
Extends both PreObservedDatasetParent and
SimplyObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Directory on disk at which to establish the Dataset.
If a readable |
required | |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
Intracomm | None
|
An MPI intracomm used to communicate with the GPU manager if available. |
None
|
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
SimplyObservedDatasetChild
Bases: PreObservedDatasetChild, SimplyObservedDataset
Extends both PreObservedDatasetChild and
SimplyObservedDataset.
Used during dataset writing only.
Attributes:
| Name | Type | Description |
|---|---|---|
path |
str
|
Path to the dataset location on disk. |
name |
str
|
Name of the subdirectory within the
|
parent_path |
str
|
Path of the subdirectory belonging to
|
hyper |
Hyper | None
|
Hyperparameters object. |
observer |
Observer | None
|
The observer applied to each physical tensor during processing. |
reduction |
Callable
|
The reduction function applied to a full observation (PPV cube) before writing to disk. |
index |
list
|
List of individual tensor paths. |
abnormal |
list
|
List of tensor paths that have yet to be normalized (units-corrected). |
cardinality |
int
|
Number of observed pairs in the dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Sets |
required |
parent_path
|
str
|
Directory on disk of the parent dataset. Attempts to establish
the dataset at |
required |
hyper
|
A |
required | |
*args
|
any
|
Catch-all for args passed by extending classes or to extended classes. |
()
|
node_comm
|
An MPI intracomm used to communicate with the GPU manager if available. |
required | |
**kwargs
|
any
|
Catch-all for keyword args passed by extending classes or to extended classes. |
{}
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If, when attempting to set |
Source code in iris/arepo_processing.py
2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 | |
normalize(hyper, node_comm, gpu_normalize)
Converts the dataset into IRIS units.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
hyper
|
Hyper
|
The dataset from which to pull IRIS units. |
required |
node_comm
|
Intracomm
|
A node-wide MPI intracomm used to communicate with the GPU manager for that node. |
required |
gpu_normalize
|
bool
|
If |
required |
Source code in iris/arepo_processing.py
Snapshot
An AREPO simulation snapshot.
Reads an AREPO simulation snapshot (in HDF5 file format). Automatically handles all value parsing/computation and units conversions. Applies any desired perturbations specified in hyperparameters. Computes physical tensors from the snapshot by interpolating the cell values of the AREPO Voronoi mesh over the IRIS spherical coordinate grid defined according to the observer origin.
Attributes:
| Name | Type | Description |
|---|---|---|
hyper |
Hyper
|
A hyperparameters object. |
path |
str
|
Path to the AREPO snapshot (HDF5 file) on disk. |
file |
File
|
The |
gpu_interpolate |
bool
|
Whether to use CuPy-enabled GPU support during interpolation of the
AREPO Voronoi mesh onto the IRIS spherical coordinate grid.
Is only set to true if |
galactic_center |
ndarray
|
The center of the snapshot in AREPO coordinates/AREPO units.
Set by |
num_particles |
int
|
The number of cell particles in the AREPO snapshot. |
positions |
ndarray
|
The positions of each cell particle in centered AREPO coordinates (converted to processing units). |
velocities |
ndarray
|
The velocities of each cell particle (converted to processing units). |
densities |
ndarray
|
The densities of each cell particle (converted to processing units). |
temperatures |
ndarray
|
The temperatures of each cell particle (converted to processing units). |
abundances_H2 |
ndarray
|
The \(\text{H}_2\) abundances of each cell particle, expressed as a fraction of total number density of H atoms. |
abundances_CO |
ndarray
|
The CO abundances of each cell particle, expressed as a fraction of total number density of H atoms. |
dust_temperatures |
ndarray
|
The dust temperatures of each cell particle (converted to processing units). |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Sets |
required |
hyper
|
Hyper
|
Sets |
required |
gpu_interpolate
|
bool
|
If |
True
|
Source code in iris/arepo_processing.py
2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 | |
_parse()
Parses the AREPO snapshot HDF5 file from the disk.
Source code in iris/arepo_processing.py
_get_arepo_center()
Finds the rotational center of the galactic disk in the AREPO snapshot by computing the center of the simulation box.
Source code in iris/arepo_processing.py
_get_particle_values()
Gets values of all cell particle attributes.
Sets self.positions, self.velocities, self.densities, self.temperatures,
self.abundances_H2, self.abundances_CO, and dust_temperatures.
If self.hyper.dataset_hyper.use_AREPO_abundances,
\(\text{H}_2\), \(\text{H}^+\), and CO abundances are adopted from AREPO. Otherwise, all H
is assumed to be \(\text{H}_2\) and CO abundance is set to 0.
Approximates gas temperatures from the internal energies recorded per cell in the AREPO snapshot via application of the Equipartition Theorem. For this calculation, treats the ISM as an ideal gas of atomic H, He, and molecular \(\text{H}_2\). Note that by default, the AREPO cell variable InternalEnergy is a function of translational kinetic energy only. This value does not model a separate rotational or vibrational kinetic energy. Therefore, this internal energy is distributed over only 3 (translational) degrees of freedom, even for diatomic \(\text{H}_2\).
Computation of the temperature by application of the Equipartition Theorem over this partial internal energy assuming a uniform 3 degrees of freedom thus yields precisely the kinetic temperature relevant in computing level balances via standard lookup tables and in computing thermal broadening. These are the two primary applications of gas temperature in IRIS. The only other application of temperature is if temperature is used in computing the molecular abundance of a particular spectral tracer. In this last case, it should simply be noted that the gas temperature recorded is the kinetic temperature.
Above self.hyper.observer_hyper.T_inf (if this value is not None),
temperature is set to np.inf, and emission/absorption are later ignored for
any such cell during observation. This prevents unreliable modeling of extremely hot,
bright gas cells in which tracers are expected to have thermally decomposed.
Additionally, because \(\text{H}^+\) collisions are not modeled during
computation of the level balance.
Source code in iris/arepo_processing.py
2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 | |
_apply_units_and_perturbations()
Converts cell particle values into processing units and applies perturbations
specified in self.hyper.
Processing units are defined in WriterHyper.
Perturbations include:
- Scale perturbations: Density-conserving length scaling according to a factor
set randomly within
self.hyper.writer_hyper.CMZ_scale_rangeor set toself.hyper.writer_hyper.CMZ_scale_factorifCMZ_scale_rangeisNone. Not applied if both areNone. - Density perturbations: Density-scaling according to a factor
set randomly within
self.hyper.writer_hyper.CMZ_density_rangeor set toself.hyper.writer_hyper.CMZ_density_factorifCMZ_density_rangeisNone. Not applied if both areNone. - Skew perturbations (experimental, not recommended): Random coordinate skews according to a factor
set randomly within
self.hyper.writer_hyper.CMZ_skew_rangeor set toself.hyper.writer_hyper.CMZ_skew_factorifCMZ_skew_rangeisNone. Not applied if both areNone.
Source code in iris/arepo_processing.py
3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 | |
_random_skew_matrix(CMZ_skew_factor)
Generates a random coordinate skew transformation matrix.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
CMZ_skew_factor
|
float
|
The skew factor. |
required |
Returns:
| Type | Description |
|---|---|
ndarray
|
The transformation matrix. |
Source code in iris/arepo_processing.py
make_physical_tensor(dataset, node_comm, theta)
Computes a physical tensor and adds it to a Dataset.
A "physical tensor" distills all information from an
AREPO snapshot necessary to compute a
top-down density image and either a full
synthetic observation or a
simple observation. Has dimensions
channel, r, lon, lat, where:
channel includes radial velocity, gas mass density, gas temperature,
\(\text{H}_2\) abundance per total number density of H atoms,
CO abundance per total number density of H atoms, and dust temperature;
r (radial distance from observer)
has size self.hyper.coordinate_hyper.r_steps;
lon (galactic longitude in the observer plane of sky)
has size self.hyper.coordinate_hyper.lon_steps;
and lat (galactic latitude in the observer plane of sky)
has size self.hyper.coordinate_hyper.lat_steps.
The IRIS spherical coordinate grid (r, lon, lat), over which the AREPO cell values
(specified on a Voronoi mesh) are interpolated, is computed over a spherical coordinate
system defined according to the observer origin. The angular coordinates lon, lat
are defined according to the same convention as galactic longitude and latitude.
The observer is located at self.hyper.coordinate_hyper.observer_radius (in parsecs, within the
perturbed units of length)
from self.galactic_center, at an
angle of theta + self.hyper.coordinate_hyper.theta_zero, as measured
counter-clockwise from the AREPO positive \(x\)-axis. The bounds of the grid are defined by
self.hyper.coordinate_hyper.r_min, self.hyper.coordinate_hyper.r_max,
self.hyper.coordinate_hyper.lon_min, self.hyper.coordinate_hyper.lon_max,
self.hyper.coordinate_hyper.lat_min, self.hyper.coordinate_hyper.lat_max.
If self.hyper.coordinate_hyper.jitter_r, a random deviation within
self.hyper.coordinate_hyper.jitter_r_min and
self.hyper.coordinate_hyper.jitter_r_max is added to observer_radius.
If self.hyper.coordinate_hyper.jitter_lon, a random deviation within
self.hyper.coordinate_hyper.jitter_lon_min and
self.hyper.coordinate_hyper.jitter_lon_max is added to the
longitude bounds lon_min, lon_max.
Longitude is also oriented by self.hyper.coordinate_hyper.spin_orientation.
If spin_orientation == 1, the snapshot is viewed right-side-up.
If spin_orientation == -1, the snapshot is viewed upside-down. This option is applied
because the Milky Way Galaxy rotates counter-clockwise with
respect to the standard galactic coordinate system, but AREPO simulations may
rotate clockwise, and so must be flipped upside down (not rotationally reversed)
to produce a Dataset of consistently defined
physical tensors, on which the Reverter can learn
inference behaviors that generalize to true observations.
The interpolation step
is computed on GPU with CuPy if self.gpu_interpolate,
or on CPU with SciPy otherwise, using a nearest-neighbor interpolation algorithm
in either case. If GPU interpolating, the interpolation will be
chunked into self.hyper.coordinate_hyper.r_pieces separate chunks
that each fit onto GPU memory. After computing the physical tensor,
this method calls the appropriate add_tensor method in the
Dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dataset
|
Dataset
|
The dataset into which to add the new physical tensor. |
required |
node_comm
|
Intracomm
|
An MPI node intracomm used to communicate with the GPU manager for GPU support. |
required |
theta
|
float
|
The angle, measured counter-clockwise from the AREPO \(x\)-axis,
of the ray pointing from the galactic center to the observer position
(up to an addition of |
required |
Source code in iris/arepo_processing.py
3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 | |
_prune_particles(r_min, r_max, lon_min, lon_max, lat_min, lat_max, observer_r, theta, positions, velocities, densities, temperatures, abundances_H2, abundances_CO, dust_temperatures)
Prunes particles outside specified bounds.
Does not convert all particle positions into spherical coordinates and prune exactly. Instead, inscribes the observational frustum in an AREPO coordinate prism and prunes all particles outside this prism.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r_min
|
float
|
The minimal |
required |
r_max
|
float
|
The maximal |
required |
lon_min
|
float
|
The minimal |
required |
lon_max
|
float
|
The maximal |
required |
lat_min
|
float
|
The minimal |
required |
lat_max
|
float
|
The maximal |
required |
observer_r
|
float
|
The distance of the observer from the galactic center. |
required |
theta
|
float
|
The angle, measured counter-clockwise from the AREPO \(x\)-axis, of the ray pointing from the galactic center to the observer position. |
required |
positions
|
ndarray
|
The particle positions in translated AREPO coordinates (in processing units). |
required |
velocities
|
ndarray
|
The particle velocities. |
required |
densities
|
ndarray
|
The particle densities. |
required |
temperatures
|
ndarray
|
The particle temperatures. |
required |
abundances_H2
|
ndarray
|
The particle \(\text{H}_2\) abundances. |
required |
abundances_CO
|
ndarray
|
The particle CO abundances. |
required |
dust_temperatures
|
ndarray
|
The particle dust temperatures. |
required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray]
|
A tuple |
Source code in iris/arepo_processing.py
3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 | |
_map_spherical_to_arepo(r, lon, lat, observer_r, theta, cupy=False)
Maps a set of points in the IRIS spherical coordinate system to the translated AREPO coordinate system (galactic-center origin, in processing units of distance).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
r
|
ndarray | ndarray
|
The |
required |
lon
|
ndarray | ndarray
|
The |
required |
lat
|
ndarray | ndarray
|
The |
required |
observer_r
|
float
|
The distance of the observer from the galactic center. |
required |
theta
|
float
|
The angle, measured counter-clockwise from the AREPO \(x\)-axis, of the ray pointing from the galactic center to the observer position. |
required |
cupy
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray | ndarray, ndarray | ndarray, ndarray | ndarray]
|
A tuple |
Source code in iris/arepo_processing.py
_project_velocities(positions, velocities, observer_r, theta, cupy=False)
Computes radial velocities with respect to the observer.
A radial velocity is the projection of the particle velocity onto the vector pointing from the particle position towards the observer, i.e. is positive when the particle is moving towards the observer.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions
|
ndarray | ndarray
|
The particle positions in translated AREPO coordinates (in processing units). |
required |
velocities
|
ndarray | ndarray
|
The particle velocities in AREPO coordinates (in processing units). |
required |
observer_r
|
float
|
The distance of the observer from the galactic center. |
required |
theta
|
float
|
The angle, measured counter-clockwise from the AREPO \(x\)-axis, of the ray pointing from the galactic center to the observer position. |
required |
cupy
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
ndarray | ndarray
|
An array of particle radial velocities. |
Source code in iris/arepo_processing.py
_interpolate(positions, velocities, densities, temperatures, abundances_H2, abundances_CO, dust_temperatures, observer_r, theta, r_min, r_max, r_steps, lon_min, lon_max, lon_steps, lat_min, lat_max, lat_steps, cupy=False)
Interpolates an unstructured mesh of particle values over the IRIS spherical coordinate grid to produce a physical tensor (or physical tensor chunk).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
positions
|
ndarray | ndarray
|
The particle positions in translated AREPO coordinates (in processing units). |
required |
velocities
|
ndarray | ndarray
|
The particle velocities. |
required |
densities
|
ndarray | ndarray
|
The particle densities. |
required |
temperatures
|
ndarray | ndarray
|
The particle temperatures. |
required |
abundances_H2
|
ndarray | ndarray
|
The particle \(\text{H}_2\) abundances. |
required |
abundances_CO
|
ndarray | ndarray
|
The particle CO abundances. |
required |
dust_temperatures
|
ndarray | ndarray
|
The particle dust temperatures. |
required |
observer_r
|
float
|
The distance of the observer from the galactic center. |
required |
theta
|
float
|
The angle, measured counter-clockwise from the AREPO \(x\)-axis, of the ray pointing from the galactic center to the observer position. |
required |
r_min
|
float
|
The minimal |
required |
r_max
|
float
|
The maximal |
required |
r_steps
|
int
|
The number of |
required |
lon_min
|
float
|
The minimal |
required |
lon_max
|
float
|
The maximal |
required |
lon_steps
|
int
|
The number of |
required |
lat_min
|
float
|
The minimal |
required |
lat_max
|
float
|
The maximal |
required |
lat_steps
|
int
|
The number of |
required |
cupy
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
ndarray | ndarray
|
The interpolated physical tensor. |
Source code in iris/arepo_processing.py
3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 | |
make_wide_top_down(resolution=(1024, 1024, 1024), box_size=25000, SI=True)
Computes a wide top-down H2 column-density projection of the snapshot.
For use in making the publication [sims overview figure][iris.visualization.sims_overview].
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resolution
|
tuple[int, int, int]
|
Interpolation resolution along the x, y, and z axes. |
(1024, 1024, 1024)
|
box_size
|
float
|
Width of the cubic interpolation volume in parsecs. |
25000
|
SI
|
bool
|
If |
True
|
Returns:
| Type | Description |
|---|---|
ndarray
|
The projected H2 column density. |
Source code in iris/arepo_processing.py
Processor
The base class extended by Reader and
Writer for coordinating dataset processing tasks.
Attributes:
| Name | Type | Description |
|---|---|---|
hyper |
Hyper
|
A hyperparameters object. |
path |
str | Sequence[str]
|
|
dataset |
Dataset | ConcatDataset | None
|
A dataset or concatenated dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Sequence[str]
|
Sets |
required |
hyper
|
Hyper | None
|
Sets |
None
|
dataset_type
|
type[Dataset]
|
PreObservedDataset
|
Source code in iris/arepo_processing.py
_load_dataset(path, dataset_type)
Loads a dataset or list of datasets. An abstract method extending classes must override.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Sequence[str]
|
A path/list of paths to a dataset directory/list of dataset directories. |
required |
dataset_type
|
type[Dataset]
|
The type of |
required |
Source code in iris/arepo_processing.py
Reader
Bases: Processor
A class for reading Dataset objects from the disk.
Automatically handles dataset concatenation
and reading of litter datasets as InfiniteDataset
objects. See train_reverter for notes on using litter.
Sets all self.dataset and self.litter read_only attributes as True to prevent dataset corruption.
Attributes:
| Name | Type | Description |
|---|---|---|
hyper |
Hyper
|
A hyperparameters object. |
path |
str | Sequence[str]
|
|
dataset |
Dataset | ConcatDataset
|
A dataset or concatenated dataset. |
litter |
InfiniteDataset | None
|
A litter dataset. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Sequence[str]
|
Sets |
required |
hyper
|
Hyper | None
|
Sets |
None
|
dataset_type
|
type[Dataset]
|
The type of |
PreObservedDataset
|
Source code in iris/arepo_processing.py
3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 | |
_load_dataset(path, dataset_type)
Loads a dataset or list of datasets in read-only mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str | Sequence[str]
|
A path/list of paths to a dataset directory/list of dataset directories.
If a list or tuple, will read each |
required |
dataset_type
|
type[Dataset]
|
The type of |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If no hyperparameters were provided to the |
Source code in iris/arepo_processing.py
gauge_cpu_memory()
Computes the total CPU memory usage of the current SLURM job (across all nodes and processes).
Returns:
| Type | Description |
|---|---|
float
|
Total CPU memory usage (in GiB). |
Source code in iris/arepo_processing.py
columnize_physical_tensor(physical_tensor, hyper, requires_grad=False)
Computes the "top-down" (latitude-meaned) \(\text{H}_2\) density of a physical tensor in the radial viewing range.
First extracts the density of the physical tensor within the radial bounds
hyper.coordinate_hyper.r_crop_min_index and hyper.coordinate_hyper.r_crop_max_index
specified within a Hyper object.
Note that these radial bounds are tensor indices, not radial coordinates in physical units.
This configurable radial viewing range allows computation of a constrained,
top-down density tensor from an extended observational cone.
Once extracted, converts this raw density into mass-density of \(\text{H}_2\).
Means the resulting density tensor over the galactic latitude dimension
to generate a top-down view.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
physical_tensor
|
Tensor
|
The physical tensor
(see |
required |
hyper
|
Hyper
|
A |
required |
requires_grad
|
bool
|
Set to True if gradients are required; False, otherwise. |
False
|
Returns:
| Type | Description |
|---|---|
Tensor
|
The top-down density tensor. |