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
from scatrs import ensemble, 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 = ensemble.LogNormal(median_radius=0.08, width=1.6)
r = ensemble.compute(sulfate, [0.35, 0.55, 1.0], 1.43 + 1e-8j, 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.1.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.1.0
File Size Uploaded
scatrs-0.1.0.tar.gz 179.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for scatrs 0.1.0
File
scatrs-0.1.0-cp311-abi3-win_arm64.whl CPython 3.11 abi3 Windows ARM64 Details
scatrs-0.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details
scatrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl CPython 3.11 abi3 Linux musl 1.2+ x86-64 Details
scatrs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl CPython 3.11 abi3 Linux musl 1.2+ ARM64 Details
scatrs-0.1.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.1.0-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl CPython 3.11 abi3 Linux glibc 2.17+ IBM System/390x Details
scatrs-0.1.0-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl CPython 3.11 abi3 Linux glibc 2.17+ PowerPC 64-le Details
scatrs-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details
scatrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details
scatrs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details

Total release size: 8.7 MB

Release files / scatrs-0.1.0.tar.gz

Download URL scatrs-0.1.0.tar.gz
Size 179.9 kB
Tags Source
SHA-256 checksum
How to use checksums
dadf5b30b9b55930555c5ccae64236ed57e5a6b43b28b61a15b4cbc89ed30d33
BLAKE2b-256 checksum
How to use checksums
5035ffff94679b350dd53a843236e8f20a2ffe2ce15f30ed7e3e1d76371a8005
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.1.0-cp311-abi3-win_arm64.whl

Download URL scatrs-0.1.0-cp311-abi3-win_arm64.whl
Size 571.3 kB
Tags CPython 3.11 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
a711b26781b36a6fb8c5b2efd645d51009a56ac0c8fec0f6a0a239de4e753b14
BLAKE2b-256 checksum
How to use checksums
4d242e6e19b4874339d324e99047c724d23866bad0140b842984f6b4003c98a1
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.1.0-cp311-abi3-win_amd64.whl

Download URL scatrs-0.1.0-cp311-abi3-win_amd64.whl
Size 905.4 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
457eda807c840638b5fefea6d22cdc61f5566d10556ec51dacf5d7c168a5f6c2
BLAKE2b-256 checksum
How to use checksums
3fee02643583f54a2530ca7482eeaa03e9f285503f3c4ef68160323208727a0b
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.1.0-cp311-abi3-musllinux_1_2_x86_64.whl

Download URL scatrs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
Size 1.3 MB
Tags CPython 3.11 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
af0dbfe47fb871bdde9ea3851f7a6eb1f75db55ed57017054cfdbbab805f503b
BLAKE2b-256 checksum
How to use checksums
dc740c288c4406997d836384aa1699804d84fbbbeebd8a73ba09d17e8e7f166f
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.1.0-cp311-abi3-musllinux_1_2_aarch64.whl

Download URL scatrs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl
Size 925.4 kB
Tags CPython 3.11 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
de24d9f9f340a99e906f3bf5c4ead5be595d63d44b36ed08fc8a68109abf0785
BLAKE2b-256 checksum
How to use checksums
e97fd2e66a63a095c96667adac9801ebec378978d833ad0f1d9e2e57890e180c
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.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL scatrs-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.1 MB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
18f32db4daab1d169520c4c708d81803aa053c5d0d1ba3fe3b96253dda64e0d7
BLAKE2b-256 checksum
How to use checksums
150023940fc1f6cbdbd5c4194a08bfd4e2f99fde637039e4c9b9ed84b295e8b9
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.1.0-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl

Download URL scatrs-0.1.0-cp311-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl
Size 746.0 kB
Tags CPython 3.11 Linux glibc 2.17+ IBM System/390x abi3
SHA-256 checksum
How to use checksums
7eb0ccb68b45f3034ca991f7c7d59c39d465382733931106e9e9b2e4366817c9
BLAKE2b-256 checksum
How to use checksums
5d0b6c73c92a907e5532760ac8275e4f5c9f31da63b73f99bd360e574d06f1ac
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.1.0-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl

Download URL scatrs-0.1.0-cp311-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Size 766.1 kB
Tags CPython 3.11 Linux glibc 2.17+ PowerPC 64-le abi3
SHA-256 checksum
How to use checksums
f7b556df05d77fb1bb35d47e7499c6dcdbbd8c9dd51c5a40f0d2a8544c5e763e
BLAKE2b-256 checksum
How to use checksums
5698b6f84d93fc0a11abfcbf86c953341eb1ce769ed09317ab81521c08f337da
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.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL scatrs-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 747.9 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
11249a59ce8e94aa68f0587b2dd316e4b4ba7cb0e8d98619937b01d0888e7579
BLAKE2b-256 checksum
How to use checksums
f9745a0e8085d61e7b1ada277c0681e2fe1ba62a72c3e3787c4d6b78b2926b02
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.1.0-cp311-abi3-macosx_11_0_arm64.whl

Download URL scatrs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Size 665.9 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f54123cd5c7661ab430deff426b1647082126e61cebbb3cbe832e7388069ee3f
BLAKE2b-256 checksum
How to use checksums
961778abeec217e1add32a843fb697722aa8e81a9fe525704d11c208fea14faf
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.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Download URL scatrs-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 793.1 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f0b60190bf612d787437d73035509f18f6b4ae6a3ad030419cd040448b4a835c
BLAKE2b-256 checksum
How to use checksums
108fea7171caa151f6a223ddd51a6dec7a5d667203dfacd4648edcac2b6bb468
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

0.2.0

11 release files

This release

0.1.0 This release

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