Skip to main content

A Python package to calculate light scattering properties/parameters of spherical particles by using Mie theory.

Project description

This Python package calculates light scattering properties/parameters of spheres by using Mie theory.

This has been developed from a mie theory program originally written in FORTRAN and published in the paper: Ghanshyam A. Shah, "Numerical Methods for Mie Theory of Scattering by a Sphere",Kodaikanal Obs. Bull. Soc.(1977) 2, 42-63.

  • Python form developed by Dwaipayan Deb (2025)

Install command:

pip install mieshah

Use example:

import mieshah as ms
from matplotlib import pyplot as plt

# ps-> particle radius(microns), wl-> wavelength (microns), m-> complex refractive index (real,imaginary), 
# f-> Size distribution function, incr-> increment for size distribution function
# theta-> Scattering angle (optional) (e.g. theta=30 or theta=[10,45]). If it is not given then default range is [0,180]. 

mymie = ms.miescatter(ps=[0.1,1], wl=6.283185307,m=(1.5,0),f="x**-2",incr=0.01,theta=[10,45])  # With size distribution function and a given theta range
mymie = ms.miescatter(ps=[0.1,1], wl=6.283185307,m=(1.5,0),f="x**-2",incr=0.01)  # With size distribution function with default theta range
mymie = ms.miescatter(ps=100, wl=6.283185307,m=(1.5,0.0),theta=30) # Without size distribution function (single particle) at 30 deg. scattering angle

print(mymie.ps)
print(mymie.wl)
print(mymie.m)
print(mymie.f)
print(mymie.X) # Size parameter
print(mymie.ALBED) # Albedo
print(mymie.QSCA) # Scattering efficiency
print(mymie.QEXT) # Extinction efficiency
print(mymie.QBAK) # Backscattering efficiency
print(mymie.QABS) # Absorption efficiency
print(mymie.QPR) # Radiation pressure efficiency
print(mymie.I_perp) # Intensity perpendicular to the plane of incidence
print(mymie.I_parl) # Intensity parallel to the plane of incidence
print(mymie.Polar) # Degree of linear polarization
print(mymie.p_theta) # Phase function
print(mymie.theta) # Scattering angle in degrees

plt.plot(mymie.theta[::2], mymie.Polar[::2])
plt.xlabel('Theta (degrees)')
plt.ylabel('Polarization')
plt.title('Degree of Linear Polarization')
plt.show()
plt.plot(mymie.theta[::2], mymie.p_theta[::2])
plt.yscale('log')    
plt.xlabel('Theta (degrees)')
plt.ylabel('Phase Function')
plt.title('Phase Function')
plt.show()

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

mieshah-0.0.3.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

mieshah-0.0.3-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file mieshah-0.0.3.tar.gz.

File metadata

  • Download URL: mieshah-0.0.3.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for mieshah-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ca09dbd097c2b166207f01aa22445ef9de5501fa28dbe04dc82af61200e77072
MD5 e25b5518687bc0c1c3d484071d3db2b7
BLAKE2b-256 14e1e8774e1e0bc07e45b6d0ca87f83ab130b1ebfc1b46bee398538b62052981

See more details on using hashes here.

File details

Details for the file mieshah-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: mieshah-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0

File hashes

Hashes for mieshah-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ef90343a270124311f397c0be7e8493000100ba038cb9d36a9eff43207812eb8
MD5 c246e2bfb7cd8501a4519ef4c0e98898
BLAKE2b-256 8cda0a86ff222de589eeef77acecf90af27cb0cbe6e0c29991117cc97735a931

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