Online user’s guide for the Python Mie Scattering package (PyMieScatt)

Documentation is always under development, but mostly complete. A manuscript communicating the development of the inverse Mie algorithms was published by the Journal of Quantative Spectroscopy and Radiative Transfer. The JQSRT article is available here.

NOTE TO USERS: When using PyMieScatt, pay close attention to the units of the your inputs and outputs. Wavelength and particle diameters are always in nanometers, efficiencies are unitless, cross-sections are in nm2, coefficients are in Mm-1, and size distribution concentration is always in cm-3. If you use other units, your outputs may not make sense.

NOTE TO THOSE WITH MIEPLOT EXPERIENCE: The functions in PyMieScatt take particle diameter. MiePlot’s default is to take the particle radius in micrometers. Make sure all your particle dimensions, whether for a single particle or for a distribution, are for the diamaters, in nanometers.

Install PyMieScatt

NOTE: You must install Shapely first, preferably from GitHub. Users have reported difficulty installing it with pip. Conda works, too.

The current version is 1.8.0. You can install PyMieScatt from The Python Package Index (PyPI) with

$ pip install PyMieScatt

or from GitHub. Clone the repository and then run

$ python setup.py install

Revision Notes - version 1.8.1 (29 December, 2020)

  • Tentatively fixed Mie_SD() per discussions with Kyle Gorkowski. Added a new optional parameter SMPS which informs the algorithm how the size distribution is reported. PyMieScatt assumes SMPS is True, that is, that the reported size distribution came from a laboratory measurement and not a mathematically-generated size distribution. Set SMPS to False if you constructed your distribution from an analytical expression.
  • Following from that, Mie_Lognormal() is hardwired to use the analytical form and no additional input is needed.
  • Also following from the fix to Mie_SD(), the inverse algorithms ContourIntersection_SD() and SurveyIteration_SD() now have the optional parameter SMPS, with the same assumptions as Mie_SD(). See the individual function documentation for more information.
  • This fix does not apply to the scattered intensity function SF_SD(), since the scattering intensity function is additive in the way it is formulated here.
  • 1.8.1 minor update: fixed a bug in cRatio where the result was off by a factor of the physical cross-sectional area (thank you, TalfanBarnie on Github) and added nMedium to the core-shell functions (thank you, willmendil on Github).

Revision History

  • 1.7.5 (23 February, 2020)
    • Fixed AutoMieQ() per discussions with Gerard van Ewijk. In the case of nMedium!=1, AutoMieQ() was calculating effective n and wavelength, and then passing those parameters to the relevant Mie function. Those functions then re-calculated the effective n and wavelength, leading to errors.
    • Fixed ContourIntersection_SD() per discussions with Hans Moosmuller. The inputs should now correctly scale for units of Mm-1.
  • 1.7.4 (6 May, 2019)
    • Fixed ScatteringFunction() per discussions with @zcm73400 on GitHub. View the pull request for more info.
  • 1.7.3 (23 August, 2018) - 1.7.2 was skipped ¯\_(ツ)_/¯
  • 1.7.1 (12 April, 2018)
  • 1.7.0 (5 April, 2018)
    • Updated most of the forward homogeneous sphere functions with a new optional parameter nMedium, which allows for Mie calculations in media other than vacuum/air. Please see documentation.
  • 1.6.0b0 (23 March, 2018)
  • 1.5.2 (9 March, 2018)
  • 1.5.1 (7 March, 2018)
  • 1.4.3 (21 February, 2018)
  • 1.4.2 (25 January, 2018)
    • Very minor adjustment to AutoMieQ(); changed the crossover from Rayleigh to Mie to x=0.01 (previously 0.5). Thanks to John Kendrick for the suggestion.
  • 1.4.1 (25 January, 2018)
    • Added Shapely support! Shapely is a geometric manipulation and analysis package. I wrote it in as a slightly faster, more robust way to look for intersections in n-k space when doing inversions. It also makes the code more readable and makes it clearer how the intersection method works, especially when including backscatter to find a unique solution. There is no change to the user experience, other than slight speedups.
  • 1.3.7
  • 1.3.6
  • 1.3.5
    • Fixed a bug that prevented SF_SD from properly scaling with the number of particles.
  • 1.3.4.1
    • Added a new sub-version delimiter. 1.x.y.z will be for minor revisions including some optimizations I’ve been working on that don’t merit a full 1.x.y release.
    • Added a new AutoMie_ab() function that uses LowFrequencyMie_ab() for x = πd/λ < 0.5 and Mie_ab() otherwise.
    • Sped up the MieS1S2() function by using the new AutoMie_ab() function.
    • Sped up the SF_SD() function by about 33% (on average) when the MieS1S2() optimizations are considered.
    • Added Mie_cd() to __init__.py.
  • 1.3.4
    • Fixed a really dumb bug introduced in 1.3.3.
  • 1.3.3
    • Fixed a big that caused SF_SD() to throw errors when a custom angle range was specified.
    • Added MieS1S2() and MiePiTau() to __init__.py. Dunno why they weren’t always there.
  • 1.3.2
    • Renamed GraphicalInversion() and GraphicalInversion_SD() to ContourIntersection() and ContourIntersection_SD(), respectively.
  • 1.3.1
    • Optimizations to the resolution of the survey-intersection inversion method.

