ndpyramid.pyramid_create

Contents

ndpyramid.pyramid_create#

ndpyramid.pyramid_create(ds: Dataset, *, factors: list[int], dims: list[str], func: Callable, type_label: str = 'reduce', method_label: str | None = None, **kwargs)#

Create a multiscale pyramid via a given function applied to a dataset. The generalized version of pyramid_coarsen.

Parameters#

dsxarray.Dataset

The dataset to apply the function to.

factorslist[int]

The factors to coarsen by.

dimslist[str]

The dimensions to coarsen.

funcCallable

The function to apply to the dataset; must accept the ds, factor, and dims as positional arguments.

type_labelstr, optional

The type label to use as metadata for the multiscales spec. The default is ‘reduce’.

method_labelstr, optional

The method label to use as metadata for the multiscales spec. The default is the name of the function.

kwargsdict

Additional keyword arguments to pass to the func.