Data Containers
TOAST uses several key classes for storing time ordered data, instrument properties, and pixel domain data. TOAST supports fully distributing time and pixel domain data across multiple nodes of a cluster or supercomputer.
Data Object
toast.mpi.Comm
Bases: object
Class which represents a two-level hierarchy of MPI communicators.
A Comm object splits the full set of processes into groups of size
groupsize
. If groupsize does not divide evenly into the size of the given
communicator, then some processes remain idle.
A Comm object stores several MPI communicators: The "world" communicator given here, which contains all processes to consider, a "group" communicator (one per group), and a "rank" communicator which contains the processes with the same group-rank across all groups.
This object also stores a "node" communicator containing all processes with access to the same shared memory, and a "node rank" communicator for processes with the same rank on a node. There is a node rank communicator for all nodes and also one for within the group.
Additionally, there is a mechanism for creating and caching row / column communicators for process grids within a group.
If MPI is not enabled, then all communicators are set to None. Additionally, there may be cases where MPI is enabled in the environment, but the user wishes to disable it when creating a Comm object. This can be done by passing MPI.COMM_SELF as the world communicator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
world
|
Comm
|
the MPI communicator containing all processes. |
None
|
groupsize
|
int
|
the size of each process group. |
0
|
Source code in toast/mpi.py
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 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 503 |
|
_cleanup_group_comm = False
instance-attribute
_gcomm = self._wcomm
instance-attribute
_gnodecomm = None
instance-attribute
_gnodeprocs = 1
instance-attribute
_gnoderankcomm = None
instance-attribute
_gnoderankprocs = self._noderankprocs
instance-attribute
_gnodes = self._gsize // self._nodeprocs
instance-attribute
_grank = self._wrank % self._gsize
instance-attribute
_group = self._wrank // self._gsize
instance-attribute
_gsize = groupsize
instance-attribute
_ngroups = self._wsize // self._gsize
instance-attribute
_nodecomm = None
instance-attribute
_nodeprocs = 1
instance-attribute
_noderankcomm = None
instance-attribute
_noderankprocs = 1
instance-attribute
_rcomm = None
instance-attribute
_rowcolcomm = dict()
instance-attribute
_wcomm = world
instance-attribute
_wrank = 0
instance-attribute
_wsize = 1
instance-attribute
comm_group
property
The communicator shared by processes within this group.
comm_group_node
property
The communicator shared by group processes on the same node.
comm_group_node_rank
property
The communicator shared by group processes with the same node rank on nodes within the group.
comm_group_rank
property
The communicator shared by processes with the same group_rank.
comm_world
property
The world communicator.
comm_world_node
property
The communicator shared by world processes on the same node.
comm_world_node_rank
property
The communicator shared by world processes with the same node rank across all nodes.
group
property
The group containing this process.
group_rank
property
The rank of this process in the group communicator.
group_size
property
The size of the group containing this process.
ngroups
property
The number of process groups.
world_rank
property
The rank of this process in the world communicator.
world_size
property
The size of the world communicator.
__del__()
Source code in toast/mpi.py
316 317 |
|
__init__(world=None, groupsize=0)
Source code in toast/mpi.py
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 |
|
__repr__()
Source code in toast/mpi.py
493 494 495 496 497 498 499 500 501 502 503 |
|
close()
Source code in toast/mpi.py
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 |
|
comm_row_col(process_rows)
Return the row and column communicators for this group and grid shape.
This function will create and / or return the communicators needed for a given process grid. The return value is a dictionary with the following keys:
- "row": The row communicator.
- "col": The column communicator.
- "row_node": The node-local communicator within the row communicator
- "col_node": The node-local communicator within the col communicator
- "row_rank_node": The communicator across nodes among processes with
the same node-rank within the row communicator.
- "col_rank_node": The communicator across nodes among processes with
the same node-rank within the column communicator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
process_rows
|
int
|
The number of rows in the process grid. |
required |
Returns:
Type | Description |
---|---|
dict
|
The communicators for this grid shape. |
Source code in toast/mpi.py
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 |
|
toast.Data
Bases: MutableMapping
Class which represents distributed data
A Data object contains a list of observations assigned to each process group in the Comm.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
comm
|
class: |
Comm()
|
|
view
|
bool
|
If True, do not explicitly clear observation data on deletion. |
False
|
Source code in toast/data.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 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 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 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 |
|
_comm = comm
instance-attribute
_internal = dict()
instance-attribute
_view = view
instance-attribute
comm
property
The toast.Comm over which the data is distributed.
obs = []
instance-attribute
The list of observations.
__del__()
Source code in toast/data.py
60 61 62 |
|
__delitem__(key)
Source code in toast/data.py
39 40 |
|
__getitem__(key)
Source code in toast/data.py
36 37 |
|
__init__(comm=Comm(), view=False)
Source code in toast/data.py
28 29 30 31 32 33 34 |
|
__iter__()
Source code in toast/data.py
45 46 |
|
__len__()
Source code in toast/data.py
48 49 |
|
__repr__()
Source code in toast/data.py
51 52 53 54 55 56 57 58 |
|
__setitem__(key, value)
Source code in toast/data.py
42 43 |
|
accel_clear()
Delete all accelerator data.
Source code in toast/data.py
661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 |
|
accel_create(names)
Create a set of data objects on the device.
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods. If the data already exists on the device then no action is taken.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/data.py
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 |
|
accel_delete(names)
Delete a specific set of device objects
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/data.py
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 |
|
accel_update_device(names)
Copy a set of data objects to the device.
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/data.py
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 |
|
accel_update_host(names)
Copy a set of data objects to the host.
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/data.py
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 |
|
all_local_detectors(selection=None, flagmask=0)
Get the superset of local detectors in all observations.
This builds up the result from calling select_local_detectors()
on
all observations.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selection
|
list
|
Only consider this list of detectors |
None
|
flagmask
|
int
|
Apply this det_mask to the detector selection in each observation. |
0
|
Returns:
Type | Description |
---|---|
list
|
The list of all local detectors across all observations. |
Source code in toast/data.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
clear()
Clear the list of observations.
Source code in toast/data.py
69 70 71 72 73 74 75 76 77 78 |
|
detector_units(det_data)
Get the detector data units for a given field.
This verifies that the specified detector data field has the same units in all observations where it occurs, and returns that unit.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
det_data
|
str
|
The detector data field. |
required |
Returns:
Type | Description |
---|---|
Unit
|
The unit used across all observations. |
Source code in toast/data.py
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 |
|
info(handle=None)
Print information about the distributed data.
Information is written to the specified file handle. Only the rank 0 process writes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
handle
|
descriptor
|
file descriptor supporting the write() method. If None, use print(). |
None
|
Returns:
Type | Description |
---|---|
None |
Source code in toast/data.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 |
|
select(obs_index=None, obs_name=None, obs_uid=None, obs_session_name=None, obs_key=None, obs_val=None)
Create a new Data object with a subset of observations.
The returned Data object just has a view of the original observations (they are not copied).
The list of observations in the new Data object is a logical OR of the criteria passed in: * Index location in the original list of observations * Name of the observation * UID of the observation * Session of the observation * Existence of the specified dictionary key * Required value of the specified dictionary key
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obs_index
|
int
|
Observation location in the original list. |
None
|
obs_name
|
str
|
The observation name or a compiled regular expression object to use for matching. |
None
|
obs_uid
|
int
|
The observation UID to select. |
None
|
obs_session_name
|
str
|
The name of the session. |
None
|
obs_key
|
str
|
The observation dictionary key to examine. |
None
|
obs_val
|
str
|
The required value of the observation dictionary key or a compiled regular expression object to use for matching. |
None
|
Returns:
Type | Description |
---|---|
Data
|
A new Data object with references to the orginal metadata and a subset of observations. |
Source code in toast/data.py
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 |
|
split(obs_index=False, obs_name=False, obs_uid=False, obs_session_name=False, obs_key=None, require_full=False)
Split the Data object.
Create new Data objects that have views into unique subsets of the observations (the observations are not copied). Only one "criteria" may be used to perform this splitting operation. The observations may be split by index in the original list, by name, by UID, by session, or by the value of a specified key.
The new Data objects are returned in a dictionary whose keys are the value of
the selection criteria (index, name, uid, or value of the key). Any observation
that cannot be placed (because it is missing a name, uid or key) will be ignored
and not added to any of the returned Data objects. If the require_full
parameter is set to True, such situations will raise an exception.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obs_index
|
bool
|
If True, split by index in original list of observations. |
False
|
obs_name
|
bool
|
If True, split by observation name. |
False
|
obs_uid
|
bool
|
If True, split by observation UID. |
False
|
obs_session_name
|
bool
|
If True, split by session name. |
False
|
obs_key
|
str
|
Split by values of this observation key. |
None
|
require_full
|
bool
|
If True, every observation must be placed in the output. |
False
|
Returns:
Type | Description |
---|---|
OrderedDict
|
The dictionary of new Data objects. |
Source code in toast/data.py
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 |
|
Observation
toast.observation.Observation
Bases: MutableMapping
Class representing the data for one observation.
An Observation stores information about data distribution across one or more MPI processes and is a container for four types of objects:
* Local detector data (unique to each process).
* Shared data that has one common copy for every node spanned by the
observation.
* Intervals defining spans of data with some common characteristic.
* Other arbitrary small metadata.
Small metadata can be stored directly in the Observation using normal square bracket "[]" access to elements (an Observation is a dictionary). Groups of detector data (e.g. "signal", "flags", etc) can be accessed in the separate detector data dictionary (the "detdata" attribute). Shared data can be similarly stored in the "shared" attribute. Lists of intervals are accessed in the "intervals" attribute and data views can use any interval list to access subsets of detector and shared data.
Notes on distributed use with MPI
The detector data within an Observation is distributed among the processes in an MPI communicator. The processes in the communicator are arranged in a rectangular grid, with each process storing some number of detectors for a piece of time covered by the observation. The most common configuration (and the default) is to make this grid the size of the communicator in the "detector direction" and a size of one in the "sample direction"::
MPI det1 sample(0), sample(1), sample(2), ...., sample(N-1)
rank 0 det2 sample(0), sample(1), sample(2), ...., sample(N-1)
----------------------------------------------------------------------
MPI det3 sample(0), sample(1), sample(2), ...., sample(N-1)
rank 1 det4 sample(0), sample(1), sample(2), ...., sample(N-1)
So each process has a subset of detectors for the whole span of the observation time. You can override this shape by setting the process_rows to something else. For example, process_rows=1 would result in this::
MPI rank 0 | MPI rank 1
----------------------------------+----------------------------
det1 sample(0), sample(1), ..., | ...., sample(N-1)
det2 sample(0), sample(1), ..., | ...., sample(N-1)
det3 sample(0), sample(1), ..., | ...., sample(N-1)
det4 sample(0), sample(1), ..., | ...., sample(N-1)
Parameters:
Name | Type | Description | Default |
---|---|---|---|
comm
|
Comm
|
The toast communicator containing information about the process group for this observation. |
required |
telescope
|
Telescope
|
An instance of a Telescope object. |
required |
n_samples
|
int
|
The total number of samples for this observation. |
required |
name
|
str
|
(Optional) The observation name. |
None
|
uid
|
int
|
(Optional) The Unique ID for this observation. If not specified, the UID will be computed from a hash of the name. |
None
|
session
|
Session
|
The observing session that this observation is contained in or None. |
None
|
detector_sets
|
list
|
(Optional) List of lists containing detector names. These discrete detector sets are used to distribute detectors- a detector set will always be within a single row of the process grid. If None, every detector is a set of one. |
None
|
sample_sets
|
list
|
(Optional) List of lists of chunk sizes (integer numbers of samples). These discrete sample sets are used to distribute sample data. A sample set will always be within a single column of the process grid. If None, any distribution break in the sample direction will happen at an arbitrary place. The sum of all chunks must equal the total number of samples. |
None
|
process_rows
|
int
|
(Optional) The size of the rectangular process grid in the detector direction. This number must evenly divide into the size of comm. If not specified, defaults to the size of the communicator. |
None
|
Source code in toast/observation.py
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 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 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 |
|
_detflags = {x: int(0)for x in self.dist.dets[self.dist.comm.group_rank]}
instance-attribute
_internal = dict()
instance-attribute
_name = name
instance-attribute
_session = session
instance-attribute
_telescope = telescope
instance-attribute
_uid = uid
instance-attribute
all_detector_sets
property
(list): The total list of detector sets for this observation.
all_detectors
property
(list): All detectors stored in this observation.
all_sample_sets
property
(list): The input full list of sample sets used in data distribution
comm
property
(toast.Comm): The overall communicator.
comm_col
property
(mpi4py.MPI.Comm): The communicator for processes in the same column (or None).
comm_col_rank
property
(int): The rank of this process in the column communicator.
comm_col_size
property
(int): The number of processes in the column communicator.
comm_row
property
(mpi4py.MPI.Comm): The communicator for processes in the same row (or None).
comm_row_rank
property
(int): The rank of this process in the row communicator.
comm_row_size
property
(int): The number of processes in the row communicator.
detdata = DetDataManager(self.dist)
instance-attribute
dist = DistDetSamp(n_samples, self._telescope.focalplane.detectors, sample_sets, detector_sets, comm, process_rows)
instance-attribute
intervals = IntervalsManager(self.dist, n_samples)
instance-attribute
is_distributed_by_detector
property
is_distributed_by_sample
property
local_detector_flags
property
(dict): The local per-detector flags
local_detector_sets
property
(list): The detector sets assigned to this process (or None).
local_detectors
property
(list): The detectors assigned to this process.
local_index_offset
property
The first sample on this process, relative to the observation start.
local_sample_sets
property
(list): The sample sets assigned to this process (or None).
n_all_samples
property
(int): the total number of samples in this observation.
n_local_samples
property
The number of local samples on this process.
name
property
(str): The name of the observation.
session
property
(Session): The Session instance for this observation.
shared = SharedDataManager(self.dist)
instance-attribute
telescope
property
(Telescope): The Telescope instance for this observation.
uid
property
(int): The Unique ID for this observation.
view = ViewInterface()
class-attribute
instance-attribute
__del__()
Source code in toast/observation.py
552 553 554 555 556 |
|
__delitem__(key)
Source code in toast/observation.py
540 541 |
|
__eq__(other)
Source code in toast/observation.py
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 |
|
__getitem__(key)
Source code in toast/observation.py
537 538 |
|
__init__(comm, telescope, n_samples, name=None, uid=None, session=None, detector_sets=None, sample_sets=None, process_rows=None)
Source code in toast/observation.py
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 |
|
__iter__()
Source code in toast/observation.py
546 547 |
|
__len__()
Source code in toast/observation.py
549 550 |
|
__ne__(other)
Source code in toast/observation.py
632 633 |
|
__repr__()
Source code in toast/observation.py
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
|
__setitem__(key, value)
Source code in toast/observation.py
543 544 |
|
accel_clear()
Source code in toast/observation.py
926 927 928 929 930 931 932 933 |
|
accel_create(names)
Create a set of data objects on the device.
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/observation.py
854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 |
|
accel_update_device(names)
Copy data objects to the device.
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/observation.py
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 |
|
accel_update_host(names)
Copy data objects from the device.
This takes a dictionary with the same format as those used by the Operator provides() and requires() methods.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
names
|
dict
|
Dictionary of lists. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/observation.py
902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 |
|
clear()
Source code in toast/observation.py
256 257 258 259 260 261 |
|
duplicate(times=None, meta=None, shared=None, detdata=None, intervals=None)
Return a copy of the observation and all its data.
The times field should be the name of the shared field containing timestamps. This is used when copying interval lists to the new observation so that these objects reference the timestamps within this observation (rather than the old one). If this is not specified and some intervals exist, then an exception is raised.
The meta, shared, detdata, and intervals list specifies which of those objects to copy to the new observation. If these are None, then all objects are duplicated.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
times
|
str
|
The name of the timestamps shared field. |
None
|
meta
|
list
|
List of metadata objects to copy, or None. |
None
|
shared
|
list
|
List of shared objects to copy, or None. |
None
|
detdata
|
list
|
List of detdata objects to copy, or None. |
None
|
intervals
|
list
|
List of intervals objects to copy, or None. |
None
|
Returns:
Type | Description |
---|---|
Observation
|
The new copy of the observation. |
Source code in toast/observation.py
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 |
|
memory_use()
Estimate the memory used by shared and detector data.
This sums the memory used by the shared and detdata attributes and returns the total on all processes. This function is blocking on the observation communicator.
Returns:
Type | Description |
---|---|
int
|
The number of bytes of memory used by timestream data. |
Source code in toast/observation.py
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 |
|
redistribute(process_rows, times=None, override_sample_sets=False, override_detector_sets=False, return_global_intervals=False)
Take the currently allocated observation and redistribute in place.
This changes the data distribution within the observation. After re-assigning all detectors and samples, the currently allocated shared data objects and detector data objects are redistributed using the observation communicator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
process_rows
|
int
|
The size of the new process grid in the detector direction. This number must evenly divide into the size of the observation communicator. |
required |
times
|
str
|
The shared data field representing the timestamps. This is used to recompute the intervals after redistribution. |
None
|
override_sample_sets
|
(False, None or list)
|
If not False, override existing sample set boundaries in the redistributed data. |
False
|
override_detector_sets
|
(False, None or list)
|
If not False, override existing detector set boundaries in the redistributed data. |
False
|
return_global_intervals
|
bool
|
Return a list of global intervals for reference |
False
|
Returns:
Type | Description |
---|---|
None or global_intervals |
Source code in toast/observation.py
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 |
|
select_local_detectors(selection=None, flagmask=0)
Get the local detectors assigned to this process.
This takes the full list of local detectors and optionally prunes them by the specified selection and / or applies per-detector flags with the given mask.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
selection
|
list
|
Only return detectors in this set. |
None
|
flagmask
|
uint8
|
Apply this mask to per-detector flags and only include detectors with a result of zero (good). |
0
|
Returns:
Type | Description |
---|---|
list
|
The selected detectors. |
Source code in toast/observation.py
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 |
|
set_local_detector_flags(vals)
Set the per-detector flagging.
This resets the per-detector flags to the specified values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vals
|
dict
|
The flag values for one or more detectors. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/observation.py
387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 |
|
update_local_detector_flags(vals)
Update the per-detector flagging.
This does a bitwise OR with the existing flag values.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vals
|
dict
|
The flag values for one or more detectors. |
required |
Returns:
Type | Description |
---|---|
None |
Source code in toast/observation.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 |
|
Each Observation
has its own instrument model (see Instrument Model section).