Revisions in Progress

  • Would like to re-write the inversion functions to be as general as possible, i.e., if I pass scattering, absorption, particle size, and refractive index, it would solve for the wavelength.
  • Ablility to pass array objects directly to all functions (within reason).
  • Auto-graphing capabilities for sacttering functions.

Documentation To-Do List

  • More example scripts, I guess?
  • As a few function names and parameter names get updated, there may be some typos in old examples. I’ll catch those as they crop up.

PyMieScatt To-Do List

  • Upload package to Anaconda cloud.

Publications Using PyMieScatt

If you use PyMieScatt in your research, please let me know and I’ll link the publications here.

  • Google scholar link with all citations.
  • My own work using PyMieScatt:
    • Sumlin BJ, Pandey A, Walker MJ, Pattison RS, Williams BJ, Chakrabarty RK. Atmospheric Photooxidation Diminishes Light Absorption by Primary Brown Carbon Aerosol from Biomass Burning. Environ Sci Tech Let. 2017 4 (12) 540-545 (Cover article). DOI: 10.1021/acs.estlett.7b00393
    • Sumlin BJ, Heinson WR, Chakrabarty RK. Retrieving the Aerosol Complex Refractive Index using PyMieScatt: A Mie Computational Package with Visualization Capabilities. J. Quant. Spectros. Rad. Trans. 2018 (205) 127-134. DOI: 10.1016/j.jqsrt.2017.10.012
    • Sumlin BJ, Heinson YW, Shetty N, Pandey A, Pattison RS, Baker S, Hao WM, Chakrabarty RK. UV-Vis-IR Spectral Complex Refractive Indices and Optical Properties of Brown Carbon Aerosol fro Biomass Burning. J. Quant. Spectros. Rad. Trans. 2018 (206) 392-398 DOI: 10.1016/j.jqsrt.2017.12.009
    • Sumlin BJ, Oxford C, Seo B, Pattison R, Williams B, Chakrabarty RK. Density and Homogeneous Internal Composition of Primary Brown Carbon Aerosol. Environ. Sci. Tech., In press. DOI: 10.1021/acs.est.8b00093
  • Works by others
    • Carrico, C. M., Capek, T. J., Gorkowski, K. J., Lam, J. T., Gulick, S., Karacaoglu, J., Lee, J. E., Dungan, C., Aiken, A. C., Onasch, T. B., Freedman, A., Mazzoleni, C., & Dubey, M. K. (2021). Humidified single-scattering albedometer (H-CAPS-PM SSA ): Design, data analysis, and validation. Aerosol Science and Technology, 1–20. DOI: 10.1080/02786826.2021.1895430
    • Gorkowski, K., Benedict, K. B., Carrico, C. M., & Dubey, M. K. (2022). Complexities in Modeling Organic Aerosol Light Absorption. The Journal of Physical Chemistry A, 126(29), 4827–4833. DOI: 10.1021/acs.jpca.2c02236