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)[source]#
Create a multiscale pyramid via a given function applied to a dataset. The generalized version of pyramid_coarsen.
- Parameters:
ds (xarray.Dataset) – The dataset to apply the function to.
factors (list[int]) – The factors to coarsen by.
dims (list[str]) – The dimensions to coarsen.
func (Callable) – The function to apply to the dataset; must accept the ds, factor, and dims as positional arguments.
type_label (str, optional) – The type label to use as metadata for the multiscales spec. The default is ‘reduce’.
method_label (str, optional) – The method label to use as metadata for the multiscales spec. The default is the name of the function.
kwargs (dict) – Additional keyword arguments to pass to the func.