Map Domain
Internally, map domain objects (hit maps, signal maps, pixel noise covariances, etc) are stored in a distributed fashion. This enables each process to only store a subset of the sky pixels, which saves memory for large maps at high resolution.
toast.pixels.PixelDistribution
Bases: AcceleratorObject
Class representing the distribution of submaps.
This object is used to describe the properties of a pixelization scheme and which "submaps" are strored on each process. The size of the submap can be tuned to balance storage (smaller submap size means fewer wasted pixels stored) and ease of indexing (larger submap size means faster global-to-local pixel lookups).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_pix
|
int
|
the total number of pixels. |
None
|
n_submap
|
int
|
the number of submaps to use. |
1000
|
local_submaps
|
array
|
the list of local submaps (integers). |
None
|
comm
|
Comm
|
The MPI communicator or None. |
None
|
Source code in toast/pixels.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 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 |
|
_all_hit_submaps = None
instance-attribute
_alltoallv_info = None
instance-attribute
_comm = comm
instance-attribute
_glob2loc = AlignedI64.zeros(self._n_submap)
instance-attribute
_local_submaps = local_submaps
instance-attribute
_n_local = 0
instance-attribute
_n_pix = n_pix
instance-attribute
_n_pix_submap = self._n_pix // self._n_submap
instance-attribute
_n_submap = n_submap
instance-attribute
_owned_submaps = None
instance-attribute
_submap_owners = None
instance-attribute
all_hit_submaps
property
(array): The list of submaps local to atleast one process.
alltoallv_info
property
Return the offset information for Alltoallv communication.
This returns a tuple containing
- The send displacements for the Alltoallv submap gather
- The send counts for the Alltoallv submap gather
- The receive displacements for the Alltoallv submap gather
- The receive counts for the Alltoallv submap gather
- The locations in the receive buffer of each submap.
comm
property
(mpi4py.MPI.Comm): The MPI communicator used (or None)
global_submap_to_local
property
(array): The mapping from global submap to local.
local_submaps
property
(array): The list of local submaps or None if process has no data.
n_local_submap
property
(int): The number of submaps stored on this process.
n_pix
property
(int): The global number of pixels.
n_pix_submap
property
(int): The number of pixels in each submap.
n_submap
property
(int): The total number of submaps.
owned_submaps
property
The submaps owned by this process.
submap_owners
property
The owning process for every hit submap.
This information is used in several other operations, including serializing PixelData objects to a single process and also communication needed for reducing data globally.
__del__()
Source code in toast/pixels.py
126 127 |
|
__eq__(other)
Source code in toast/pixels.py
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
|
__init__(n_pix=None, n_submap=1000, local_submaps=None, comm=None)
Source code in toast/pixels.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
__ne__(other)
Source code in toast/pixels.py
110 111 |
|
__repr__()
Source code in toast/pixels.py
221 222 223 224 225 |
|
_accel_create()
Source code in toast/pixels.py
403 404 |
|
_accel_delete()
Source code in toast/pixels.py
415 416 |
|
_accel_exists()
Source code in toast/pixels.py
400 401 |
|
_accel_reset()
Source code in toast/pixels.py
412 413 |
|
_accel_update_device()
Source code in toast/pixels.py
406 407 |
|
_accel_update_host()
Source code in toast/pixels.py
409 410 |
|
clear()
Delete the underlying memory.
This will forcibly delete the C-allocated memory and invalidate all python references to this object. DO NOT CALL THIS unless you are sure all references are no longer being used and you are about to delete the object.
Source code in toast/pixels.py
113 114 115 116 117 118 119 120 121 122 123 124 |
|
global_pixel_to_local(gl)
Convert global pixel indices into local pixel indices.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gl
|
array
|
The global pixel numbers. |
required |
Returns:
Type | Description |
---|---|
array
|
The local raw (flat packed) buffer index for each pixel. |
Source code in toast/pixels.py
196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
|
global_pixel_to_submap(gl)
Convert global pixel indices into the local submap and pixel.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
gl
|
array
|
The global pixel numbers. |
required |
Returns:
Type | Description |
---|---|
tuple
|
A tuple of arrays containing the local submap index (int) and the pixel index local to that submap (int). |
Source code in toast/pixels.py
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
toast.pixels.PixelData
Bases: AcceleratorObject
Distributed map-domain data.
The distribution information is stored in a PixelDistribution instance passed to the constructor. Each process has local data stored in one or more "submaps".
Although multiple processes may have the same submap of data stored locally, only one process is considered the "owner". This ownership is used when serializing the data and when doing reductions in certain cases. Ownership can be set to either the lowest rank process which has the submap or to a balanced distribution.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
dist
|
PixelDistribution
|
The distribution of submaps. |
required |
dtype
|
dtype
|
A numpy-compatible dtype for each element of the data. The only supported types are 1, 2, 4, and 8 byte signed and unsigned integers, 4 and 8 byte floating point numbers, and 4 and 8 byte complex numbers. |
required |
n_value
|
int
|
The number of values per pixel. |
1
|
units
|
Unit
|
The units of the map data. |
dimensionless_unscaled
|
Source code in toast/pixels.py
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 503 504 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 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 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 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 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 |
|
_all_comm_submap = None
instance-attribute
_all_recv = None
instance-attribute
_all_recv_raw = None
instance-attribute
_all_send = None
instance-attribute
_all_send_raw = None
instance-attribute
_dist = dist
instance-attribute
_dtype = ttype
instance-attribute
_flatshape = self._dist.n_local_submap * self._dist.n_pix_submap * self._n_value
instance-attribute
_n_submap_value = self._dist.n_pix_submap * self._n_value
instance-attribute
_n_value = n_value
instance-attribute
_receive_raw = None
instance-attribute
_recv_counts = None
instance-attribute
_recv_displ = None
instance-attribute
_recv_locations = None
instance-attribute
_reduce_buf_raw = None
instance-attribute
_send_counts = None
instance-attribute
_send_displ = None
instance-attribute
_shape = (self._dist.n_local_submap, self._dist.n_pix_submap, self._n_value)
instance-attribute
_units = units
instance-attribute
data = self.raw.array().reshape(self._shape)
instance-attribute
distribution
property
(PixelDistribution): The distribution information.
dtype
property
(numpy.dtype): The data type of the values.
mpibytesize = None
instance-attribute
mpitype = None
instance-attribute
n_value
property
(int): The number of non-zero values per pixel.
raw = self.storage_class.zeros(self._flatshape)
instance-attribute
receive = None
instance-attribute
reduce_buf = None
instance-attribute
storage_class = None
instance-attribute
units
property
(Unit): The map data units.
__del__()
Source code in toast/pixels.py
557 558 |
|
__delitem__(key)
Source code in toast/pixels.py
593 594 595 |
|
__eq__(other)
Source code in toast/pixels.py
614 615 616 617 618 619 620 621 622 623 |
|
__getitem__(key)
Source code in toast/pixels.py
590 591 |
|
__init__(dist, dtype, n_value=1, units=u.dimensionless_unscaled)
Source code in toast/pixels.py
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 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 |
|
__iter__()
Source code in toast/pixels.py
600 601 |
|
__len__()
Source code in toast/pixels.py
603 604 |
|
__ne__(other)
Source code in toast/pixels.py
625 626 |
|
__repr__()
Source code in toast/pixels.py
606 607 608 609 610 611 612 |
|
__setitem__(key, value)
Source code in toast/pixels.py
597 598 |
|
_accel_create(zero_out=False)
Source code in toast/pixels.py
1173 1174 1175 1176 1177 |
|
_accel_delete()
Source code in toast/pixels.py
1197 1198 1199 1200 1201 |
|
_accel_exists()
Source code in toast/pixels.py
1165 1166 1167 1168 1169 1170 1171 |
|
_accel_reset()
Source code in toast/pixels.py
1191 1192 1193 1194 1195 |
|
_accel_update_device()
Source code in toast/pixels.py
1179 1180 1181 1182 1183 |
|
_accel_update_host()
Source code in toast/pixels.py
1185 1186 1187 1188 1189 |
|
broadcast_map(fdata, comm_bytes=10000000)
Distribute a map located on a single process.
The root process takes a map in memory and distributes it. Chunks of submaps are broadcast to all processes, and each process copies data to its local submaps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fdata
|
array
|
The input data (only significant on process 0). |
required |
comm_bytes
|
int
|
The approximate message size to use. |
10000000
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels.py
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 |
|
clear()
Delete the underlying memory.
This will forcibly delete the C-allocated memory and invalidate all python references to this object. DO NOT CALL THIS unless you are sure all references are no longer being used and you are about to delete the object.
Source code in toast/pixels.py
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 |
|
comm_nsubmap(bytes)
Given a buffer size, compute the number of submaps to communicate.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
bytes
|
int
|
The number of bytes. |
required |
Returns:
Type | Description |
---|---|
int
|
The number of submaps in each buffer. |
Source code in toast/pixels.py
642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 |
|
duplicate()
Create a copy of the data with the same distribution.
Returns:
Type | Description |
---|---|
PixelData
|
A duplicate of the instance with copied data but the same distribution. |
Source code in toast/pixels.py
628 629 630 631 632 633 634 635 636 637 638 639 640 |
|
forward_alltoallv()
Communicate submaps into buffers on the owning process.
On the first call, some initialization is done to compute send and receive displacements and counts. A persistent receive buffer is allocated. Submap data is sent to their owners simultaneously using alltoallv.
Returns:
Type | Description |
---|---|
None. |
Source code in toast/pixels.py
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 |
|
local_reduction(n_submap_value, receive_locations, receive, reduce_buf)
staticmethod
Source code in toast/pixels.py
758 759 760 761 762 763 764 765 766 |
|
reset()
Set memory to zero
Source code in toast/pixels.py
560 561 562 563 564 |
|
reverse_alltoallv()
Communicate submaps from the owning process back to all processes.
Returns:
Type | Description |
---|---|
None. |
Source code in toast/pixels.py
888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 |
|
setup_allreduce(n_submap)
Check that allreduce buffers exist and create them if needed.
Source code in toast/pixels.py
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 |
|
setup_alltoallv()
Check that alltoallv buffers exist and create them if needed.
Source code in toast/pixels.py
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 |
|
stats(comm_bytes=10000000)
Compute some simple statistics of the pixel data.
The map should already be consistent across all processes with overlapping submaps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
comm_bytes
|
int
|
The approximate message size to use. |
10000000
|
Returns:
Type | Description |
---|---|
dict
|
The computed properties on rank zero, None on other ranks. |
Source code in toast/pixels.py
949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 |
|
sync_allreduce(comm_bytes=10000000)
Perform a buffered allreduce of the data.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
comm_bytes
|
int
|
The approximate message size to use. |
10000000
|
Returns:
Type | Description |
---|---|
None. |
Source code in toast/pixels.py
686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 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 |
|
sync_alltoallv(local_func=None)
Perform operations on locally owned submaps using Alltoallv communication.
On the first call, some initialization is done to compute send and receive displacements and counts. A persistent receive buffer is allocated. Submap data is sent to their owners simultaneously using alltoallv. Each process does a local operation on their owned submaps before sending the result back with another alltoallv call.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
local_func
|
function
|
A function for processing the local submap data. |
None
|
Returns:
Type | Description |
---|---|
None. |
Source code in toast/pixels.py
919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 |
|
update_units(new_units)
Update the units associated with the data.
Source code in toast/pixels.py
586 587 588 |
|
Map domain objects can be saved to and loaded from different formats on disk depending on the pixelization. Healpix maps support both FITS and a more performant HDF5 format. Maps in WCS flat projections only support FITS formats.
toast.pixels_io_healpix.read_healpix_fits(pix, path, nest=True, comm_bytes=10000000)
Read and broadcast a HEALPix FITS table.
The root process opens the FITS file in memmap mode and iterates over chunks of the map in a way to minimize cache misses in the internal FITS buffer. Chunks of submaps are broadcast to all processes, and each process copies data to its local submaps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pix
|
PixelData
|
The distributed PixelData object. |
required |
path
|
str
|
The path to the FITS file. |
required |
nest
|
bool
|
If True, convert input to NESTED ordering, else use RING. |
True
|
comm_bytes
|
int
|
The approximate message size to use in bytes. |
10000000
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_healpix.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
toast.pixels_io_healpix.write_healpix_fits(pix, path, nest=True, comm_bytes=10000000, report_memory=False, single_precision=False)
Write pixel data to a HEALPix format FITS table.
The data across all processes is assumed to be synchronized (the data for a given submap shared between processes is identical). The submap data is sent to the root process which writes it out. For parallel writing, see write_hdf5().
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pix
|
PixelData
|
The distributed pixel object. |
required |
path
|
str
|
The path to the output FITS file. |
required |
nest
|
bool
|
If True, data is in NESTED ordering, else data is in RING. |
True
|
comm_bytes
|
int
|
The approximate message size to use. |
10000000
|
report_memory
|
bool
|
Report the amount of available memory on the root node just before writing out the map. |
False
|
single_precision
|
bool
|
Cast float and integer maps to single precision. |
False
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_healpix.py
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 |
|
toast.pixels_io_healpix.read_healpix_hdf5(pix, path, nest=True, comm_bytes=10000000)
Read and broadcast a HEALPix map from an HDF5 file.
The root process opens the file and iterates over chunks of the map. Chunks of submaps are broadcast to all processes, and each process copies data to its local submaps.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pix
|
PixelData
|
The distributed PixelData object. |
required |
path
|
str
|
The path to the FITS file. |
required |
nest
|
bool
|
If True, convert input to NESTED ordering, else use RING. |
True
|
comm_bytes
|
int
|
The approximate message size to use in bytes. |
10000000
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_healpix.py
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 |
|
toast.pixels_io_healpix.write_healpix_hdf5(pix, path, nest=True, comm_bytes=10000000, single_precision=False, force_serial=True)
Write pixel data to a HEALPix format HDF5 dataset.
The data across all processes is assumed to be synchronized (the data for a given submap shared between processes is identical).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pix
|
PixelData
|
The distributed pixel object. |
required |
path
|
str
|
The path to the output FITS file. |
required |
nest
|
bool
|
If True, data is in NESTED ordering, else data is in RING. |
True
|
comm_bytes
|
int
|
The approximate message size to use. |
10000000
|
single_precision
|
bool
|
If True, write floats and integers in single precision |
False
|
force_serial
|
bool
|
If True, use the serial h5py implementation, even if parallel support is available. |
True
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_healpix.py
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 503 504 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 |
|
toast.pixels_io_healpix.read_healpix(filename, *args, **kwargs)
Read a FITS or HDF5 map serially.
This reads the file into simple numpy arrays on the calling process. Units in the file are ignored.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The path to the file. |
required |
Returns:
Type | Description |
---|---|
tuple
|
The map data and optionally header. |
Source code in toast/pixels_io_healpix.py
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 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 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 |
|
toast.pixels_io_healpix.write_healpix(filename, mapdata, nside_submap=16, *args, **kwargs)
Write a FITS or HDF5 map serially.
This writes the map data from a simple numpy array on the calling process.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filename
|
str
|
The path to the file. |
required |
mapdata
|
array
|
The data array. |
required |
nside_submap
|
int
|
The submap NSIDE, used for dataset chunking. |
16
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_healpix.py
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 |
|
toast.pixels_io_wcs.write_wcs_fits(pix, path, comm_bytes=10000000, report_memory=False)
Write pixel data to a FITS image
The data across all processes is assumed to be synchronized (the data for a given submap shared between processes is identical). The submap data is sent to the root process which writes it out.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pix
|
PixelData
|
The distributed pixel object. |
required |
path
|
str
|
The path to the output FITS file. |
required |
comm_bytes
|
int
|
The approximate message size to use. |
10000000
|
report_memory
|
bool
|
Report the amount of available memory on the root node just before writing out the map. |
False
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_wcs.py
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 |
|
toast.pixels_io_wcs.read_wcs_fits(pix, path, ext=0, comm_bytes=10000000)
Read and broadcast pixel data stored in a FITS image.
The root process opens the FITS file and broadcasts the data in units of the submap size.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pix
|
PixelData
|
The distributed PixelData object. |
required |
path
|
str
|
The path to the FITS file. |
required |
ext
|
(int, str)
|
Then index or name of the FITS image extension to load. |
0
|
comm_bytes
|
int
|
The approximate message size to use in bytes. |
10000000
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/pixels_io_wcs.py
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 |
|