efficiencies_mx
- miepython.core.efficiencies_mx(m, x, n_pole=0, e_field=True)[source]
Computes scattering and extinction efficiencies for a spherical particle using Mie theory.
Supports array inputs for wavelength-dependent calculations of the refractive index and size parameter.
- Parameters:
m (complex or array-like) – Complex refractive index of the sphere, defined as m = n - ik, where n is the real part (phase velocity) and k is the imaginary part (absorption). Can be a scalar or an array.
x (float or array-like) – Size parameter of the sphere, defined as x = π d / λ, where d is the diameter of the sphere and λ is the wavelength in the surrounding medium. Can be a scalar or an array.
n_pole (int) – Multipole order to compute: - If 0 (default), computes contributions from all multipoles. - If non-zero, computes contributions from the specified multipole order.
e_field (boolean) – When n_pole>0, selects which multipole of that order contributes: True gives the electric multipole a_n, False the magnetic multipole b_n. The two add up to the full order-n_pole contribution for qext and qsca. Ignored when n_pole is 0.
- Returns:
tuple –
- qext (float or array-like):
Extinction efficiency, representing the total attenuation of light (scattering plus absorption) by the particle.
- qsca (float or array-like):
Scattering efficiency, representing the fraction of incident light scattered by the particle.
- qback (float or array-like):
Backscattering efficiency, describing the fraction of incident light scattered in the exact backward direction (theta = 180 degrees).
- g (float or array-like):
Asymmetry parameter, representing the average cosine of the scattering angle over all angles. This is exactly zero when n_pole > 0, because a single multipole of one parity scatters symmetrically about 90 degrees.
Notes
Ensure m and x have compatible dimensions if passed as arrays.
For accurate results, n_pole should be within the range of significant multipole contributions, typically n ~ x + 4*x**(1/3).
This implementation assumes spherical, homogeneous particles in a non-absorbing medium.
Examples
Compute efficiencies for one sphere:
>>> import miepython as mie >>> qext, qsca, qback, g = mie.efficiencies_mx(1.5 - 0.01j, 2.0) >>> print(f"{qext:.6f} {qsca:.6f} {qback:.6f} {g:.6f}") 1.812597 1.724396 0.266214 0.630214
Compute efficiencies for a wavelength-dependent refractive index:
>>> import numpy as np >>> m_array = np.array([1.5 - 0.01j, 1.45 - 0.02j]) >>> x_array = np.array([2.0, 2.5]) >>> qext, qsca, qback, g = mie.efficiencies_mx(m_array, x_array) >>> np.round(qext, 6) array([1.812597, 2.14972 ])
Use
efficiencies()instead when the diameter and wavelength are known rather than the size parameter.