scatrs
Fast, linearized, rigorously validated single-scattering calculations for spherical and spheroidal 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.
- Layered spheres: a core and any number of concentric shells (coated spheres among them), with the same outputs and derivatives with respect to every layer.
- Randomly oriented spheroids: efficiencies, Greek coefficients and the six-element phase matrix of oblate and prolate spheroids, by the T-matrix method, converged to a tolerance with an error estimate, and their derivatives.
- Ensembles of spheres and layered 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: with respect to the size parameter and every layer's refractive index, a spheroid's aspect ratio, and for ensembles the distribution parameters, a layered sphere's radius fractions and the mixture weights.
- 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 randomly oriented dust spheroid twice as wide as it is tall (aspect ratio a/c = 2).
=
# the error estimate of each converged T-matrix
# 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.