rustmatrix#
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#
Pre-built wheels for macOS / Linux / Windows; source build instructions for everything else.
Five-minute walkthrough — your first scatterer, PSD, and reflectivity calculation.
Fourteen narrated, executable notebooks reproducing published radar-scattering results.
Every public Python symbol, generated from the source docstrings. Rust crate on docs.rs.
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 viarayon.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).
See also the companion project
myPSD — an interactive
web frontend for radar simulation that drives rustmatrix under
the hood, for pedagogy and sensitivity exploration.