Skip to main content

A small utility for generating ND array pyramids using Xarray and Zarr

Project description

CarbonPlan monogram.

ndpyramid

A small utility for generating ND array pyramids using Xarray and Zarr.

CI PyPI Conda Version License: MIT Code coverage

installation

Ndpyramid can be installed in three ways:

Using the conda package manager that comes with the Anaconda/Miniconda distribution:

conda install ndpyramid --channel conda-forge

Using the pip package manager:

python -m pip install ndpyramid

To install a development version from source:

git clone https://github.com/carbonplan/ndpyramid
cd ndpyramid
python -m pip install -e .

optional dependencies

Depending on your use case you can specify optional dependencies on install.

python -m pip install "ndpyramid[xesmf]"     # Install optional dependencies for regridding with ESMF
python -m pip install "ndpyramid[dask]"      # Install optional dependencies for resampling with pyresample and Dask
python -m pip install "ndpyramid[complete]"  # Install all optional dependencies

usage

Ndpyramid provides a set of utilities for creating pyramids with standardized metadata. The example below demonstrates the usage of the pyramid_coarsen and pyramid_reproject utilities. Check out the examples gallery for more complete demonstrations.

import xarray as xr
import rioxarray
from ndpyramid import pyramid_coarsen, pyramid_reproject

# make a reprojected (EPSG:3857) pyramid
ds = ds.rio.write_crs('EPSG:4326')
pyramid = pyramid_reproject(ds, levels=2)

# write the pyramid to zarr
pyramid.to_zarr('./path/to/write')

See the docstrings and API documentation for more details about input parameters and options.

license

All the code in this repository is MIT-licensed, but we request that you please provide attribution if reusing any of our digital content (graphics, logo, articles, etc.).

about us

CarbonPlan is a nonprofit organization that uses data and science for climate action. We aim to improve the transparency and scientific integrity of climate solutions with open data and tools. Find out more at carbonplan.org or get in touch by opening an issue or sending us an email.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ndpyramid-0.3.2.tar.gz (1.2 MB view details)

Uploaded Source

Built Distribution

ndpyramid-0.3.2-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file ndpyramid-0.3.2.tar.gz.

File metadata

  • Download URL: ndpyramid-0.3.2.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ndpyramid-0.3.2.tar.gz
Algorithm Hash digest
SHA256 e816adb537266d70375f3e64f351d7c6f094d66885262319d9f914e692e0a2fd
MD5 36480baf312f15530a22ef6081235e3d
BLAKE2b-256 80df7a85562d1e88e65dd8646da4b99f44117d149652797d2b987e81793833dc

See more details on using hashes here.

File details

Details for the file ndpyramid-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: ndpyramid-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for ndpyramid-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c4f46b5ff3143d16f0911f76ccab204e5d0993b1c13ef0af14dc28df1049abf5
MD5 f98d5d68407e780a7de9cc7c4a98eea8
BLAKE2b-256 ffeb2db88a4460c6cdad0de80b4cc2ae1731beb5bdbc22b574b4a3ba0f9799d0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page