Mie scattering of a plane wave by a sphere
Project description
miepython is a pure Python module to calculate light scattering for non-absorbing, partially-absorbing, or perfectly-conducting spheres. Mie theory is used, following the procedure described by Wiscombe. This code has been validated against his results.
This code provides functions for calculating the extinction efficiency, scattering efficiency, backscattering, and scattering asymmetry. Moreover, a set of angles can be given to calculate the scattering for a sphere at each of those angles.
Pay Attention!
When comparing different Mie scattering codes, make sure that you’re aware of the conventions used by each code. miepython makes the following assumptions
the imaginary part of the complex index of refraction for absorbing spheres is negative.
the scattering phase function is normalized so it equals the single scattering albedo when integrated over 4π steradians.
Using miepython
You can install locally using pip:
pip install --user miepython
or run this code in the cloud using Google Collaboratory by selecting the Jupyter notebook that interests you.
An example
The following code:
import miepython m = 1.5-1j x = 1 qext, qsca, qback, g = miepython.mie(m,x) print("The extinction efficiency is %.3f" % qext) print("The scattering efficiency is %.3f" % qsca) print("The backscatter efficiency is %.3f" % qback) print("The scattering anisotropy is %.3f" % g)
should produce:
The extinction efficiency is 2.336 The scattering efficiency is 0.663 The backscatter efficiency is 0.573 The scattering anisotropy is 0.192
Here are a few short scripts in the github repository.
Detailed documentation is available at <https://miepython.readthedocs.io>
License
miepython is licensed under the terms of the MIT license.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for miepython-2.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5fafcdef8d6e614d041426c607b017c64f4574c0a7c707c0f26467099cb06981 |
|
MD5 | 7bfced60243e0e7950fb6a4fcb379faf |
|
BLAKE2b-256 | 13541380219d3b9258d935bd70ee0a04a345194e141dce6b70f16cf9008f3b39 |