WindowReduce

class of dascore.proc.window
inherits from: PatchProcessor, DascoreBaseModel, pydantic.main.BaseModel
source

WindowReduce(
    *args ,
    function: Any ,
    function_args: <class ’tuple = (),
    function_kwargs: dict | None[<class ’dict, None] = None,
    overlap: Any = None,
    step: Any = None,
    samples: bool = False,
    ends: str = pad,
    align: str = center,
    fill: Any = None,
    **kwargs ,
)-> None

Reduce each window along one dimension to a single value.

The operation behind the reductions of Patch.window, where its parameters are described; the dimension to window is given as a keyword, such as time=0.5.

Examples

import dascore as dc
from dascore.proc.window import WindowReduce
patch = dc.get_example_patch()
out = WindowReduce("mean", time=11, samples=True)(patch)
assert out.shape == patch.shape

Methods

Name Description
check Refuse a patch which does not carry what the operation needs.
chunk_contract Return what a chunk of the output needs of the input, or None.
get_metadata Return the reduced metadata, and where the complete windows sit.
halo Return how far along an axis the kernel reads to fill a sample.
model_copy Copy the model, dropping cached values the update invalidates.
new Create new instance with some attributed updated.
numpy_kernel Return one value for each window; NaN where a window is incomplete.
reconcile Return metadata or a patch holding the final data; default as is.
run Run the operation: check, get_metadata, kernel, reconcile, record.