rustmatrix#

PyPI crates.io docs.rs docs

Rust-backed T-matrix scattering for nonspherical particles. A drop-in replacement for the numerical core of pytmatrix with substantially faster orientation averaging, parallel PSD integration, hydrometeor mixtures, and Doppler / polarimetric spectra.

from rustmatrix import Scatterer, radar
from rustmatrix.tmatrix_aux import wl_X, K_w_sqr, geom_horiz_back, dsr_thurai_2007
from rustmatrix.refractive import m_w_10C

s = Scatterer(radius=1.0, wavelength=wl_X, m=m_w_10C[wl_X],
              axis_ratio=1.0 / dsr_thurai_2007(2.0), Kw_sqr=K_w_sqr[wl_X])
s.set_geometry(geom_horiz_back)
print(f"Z_h = {radar.refl(s):.3f} mm⁶/m³")

What’s here#

Install

Pre-built wheels for macOS / Linux / Windows; source build instructions for everything else.

Installation
Quickstart

Five-minute walkthrough — your first scatterer, PSD, and reflectivity calculation.

Quickstart
Tutorials

Fourteen narrated, executable notebooks reproducing published radar-scattering results.

Tutorials
API reference

Every public Python symbol, generated from the source docstrings. Rust crate on docs.rs.

Python API reference

Why rustmatrix#

  • Faster. ~6× on orientation averaging, ~10× on PSD tabulation, ~430× on orient_averaged_adaptive — the Rust kernels release the GIL and parallelise across cores via rayon.

  • More physics. Hydrometeor mixtures (HydroMix), Doppler + polarimetric spectra (SpectralIntegrator), and pattern × scene integration (spectra.beam) for non-uniform scenes — all on top of the same T-matrix solver.

  • Drop-in. API mirrors pytmatrix wherever the underlying physics matches, so existing scripts port over without code changes.

About#

rustmatrix is developed by Steve Nesbitt, Professor in the Department of Climate, Meteorology & Atmospheric Sciences (CLIMAS) at the University of Illinois Urbana-Champaign. It grows out of instruction material for ATMS 410 — Radar Meteorology and accompanies the textbook Radar Meteorology: A First Course (Rauber & Nesbitt, 2018, Wiley).

Radar Meteorology: A First Course

Radar Meteorology: A First Course Rauber & Nesbitt, Wiley (2018)

https://onlinelibrary.wiley.com/doi/book/10.1002/9781118432662
CLIMAS at Illinois

CLIMAS — Climate, Meteorology & Atmospheric Sciences at Illinois

https://climas.illinois.edu/

See also the companion project myPSD — an interactive web frontend for radar simulation that drives rustmatrix under the hood, for pedagogy and sensitivity exploration.