Skip to main content

Lightweight multiscale zarr

Project description

topozarr - lightweight multiscale zarr pyramids

Warning: experimental

Usage

Installation

uv add 'topozarr @ git+https://github.com/norlandrhagen/topozarr'

Example

# !pip install netcdf4 pooch 
import xarray as xr
import xproj # for crs assignment
from topozarr.coarsen import create_pyramid

# Load the air_temp tutorial xarray dataset
ds = xr.tutorial.open_dataset('air_temperature', chunks={})
ds = ds.proj.assign_crs(spatial_ref_crs={"EPSG":4326})
print(ds)
pyramid = create_pyramid(
    ds, 
    levels=2, 
    x_dim="lon", 
    y_dim="lat", 
    spec="ndpyramid" # or "zarr-multiscales"
)
print(pyramid.encoding)
print(pyramid.dt)
# Optional: Write to Zarr
!pip install obstore zarr
from obstore.store import from_url
from zarr.storage import ObjectStore


store = from_url(url = "<add_your_bucket_url>", region="<add_your_region>")
zstore = ObjectStore(store) 
result_GEOG.dt.to_zarr(zstore, mode="w", encoding = pyramid.encoding, zarr_format=3)

Development

This project uses uv for dependency management, pytest and hypothesis for testing and ruff for linting.

Sync development environment

uv sync --all-extras

Run linter

uv run pre-commit run all-files

Run tests

uv run pytest tests/

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

topozarr-0.0.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

topozarr-0.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file topozarr-0.0.1.tar.gz.

File metadata

  • Download URL: topozarr-0.0.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for topozarr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ea52834981756f092f3b7f94d38686af7063fffa202d8bc901dcf05780819fe2
MD5 d6806238e34c38fceff319ff7baef263
BLAKE2b-256 41e69d2b696fcf7f2dc7d76776c703636d87932090438054bd73961a812381c6

See more details on using hashes here.

File details

Details for the file topozarr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: topozarr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.24 {"installer":{"name":"uv","version":"0.9.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for topozarr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a2c63801e6f2d6de3c5ec84983d5450536844aa1f0fccca87e4e94849952ae8e
MD5 b08bf6487c46a4d409e2ffe8f8514bfc
BLAKE2b-256 974dc73d32e9303603c6a5ace96a55c33ef7913ccfecf60c9ad98d61f91214ae

See more details on using hashes here.

Supported by

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