Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/scottprahl/miepython
Mie scattering of light by perfect spheres
https://github.com/scottprahl/miepython
jupyter-notebook python scattering
Last synced: 6 days ago
JSON representation
Mie scattering of light by perfect spheres
- Host: GitHub
- URL: https://github.com/scottprahl/miepython
- Owner: scottprahl
- License: mit
- Created: 2017-08-03T17:43:32.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-12-15T04:30:18.000Z (27 days ago)
- Last Synced: 2024-12-29T05:03:02.723Z (13 days ago)
- Topics: jupyter-notebook, python, scattering
- Language: Python
- Homepage:
- Size: 19.3 MB
- Stars: 165
- Watchers: 11
- Forks: 55
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE.txt
- Citation: CITATION.cff
Awesome Lists containing this project
README
miepython
=========by Scott Prahl
.. image:: https://img.shields.io/pypi/v/miepython?color=68CA66
:target: https://pypi.org/project/miepython/
:alt: pypi.. image:: https://img.shields.io/github/v/tag/scottprahl/miepython?label=github&color=68CA66
:target: https://github.com/scottprahl/miepython
:alt: github.. image:: https://img.shields.io/conda/vn/conda-forge/miepython?label=conda&color=68CA66
:target: https://github.com/conda-forge/miepython-feedstock
:alt: conda.. image:: https://zenodo.org/badge/99259684.svg
:target: https://zenodo.org/badge/latestdoi/99259684
:alt: doi|
.. image:: https://img.shields.io/github/license/scottprahl/miepython?color=68CA66
:target: https://github.com/scottprahl/miepython/blob/master/LICENSE.txt
:alt: License.. image:: https://github.com/scottprahl/miepython/actions/workflows/test.yml/badge.svg
:target: https://github.com/scottprahl/miepython/actions/workflows/test.yml
:alt: Testing.. image:: https://readthedocs.org/projects/miepython/badge?color=68CA66
:target: https://miepython.readthedocs.io
:alt: Docs.. image:: https://img.shields.io/pypi/dm/miepython?color=68CA66
:target: https://pypi.org/project/miepython/
:alt: Downloads__________
``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
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. As of version 2.3, this can be changed.
Installation
---------------Use ``pip``::
pip install miepython
or ``conda``::
conda install -c conda-forge 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.192There are a few short scripts in the github repository.
* `Extinction Efficiency of Absorbing and Non-Absorbing Spheres `_
* `Four Micron Glass Spheres `_* `One Micron Water Droplets `_
* `Gold Nanospheres `_
License
-------``miepython`` is licensed under the terms of the MIT license.