scatrs
Fast, linearized, rigorously validated single-scattering calculations for spherical particles, written in Rust with a Python interface. The name reads as both "scatterers" and "scat-rs".
scatrs is built out of the scattering core of the sasktran2 radiative transfer model, as a standalone library for the optical properties of particles.
- Mie scattering by homogeneous spheres: coefficients, efficiencies, asymmetry parameter, amplitudes, phase matrix and Greek coefficients to every order.
- Ensembles of spheres: averages over seven kinds of size distribution, external mixtures and batches of distributions, at many wavelengths in parallel, with an error estimate for every output.
- Derivatives of every output, in closed form.
- Validated accuracy: every output has a declared accuracy, checked against independent arbitrary-precision reference values across the validated domain, and against published results.
Installation
Example
# One water droplet: efficiencies, asymmetry parameter and the phase matrix.
= # size parameter, refractive index n + ik
=
# A lognormal aerosol at three wavelengths (µm), with Greek coefficients to order 32.
=
=
use Complex;
use ;
let mut mie = new;
let sphere = mie.compute?;
println!;
Documentation
usask-arg.github.io/scatrs: a quick start, examples, the validation of the results, the theory behind every method, and the Python and Rust API references. The Rust API is also on docs.rs.
Contributing
See CONTRIBUTING.md.
License
MIT.