Skip to main content

Mie scattering of a plane wave by a sphere

Project description

miepython is a pure Python module to calculate light scattering by non-absorbing, partially-absorbing, or perfectly conducting spheres. Mie theory is used, following the procedure described by Wiscombe <http://opensky.ucar.edu/islandora/object/technotes:232>. This code has been validated against his results.

Extensive documentation is at <https://miepython.readthedocs.io>

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.

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.

Installation

Just use pip:

pip install --user miepython

Usage

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

Detailed documentation is available at <https://miepython.readthedocs.io>

There are a few short scripts in the github repository.

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-1.3.2.tar.gz (16.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: miepython-1.3.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.6

File hashes

Hashes for miepython-1.3.2.tar.gz
Algorithm Hash digest
SHA256 aa697c546a5b16c9084ad5f3636fa167f19e132be109530c4457aa7097f41024
MD5 90ead1df2152e6b62ae14af2a7b360fe
BLAKE2b-256 0002a3a7d398c322ca3035d4ba8f3c0f71daf82fca3947ec3d65db126931e82e

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