ndpyramid.pyramid_reproject#
- ndpyramid.pyramid_reproject(ds: Dataset, *, projection: Literal['web-mercator', 'equidistant-cylindrical'] = 'web-mercator', levels: int | None = None, level_list: Sequence[int] | None = None, pixels_per_tile: int = 128, other_chunks: dict | None = None, resampling: str | dict = 'average', extra_dim: str | None = None, clear_attrs: bool = False) DataTree[source]#
Create a multiscale pyramid of a dataset via reprojection.
- Parameters:
ds (xarray.Dataset) – The dataset to create a multiscale pyramid of.
projection (str, optional) – The projection to use. Default is ‘web-mercator’.
levels (int, optional) – The number of (contiguous) levels to create starting at 0. Mutually exclusive with
level_list. If bothlevelsandlevel_listareNonethen an attempt is made to infer the number of levels viaget_levels(currently not implemented).level_list (Sequence[int], optional) – Explicit list of zoom levels to generate (e.g.
[4]to only build Z4, or[2,4,6]for a sparse pyramid). Mutually exclusive withlevels.pixels_per_tile (int, optional) – Number of pixels per tile, by default 128
other_chunks (dict) – Chunks for non-spatial dims to pass to
chunk(). Default is Noneresampling (str or dict, optional) – Resampling method to use. Default is ‘average’. If a dict, keys are variable names and values are resampling methods.
extra_dim (str, optional) – Deprecated/ignored. Extra dimensions are handled natively by odc-geo/xarray broadcasting.
clear_attrs (bool, False) – Clear the attributes of the DataArrays within the multiscale pyramid. Default is False.
- Returns:
The multiscale pyramid.
- Return type:
xr.DataTree