xopto.pf.mie module

class Mie(nsphere: float, nmedium: float, diameter: float, wavelength: float)[source]

Bases: xopto.pf.pfbase.PfBase

Mie scattering phase function of spherical particles.

Parameters
  • nsphere (float or complex) – Refractive index (complex) of the spherical particle.

  • nmedium (float or complex) – Refractive index (complex) of the surrounding medium.

  • diameter (float) – Diameter of the spherical particle (m).

  • wavelength (float) – Wavelength of light (m).

Examples

Mie scattering phase function for a 1 um spherical particle (refractive index 1.6) at 550 nm in water (refractive index 1.33).

>>> import numpy as np
>>> from matplotlib import pyplot as pp
>>>
>>> cos_theta = np.linspace(-1.0, 1.0, 1000)
>>>
>>> pp.figure()
>>> for d in [0.1, 0.5, 1, 2, 5]:
>>>   pf = Mie(1.6, 1.33, d*1e-6, 550e-9)
>>>   pp.semilogy(cos_theta, pf(cos_theta), label='Monodisperse({} um)'.format(d))
>>> pp.legend()
acs()float[source]

Returns the absorption cross section.

ecs()float[source]

Returns the extinction cross section.

fastg(n: int, *args, **kwargs)float[source]

Overloads the PfBase.fastg() method of the base class.

Note

If n is 1, a precalculated g1 is returned.

g(n: int, **kwargs)float[source]

Overloads the PfBase.g() method of the base class. Computes the n-th Legendre moment of the scattering phase function.

Note

If n is 1, a precalculated g1 is returned.

scs()float[source]

Returns the scattering cross section.