Skip to main content

Fast region-based Doppler velocity dealiasing (Rust port of Py-ART's dealias_region_based core).

Project description

region-dealias

Fast region-based Doppler velocity dealiasing — a Rust port of the core (non-reference-anchored) path of Py-ART's dealias_region_based, with Python bindings.

The goal is bit-identical output to pyart on the path the NEXRAD Level 2 browser uses (dealias_region_based(radar, vel_field="velocity", keep_original=False), i.e. no ref_vel_field), but much faster — the slow part in pyart is the pure Python _EdgeTracker network reduction, which is what Rust accelerates.

Install

pip install region-dealias        # prebuilt manylinux / macOS wheels

Use

Drop-in replacement for pyart on a Radar object:

from region_dealias import dealias_region_based
corr = dealias_region_based(radar, vel_field="velocity", keep_original=False)
radar.add_field("corrected_velocity", corr)

Low-level, one sweep at a time (array in / fold-count out):

import numpy as np
from region_dealias import sweep_folds

folds = sweep_folds(vel, mask, nyquist=25.0, rays_wrap_around=True)
dealiased = vel + folds * (2 * 25.0)

vel is (nrays, ngates) float32, mask is a bool array (True = excluded: masked or non-finite). folds is the integer number of Nyquist intervals to add at each gate.

Scope

Implemented: the per-sweep region-network algorithm (interval_splits, skip_between_rays, skip_along_ray, centered, rays_wrap_around, per-sweep nyquist_vel).

Not implemented (the high-level wrapper raises NotImplementedError so callers can fall back to pyart): ref_vel_field (sounding-anchored) unfolding, custom gatefilter, and explicit interval_limits.

Parity

tests/test_parity.py checks the Rust folds against a verbatim transcription of pyart's algorithm (tests/pyart_ref.py) on hundreds of randomized synthetic aliased sweeps plus edge cases, asserting exact integer equality. CI also checks against the installed arm_pyart package. The certified pyart version is recorded in CI; re-verify on pyart upgrades.

Identity relies on faithfully reproducing: scipy.ndimage.label numbering (4-connectivity, first-encounter raster order), the Cython edge-finder traversal order, the float32/float64 dtype chain, NumPy banker's rounding (round_ties_even), and argmax-first-tie selection.

Layout

crates/core   # pure-Rust algorithm
crates/py     # PyO3 bindings (maturin)
python/       # region_dealias package (low-level + radar-compat wrapper)
tests/        # parity harness

License

MIT

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

region_dealias-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (253.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

region_dealias-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (231.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

region_dealias-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (253.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

region_dealias-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (231.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

region_dealias-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (253.5 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

region_dealias-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (231.8 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file region_dealias-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for region_dealias-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3b873d357cad9e775888a4713a19a6667cde794e3ca794343207c9e118c7ba0a
MD5 b4585819df50b477275bd5b1a0ddfe77
BLAKE2b-256 1b1189c2eaf164bc19bfdf8bac426cf89fe15fcc26f66d52b91f64e6290d3fe3

See more details on using hashes here.

Provenance

The following attestation bundles were made for region_dealias-0.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on swnesbitt/region-dealias

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file region_dealias-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for region_dealias-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 096d577582cfa4920f6de2578a1d02839fc5c4dbd21564605aa36c6cc1ffe156
MD5 636c3a79d7bb600f478461feac9f1df2
BLAKE2b-256 a38b40da6fdfda728348baeef83fcbd0a99cdc89e2fd38a9f71e001ee5462fc3

See more details on using hashes here.

Provenance

The following attestation bundles were made for region_dealias-0.1.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: wheels.yml on swnesbitt/region-dealias

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file region_dealias-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for region_dealias-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5d75d295599f40a15ec52ef7a44ce4b6d8127df65a39c17eedb9e7fef6958ea
MD5 703debf1f05f7b0712d224e8096671f3
BLAKE2b-256 cafc61df48cd39b0ad9eb9eb306fbdef5093bf6c5f07d960a468acde5cdbf1ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for region_dealias-0.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on swnesbitt/region-dealias

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file region_dealias-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for region_dealias-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 67b50eab93c345fb749f357a558fe069dff7bad4e50a3d66d0ee8ccfc68b56ad
MD5 972d85c9e0de516e58189fcd6b8d80a2
BLAKE2b-256 74220681b8cf404902480f5fbecb3b545f2472567ba689e0cf97f0a7138d82a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for region_dealias-0.1.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: wheels.yml on swnesbitt/region-dealias

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file region_dealias-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for region_dealias-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 740afa412e31979962bc85d7125983764dc1e6dbb91adbd22cc1186c71350e51
MD5 67947c23c6625b3b28c4adff7c4f2d4e
BLAKE2b-256 bcecf4dca720e2142d9039cb559fb6d27d721d226c4aac3ec54fa87b5b0cce1b

See more details on using hashes here.

Provenance

The following attestation bundles were made for region_dealias-0.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: wheels.yml on swnesbitt/region-dealias

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file region_dealias-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for region_dealias-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0ce72aaa8771840c93bfcb0c6a02a1597a49b74ea8bdad70d6e71460372e459c
MD5 8bfe60647bd6984f761a9d7f366c01ab
BLAKE2b-256 32857867d0cd6a75d0310ef96156d041857aa12531a30955fff1c7153bd96f67

See more details on using hashes here.

Provenance

The following attestation bundles were made for region_dealias-0.1.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: wheels.yml on swnesbitt/region-dealias

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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