Skip to main content

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

pip install scatrs
cargo add scatrs

Example

import numpy as np
import scatrs
from scatrs import mie

# One water droplet: efficiencies, asymmetry parameter and the phase matrix.
q = mie.efficiencies(10.0, 1.33 + 1e-8j)  # size parameter, refractive index n + ik
f = mie.phase_matrix(10.0, 1.33 + 1e-8j, np.cos(np.radians([0, 90, 180])))

# A lognormal aerosol at three wavelengths (µm), with Greek coefficients to order 32.
sulfate = scatrs.Ensemble(
    scatrs.Sphere(refractive_index=1.43 + 1e-8j),
    scatrs.LogNormal(median_radius=0.08, width=1.6),
)
r = sulfate.compute([0.35, 0.55, 1.0], greek=32)
print(r.c_ext, r.ssa, r.g, r.greek.alpha1[:, :4])
use num_complex::Complex;
use scatrs::mie::{Mie, MieOptions};

let mut mie = Mie::<f64>::new();
let sphere = mie.compute(10.0, Complex::new(1.33, 1e-8), &MieOptions::new())?;
println!("Q_ext = {}", sphere.efficiencies().q_ext);

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.

Metadata

Release files for scatrs 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scatrs 0.2.0
File Size Uploaded
scatrs-0.2.0.tar.gz 190.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for scatrs 0.2.0
File
scatrs-0.2.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details
scatrs-0.2.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
scatrs-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
scatrs-0.2.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
scatrs-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details
scatrs-0.2.0-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.11 abi3 Linux glibc 2.17+ IBM System/390x Details
scatrs-0.2.0-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.11 abi3 Linux glibc 2.17+ PowerPC 64-le Details
scatrs-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
scatrs-0.2.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
scatrs-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 6.7 MB

Release files / scatrs-0.2.0.tar.gz

Download URL scatrs-0.2.0.tar.gz
Size 190.2 kB
Tags Source
SHA-256 checksum
How to use checksums
080ff70e62859d006d4317eb9f7feaaa0749d97003b0ed4820009f18df7ff405
BLAKE2b-256 checksum
How to use checksums
4608bf1f90e93725daf346a64915aba91d3faa8130a80428190be95a1e630e98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-win_arm64.whl

Download URL scatrs-0.2.0-cp311-abi3-win_arm64.whl
Size 471.1 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
49507cbf7a3cb4b5cc1ede6dfad9476c10c454292cd49cbd9b7a0634b8e0278d
BLAKE2b-256 checksum
How to use checksums
5035d053dea071af8b14ff01845e887f5ea29daee0cd2c7b131523c8a7e350f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-win_amd64.whl

Download URL scatrs-0.2.0-cp311-abi3-win_amd64.whl
Size 529.8 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0a1f5282ce90dc1e2c7163380a02214fd5df6c7b019f568e8de781f07961e9e1
BLAKE2b-256 checksum
How to use checksums
d78d7e32ecbcdb4269ae4e7feb78078f62869b652a4527d81215f1f846164f87
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL scatrs-0.2.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 861.4 kB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
33c7e538d0a6bed6dcb727fb45b5f13f91c067b9d46c2d7b3bdf518008ab14f7
BLAKE2b-256 checksum
How to use checksums
f3e487c153e6988915b75237555988ba37b758aaba58a6fe38bad9eaabb995cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL scatrs-0.2.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 780.2 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
286499911dd0715c82068ed04f613bdaf6f5d02338957bbee4f7657e6f6eb911
BLAKE2b-256 checksum
How to use checksums
46f579ee0877aced361f4d874e41a2fb08644ffc9a7b57b90c49cab12275524b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL scatrs-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 651.1 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
62cf1a43d36cd12af49d5c1dc41e5aa30a9707c9025f9ba5e96f07e107c77e30
BLAKE2b-256 checksum
How to use checksums
e3a2b846cfbcb527eba34a561c811161e726fd7548253d4c66721739b5806be9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL scatrs-0.2.0-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 692.1 kB
Tags CPython 3.11 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
6adb8a23870bbf6df261fee64fda8ac389258fc4bd28acea24e1968a7a402202
BLAKE2b-256 checksum
How to use checksums
642cec9ced8df811d7ac71dd523dab15825a680dd1844024b7d024bab72dc823
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL scatrs-0.2.0-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 701.7 kB
Tags CPython 3.11 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
3e7ed4a7128de830a8e0c154c9b1e6b45f757d05649efbd3ca654788e6a07512
BLAKE2b-256 checksum
How to use checksums
35ecdd44d5eb2d81eedcfcfd6886a098103173cdefed04be40618d89ae027015
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL scatrs-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 602.1 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d800b903f3e1eda7c364146ad2faf77ccd9f898109414e76a49ddaa107da42cc
BLAKE2b-256 checksum
How to use checksums
39cc31f0a4113ef143cc2beef2cb76e9da9db334a5cac3ca38207774fdc337ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL scatrs-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
Size 568.7 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
11c1e0342fd1f014aa730244f46321f0e24ad99179737cc622b3e7ed01923ba3
BLAKE2b-256 checksum
How to use checksums
e7b9ef626befb7552d07262913f9c894572e024c2e71d620942c0345b869ebe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / scatrs-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL scatrs-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 610.3 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
83f28de1d5647f2690c149be73f2f9047288a08a2ab2ad9ba8c611d9a8839c8d
BLAKE2b-256 checksum
How to use checksums
fd1ee9e9cd7fc326fbe52e073e8e9f767020c56c688c925788c237dc0472cdc6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.0

11 release files

This release

0.2.0 This release

11 release files

0.1.0

11 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page