GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - MartinPdeS/PyMieSim: Python framework for fast Lorenz Mie scattering simulations, including far field scattering, efficiencies, cross sections, and detector coupling for spheres and cylinders.

BranchesTags
Open more actions menu

Latest commit

 

History

933 Commits
933 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
PyMieSim
PyMieSim
 
 
conda.recipe
conda.recipe
 
 
cpp
cpp
 
 
development
development
 
 
docs
docs
 
 
tests
tests
 
 
tools
tools
 
 
.clang-format
.clang-format
 
 
.coveragerc
.coveragerc
 
 
.flake8
.flake8
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.zenodo.json
.zenodo.json
 
 
AGENTS.md
AGENTS.md
 
 
CITATION.cff
CITATION.cff
 
 
CMakeLists.txt
CMakeLists.txt
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
README.rst
README.rst
 
 
USAGE.rst
USAGE.rst
 
 
makefile
makefile
 
 
notebook.ipynb
notebook.ipynb
 
 
pyproject.toml
pyproject.toml
 
 
pytest.ini
pytest.ini
 
 
readme.yml
readme.yml
 
 

Repository files navigation

PyMieSim

PyMieSim logo

Badge Status
Python versions Supported Python versions
Documentation Documentation
Tests Tests Test coverage
PyPI PyPI version Monthly PyPI downloads
Conda Anaconda version Anaconda downloads Latest Anaconda release

A package for light scattering (Mie) computation.

Try online with PyMieSimX

Calculate scattering by spheres, coated spheres, and cylinders. Specify the incident field, particle geometry, and optical material, then sweep one input to see how scattering efficiency or detector coupling changes.

See the usage guide for further examples and implementation details. Open the project notebook in Colab.

Installation

Requires Python >=3.10.

$ python -m pip install PyMieSim

Install from the martinpdes Conda channel:

$ conda install -c martinpdes pymiesim

For an editable source installation:

$ git clone https://github.com/MartinPdeS/PyMieSim.git
$ cd PyMieSim
$ python -m pip install -e .

Sweep sphere diameter

"""
Sphere: Qsca vs diameter
========================

"""

import PyOptik
from PyMieSim import from_pyoptik
import numpy as np

from PyMieSim import (
    Measure,
    ureg,
    SphereSet,
    GaussianSet,
    PolarizationSet,
    MaterialSet,
    MediumSet,
    Experiment,
)


polarization_set = PolarizationSet(
    angles=[0.0] * ureg.degree,
)

source = GaussianSet(
    wavelength=[405] * ureg.nanometer,
    polarization=polarization_set,
    optical_power=[1e-3] * ureg.watt,
    numerical_aperture=[0.2],
)

bk7 = from_pyoptik(PyOptik.load_material(name="specs/SCHOTT-optical/P-BK7"))

scatterer = SphereSet(
    diameter=np.linspace(10, 1000, 150) * ureg.nanometer,
    material=MaterialSet(materials=[bk7]),
    medium=MediumSet(refractive_indices=[1.33, 1.34, 1.5]),
)

experiment = Experiment(scatterer_set=scatterer, source_set=source)

result = experiment.run(Measure.QSCA)

print("Result dimensions and shape:", result.dims, result.shape)
print("Measure units:", result.units)

result.plot(x="scatterer:diameter", show=True)
https://raw.githubusercontent.com/MartinPdeS/PyMieSim/HEAD/docs/images/Qsca_diameter.png

Scattering efficiency as a function of sphere diameter.

Documentation

Use the PyMieSim documentation to work through examples and look up the inputs and return values of individual functions.

Citation

For the scattering model and its validation, cite the PyMieSim paper in Optics Continuum.

Contributing

Bug reports, worked examples, and documentation corrections are welcome. To set up a development checkout and run the tests, follow the contributing guide.

Contact

For questions, contact Martin Poinsinet de Sivry-Houle.

License

See the PyMieSim license for terms of use.

About

Python framework for fast Lorenz Mie scattering simulations, including far field scattering, efficiencies, cross sections, and detector coupling for spheres and cylinders.

martinpdes.github.io/PyMieSim/

Topics

computational-physicscpplight-scatteringlight-scattering-opticslorenz-mie-theorymie-scatteringoptical-modelingpybind11pyhonscientific-computing

Resources

Readme
MIT license

Contributing

Contributing
Activity

Stars

40 stars

Watchers

5 watching

Forks

10 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.