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.2.tar.gz
(3.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topozarr-0.0.2.tar.gz.
File metadata
- Download URL: topozarr-0.0.2.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ab7b59298ed6cc835d3837005de0719d8f31952221569979838e700d92521a89
|
|
| MD5 |
30d719436d5dd9b28312ed806cba4556
|
|
| BLAKE2b-256 |
b2b087f2f5674d3a9e794b709c4e65fb0219579f1ad3fed87750770ec0f3d32a
|
File details
Details for the file topozarr-0.0.2-py3-none-any.whl.
File metadata
- Download URL: topozarr-0.0.2-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01e08c08ed95af9f2f90f86022a00fefa2800cfed84334ec6b8b452983431f64
|
|
| MD5 |
14583d11f8f9f8dcb2ea6241bbf0915e
|
|
| BLAKE2b-256 |
c5681c30c30b51df55e8ff9c05dced087dfcd42ee7c9fbe4c5eeb74274bd83e7
|