{"id":22572253,"url":"https://github.com/scottprahl/miepython","last_synced_at":"2026-01-03T01:22:30.512Z","repository":{"id":44708578,"uuid":"99259684","full_name":"scottprahl/miepython","owner":"scottprahl","description":"Mie scattering of light by perfect spheres","archived":false,"fork":false,"pushed_at":"2025-04-28T17:13:00.000Z","size":25201,"stargazers_count":181,"open_issues_count":3,"forks_count":58,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-04-28T18:26:22.641Z","etag":null,"topics":["jupyter-notebook","python","scattering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scottprahl.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-08-03T17:43:32.000Z","updated_at":"2025-04-28T17:13:03.000Z","dependencies_parsed_at":"2022-09-06T02:42:16.562Z","dependency_job_id":"b4e54451-040f-4802-b3f6-7e5b7f9d499d","html_url":"https://github.com/scottprahl/miepython","commit_stats":{"total_commits":349,"total_committers":9,"mean_commits":38.77777777777778,"dds":"0.17478510028653294","last_synced_commit":"5f201963eda2e8a44b9f243a06d5bfa074f98e50"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottprahl%2Fmiepython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottprahl%2Fmiepython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottprahl%2Fmiepython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scottprahl%2Fmiepython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scottprahl","download_url":"https://codeload.github.com/scottprahl/miepython/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414493,"owners_count":22067271,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["jupyter-notebook","python","scattering"],"created_at":"2024-12-08T02:08:39.014Z","updated_at":"2026-01-03T01:22:30.506Z","avatar_url":"https://github.com/scottprahl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":".. |pypi| image:: https://img.shields.io/pypi/v/miepython?color=68CA66\n   :target: https://pypi.org/project/miepython/\n   :alt: PyPI\n\n.. |github| image:: https://img.shields.io/github/v/tag/scottprahl/miepython?label=github\u0026color=68CA66\n   :target: https://github.com/scottprahl/miepython\n   :alt: GitHub\n\n.. |conda| image:: https://img.shields.io/conda/vn/conda-forge/miepython?label=conda\u0026color=68CA66\n   :target: https://github.com/conda-forge/miepython-feedstock\n   :alt: Conda\n\n.. |doi| image:: https://zenodo.org/badge/99259684.svg\n   :target: https://zenodo.org/badge/latestdoi/99259684\n   :alt: DOI\n\n.. |license| image:: https://img.shields.io/github/license/scottprahl/miepython?color=68CA66\n   :target: https://github.com/scottprahl/miepython/blob/master/LICENSE.txt\n   :alt: License\n\n.. |test| image:: https://github.com/scottprahl/miepython/actions/workflows/test.yml/badge.svg\n   :target: https://github.com/scottprahl/miepython/actions/workflows/test.yml\n   :alt: Testing\n\n.. |docs| image:: https://readthedocs.org/projects/miepython/badge?color=68CA66\n   :target: https://miepython.readthedocs.io\n   :alt: Docs\n\n.. |downloads| image:: https://img.shields.io/pypi/dm/miepython?color=68CA66\n   :target: https://pypi.org/project/miepython/\n   :alt: Downloads\n\n.. |lite| image:: https://img.shields.io/badge/try-JupyterLite-68CA66.svg\n   :target: https://scottprahl.github.io/miepython/\n   :alt: Try JupyterLite\n\n\nmiepython\n=========\n\n|pypi| |github| |conda| |doi|  \n\n|license| |test| |docs| |downloads|  \n\n|lite|\n\nMie scattering calculations in pure Python\n------------------------------------------\n\n``miepython`` provides a validated and efficient implementation of Mie scattering for spherical particles.  \nIt reproduces established reference results (including Wiscombe's MIEV0) and is designed for scientific, educational, and computational research applications in optics.\n\nThe library implements the full Mie solution, including:\n\n- extinction, scattering, and absorption efficiencies\n- asymmetry parameter (scattering anisotropy)\n- angle-resolved scattering intensities\n- Mie expansion coefficients\n- complex amplitude functions and Mueller matrices\n\nThe implementation is numerically stable for a wide range of size parameters and refractive indices, including lossy materials and high-index contrasts.\n\nImmediate Use in the Browser\n----------------------------\n\nThe entire package can be used **immediately** in a browser — without installation — using the JupyterLite interface:\n\n|lite|\n\nThis environment runs entirely client-side (Pyodide), and supports:\n\n- interactive notebooks  \n- real-time plotting  \n- full access to ``miepython`` functions  \n- reproducible experiments (downloadable notebooks)\n\nThis makes it ideal for teaching, demonstrations, or quick exploratory calculations.\n\nInstallation\n------------\n\nInstall with pip:\n\n.. code-block:: bash\n\n    pip install miepython\n\nOr via conda:\n\n.. code-block:: bash\n\n    conda install -c conda-forge miepython\n\nQuick Start\n-----------\n\nA typical calculation is straightforward:\n\n.. code-block:: python\n\n    import miepython as mie\n\n    m = 1.5 - 0.1j     # refractive index\n    d = 100            # diameter (nm)\n    lambda0 = 314.15   # wavelength (nm)\n\n    qext, qsca, qback, g = mie.efficiencies(m, d, lambda0)\n\nDocumentation and Examples\n--------------------------\n\nThe full documentation is available as:\n\nInteractive documentation (JupyterLite):\n    |lite|\n\nStatic Jupyter notebooks on ReadTheDocs:\n    |docs|\n\nAmong other things the documentation discusses:\n\n- **Mathematical formulation of Mie theory**  \n  https://miepython.readthedocs.io/en/latest/01_theory.html\n\n- **Normalization conventions and units**  \n  https://miepython.readthedocs.io/en/latest/02_normalization.html\n\n- **Numerical stability considerations**  \n  https://miepython.readthedocs.io/en/latest/03_stability.html\n\n- **Validation against MIEV0 and other reference implementations**  \n  https://miepython.readthedocs.io/en/latest/04_validation.html\n\n- **Guidelines for parameter choices and truncation order**  \n  https://miepython.readthedocs.io/en/latest/05_truncation.html\n\n- **Physical interpretation, resonances, and comparison plots**  \n  https://miepython.readthedocs.io/en/latest/06_examples.html\n\nRepresentative results simple examples:\n\n    https://github.com/scottprahl/miepython/tree/main/miepython/examples\n\n.. image:: https://raw.githubusercontent.com/scottprahl/miepython/main/docs/images/01.svg\n.. image:: https://raw.githubusercontent.com/scottprahl/miepython/main/docs/images/02.svg\n.. image:: https://raw.githubusercontent.com/scottprahl/miepython/main/docs/images/03.svg\n.. image:: https://raw.githubusercontent.com/scottprahl/miepython/main/docs/images/04.svg\n\nPerformance and Acceleration\n----------------------------\n\n``miepython`` supports optional Numba JIT compilation:\n\n.. code-block:: python\n\n    import os\n    os.environ[\"MIEPYTHON_USE_JIT\"] = \"1\"  # must be set before import\n    import miepython\n\nThis can provide 10–50× speedups for large parameter sweeps or ensemble calculations.\n\nBenchmark example (100,000 particles):\n\n============ ============ ==========\nVersion      Time         Speedup\n============ ============ ==========\nPure Python  4.00 s       1×\nJIT Enabled  0.15 s       27×\n============ ============ ==========\n\nCitation\n--------\n\nIf you use ``laserbeamsize`` in academic, instructional, or applied technical work, please cite:\n\nPrahl, S. (2026). *miepython: Pure python calculation of Mie scattering* (Version 3.0.5) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.7949263\n\nBibTeX:\n\n.. code-block:: bibtex\n\n    @software{prahl_miepython_2025,\n      author  = {Scott Prahl},\n      title   = {{miepython}: A Python library for Mie scattering calculations},\n      url     = {https://github.com/scottprahl/miepython},\n      doi     = {10.5281/zenodo.7949263},\n      year    = {2026},\n      version = {3.0.5},\n      publisher = {Zenodo}\n    }\n\nLicense\n-------\n\n``miepython`` is released under the MIT License.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottprahl%2Fmiepython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscottprahl%2Fmiepython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscottprahl%2Fmiepython/lists"}