ndpyramid.pyramid_regrid#
- ndpyramid.pyramid_regrid(ds: Dataset, projection: Literal['web-mercator', 'equidistant-cylindrical'] = 'web-mercator', target_pyramid: DataTree | None = None, levels: int | None = None, *, level_list: Sequence[int] | None = None, parallel_weights: bool = True, weights_pyramid: DataTree | None = None, method: str = 'bilinear', regridder_kws: dict | None = None, regridder_apply_kws: dict | None = None, other_chunks: dict | None = None, pixels_per_tile: int = 128) DataTree[source]#
Make a pyramid using xesmf’s regridders
- Parameters:
ds (xr.Dataset) – Input dataset
projection (str, optional) – Projection to use for the grid, by default ‘web-mercator’
target_pyramid (xr.DataTree, optional) – Target grids, if not provided, they will be generated, by default None
levels (int, optional) – Number of contiguous levels to build (0..levels-1). Ignored if
level_listprovided.level_list (Sequence[int], optional) – Explicit list of zoom levels to build (sparse). Mutually exclusive with
levels.weights_pyramid (xr.DataTree, optional) – pyramid containing pregenerated weights
parallel_weights (Bool) – Use dask to generate parallel weights
method (str, optional) – Regridding method. See
Regridderfor valid options, by default ‘bilinear’regridder_kws (dict) – Keyword arguments to pass to regridder. Default is {‘periodic’: True}
regridder_apply_kws (dict) – Keyword arguments such as keep_attrs, skipna, na_thres to pass to
__call__(). Default is Noneother_chunks (dict) – Chunks for non-spatial dims to pass to
chunk(). Default is Nonepixels_per_tile (int, optional) – Number of pixels per tile, by default 128
- Returns:
pyramid – Multiscale data pyramid
- Return type:
xr.DataTree