Skip to main content

Mie scattering of a plane wave by a sphere

Project description

by Scott Prahl

https://img.shields.io/pypi/v/miepython.svg https://colab.research.google.com/assets/colab-badge.svg https://img.shields.io/badge/readthedocs-latest-blue.svg https://img.shields.io/badge/github-code-green.svg https://img.shields.io/badge/MIT-license-yellow.svg https://github.com/scottprahl/miepython/actions/workflows/test.yml/badge.svg https://zenodo.org/badge/99259684.svg

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.

Full documentation at <https://miepython.readthedocs.io>

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

  1. the imaginary part of the complex index of refraction for absorbing spheres is negative.

  2. the scattering phase function is normalized so it equals the single scattering albedo when integrated over 4π steradians. As of version 2.3, this can be changed.

Using miepython

  1. You can install locally using pip:

    pip install miepython
  2. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miepython-2.3.2.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

miepython-2.3.2-py3-none-any.whl (29.9 kB view details)

Uploaded Python 3

File details

Details for the file miepython-2.3.2.tar.gz.

File metadata

  • Download URL: miepython-2.3.2.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for miepython-2.3.2.tar.gz
Algorithm Hash digest
SHA256 7cc840c4349788c2b887d85829174f4e4783b504c604edf81f05888503336ac6
MD5 6eeb51b9a0dc834c451466bd7fc80c5a
BLAKE2b-256 4f71b49043fd38eb00f1b6039596bbd9812633a3153b44aa03d73a637496bf20

See more details on using hashes here.

File details

Details for the file miepython-2.3.2-py3-none-any.whl.

File metadata

  • Download URL: miepython-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 29.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for miepython-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 96d1061d673cefac1a4f5c5f0c2041513b4bb93b2c3ec5812153a2add681efa6
MD5 9b32b560048c31aa0ae666bac8daa56d
BLAKE2b-256 791cb9fc1b2c263d0d01023d93b6eb6c6ceb3c2df546b0812ed0873362c27b1d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page