All Projects → scottprahl → miepython

scottprahl / miepython

Licence: MIT license
Mie scattering of light off perfect spheres in python

Programming Languages

python
139335 projects - #7 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to miepython

miepy
Python module to solve Maxwell's equations for a cluster of particles using the generalized multiparticle Mie theory (GMMT)
Stars: ✭ 24 (-78.76%)
Mutual labels:  scattering
pytmatrix
Python code for T-matrix scattering calculations
Stars: ✭ 68 (-39.82%)
Mutual labels:  scattering
MultipleScattering.jl
A Julia library for simulating, processing, and plotting multiple scattering of waves.
Stars: ✭ 35 (-69.03%)
Mutual labels:  scattering
ncrystal
NCrystal : a library for thermal neutron transport in crystals and other materials
Stars: ✭ 27 (-76.11%)
Mutual labels:  scattering
picaso
A Planetary Intensity Code for Atmospheric Spectroscopy Observations
Stars: ✭ 27 (-76.11%)
Mutual labels:  scattering

miepython

by Scott Prahl


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 --user 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].