stack_patches

function of dascore.utils.patch source

stack_patches(
    patches ,
    dim_vary = None,
    check_behavior: Literal[‘warn’, ‘raise’, ‘ignore’] = warn,
)-> ‘dc.Patch’

Stack (add) all patches compatible with first patch together.

Compatible means the same kind (see check_kind; compared strictly, so a missing value equals only another missing value), the same data units, the same dimensions, and equal coordinates other than dim_vary. The output carries the first patch’s attributes.

Parameters

Parameter Description
patches The patches to stack together.
dim_vary The name of the dimension which can be different in values
(but not shape) and patches still added together.
If None, all dimension values must be equal. Its labels in the
output are the first patch’s (DASCore 0.1.24 relabelled them to
start at zero).
{check_desc}

Examples

import dascore as dc
# add a spool with equal sized patches but progressing time dim
spool = dc.get_example_spool()
stacked_patch = spool.stack(dim_vary='time')