Halo

class of dascore.lazy.contract
inherits from: ChunkContract
source

Halo(
    widths: collections.abc.Mapping[int, tuple[int, int]] ,
)-> None

An output chunk needs the input chunk and some samples around it.

The output has the input’s shape, and each sample is computed from the input samples within a fixed distance of its own position. A chunk is grown by that distance, stopping at the ends of the array, so the kernel treats the array’s own ends as it does eagerly and what it makes of a cut end is trimmed off.

Parameters

Parameter Description
widths For each axis the kernel reaches along, how many samples before
and after an output sample it reads.

Examples

from dascore.lazy.contract import Halo
halo = Halo({0: (2, 3)})
box = (slice(10, 20), slice(0, 5))
assert halo.needs(box, (100, 5)) == (slice(8, 23), slice(0, 5))
assert halo.needs(box, (21, 5)) == (slice(8, 21), slice(0, 5))

Methods

Name Description
apply Return the output box, computed from the input it needs.
needs Return the box grown by the widths, inside the array.