Skip to main content

A package for light scattering computation.

Project description

Logo

python zenodo colab unittest docs PyPi PyPi_download

PyMieSim

PyMieSim is a software designed for comprehensive Mie scattering analysis, featuring a user-friendly installation and operation process. The characterization of the scattering event within PyMieSim is determined by a set of specific properties, as illustrated in the subsequent figure.

Currently, PyMieSim integrates three distinct solvers tailored to three different types of scatterers: spherical particles, infinite cylindrical particles, and core-shell spherical particles. Additional parameters governing the scattering event are contingent upon the attributes of the light source and the detector (when applicable). The attributes pertinent to each of these components are delineated in the ensuing figure.

Structure of the library

The package also lets you construct an Experiment using SphereSet/CoreShellSet/CylinderSet, SourceSet and DetectorSet. Those class define the type of scatterers, light sources and detectors you want to study.


Getting started

To use PyMieSim as fast as possible, you first need to install it:

>>> pip install PyMieSim

Once this is done you can use the graphic interface as follows:

>>> python -m PyMieSim

Clicking the “Calculate” button should render the following:

Structure of the library


Documentation

All the latest available documentation is available here or you can click the following badge:

docs


Google Colab

It’s 2024, you don’t need to run all your code on you computer anymore. Google Colab is a platform which allows to write/use python scripts remotely. You can open the PyMieSim.ipynb in the file to access it or click on the following “Open in Colab” badge:

colab


Installation

For common version of Windows, Linux and MacOS, (on x86_64 architecture), the package can readily be installed using pip;

>>> pip install PyMieSim

The ready to install wheel is not available for arm chip of the newer mac M1, M2 product. You can however install manually the package.

If, however, this fail you can build the package from scratch following the steps on the Manual building section.

Note: Wheel support now extended to manylinux2014.


Manual building

To manually buld the project on your computer make sure that you do have gcc installed (c++ and fortran compiler), plus python version 3.7+. For windows system I recommend install MingGW with g++ and fortran compiler.

This being done, the following commands should do the trick.

Linux / MacOs

>>> git clone https://github.com/MartinPdeS/PyMieSim.git
>>> cd PyMieSim
>>> git submodule init && git submodule update
>>> mkdir build
>>> cd build
>>> cmake ../ -G"Unix Makefiles" (macOS, Linux)
>>> cmake ../ -G"MinGW Makefiles" (Windows)
>>> sudo make install
>>> cd ..
>>> python -m pip install .

Testing

To test localy (with cloning the GitHub repository) you’ll need to install the dependencies and run the coverage command as

>>> git clone https://github.com/MartinPdeS/PyMieSim.git
>>> cd PyMieSim
>>> pip install -r requirements/requirements.txt
>>> coverage run --source=PyMieSim --module pytest --verbose tests
>>> coverage report --show-missing

Coding examples

Plenty of examples are available online, I invite you to check the examples section of the documentation.


Scientific article

The associated article is free of access on this link article

Citing this work?

I spent a full year to develop this tool for you to use so if it helped you in your research, I would greatly appreciate you citing the article associated to my work. Many thanks!

@article{PoinsinetdeSivry-Houle:23,
    author = {Martin Poinsinet de Sivry-Houle and Nicolas Godbout and Caroline Boudoux},
    journal = {Opt. Continuum},
    keywords = {Light scattering; Mie theory; Optical coherence tomography; Radiation pressure; Scattering theory; Surface plasmon resonance},
    number = {3},
    pages = {520--534},
    publisher = {Optica Publishing Group},
    title = {PyMieSim: an open-source library for fast and flexible far-field Mie scattering simulations},
    volume = {2},
    month = {Mar},
    year = {2023},
    url = {https://opg.optica.org/optcon/abstract.cfm?URI=optcon-2-3-520},
    doi = {10.1364/OPTCON.473102},
    abstract = {},
}

Contact Information

As of 2024, the project is still under development. If you want to collaborate, it would be a pleasure! I encourage you to contact me.

PyMieSim was written by Martin Poinsinet de Sivry-Houle .

Email:martin.poinsinet-de-sivry@polymtl.ca .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

PyMieSim-1.7.0-cp312-cp312-win_amd64.whl (36.7 MB view details)

Uploaded CPython 3.12 Windows x86-64

PyMieSim-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

PyMieSim-1.7.0-cp312-cp312-macosx_11_0_arm64.whl (37.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

PyMieSim-1.7.0-cp312-cp312-macosx_10_13_x86_64.whl (37.4 MB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

PyMieSim-1.7.0-cp312-cp312-macosx_10_13_universal2.whl (37.4 MB view details)

Uploaded CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)

PyMieSim-1.7.0-cp311-cp311-win_amd64.whl (34.4 MB view details)

Uploaded CPython 3.11 Windows x86-64

PyMieSim-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.6 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

PyMieSim-1.7.0-cp311-cp311-macosx_11_0_arm64.whl (34.9 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

PyMieSim-1.7.0-cp311-cp311-macosx_10_13_x86_64.whl (34.9 MB view details)

Uploaded CPython 3.11 macOS 10.13+ x86-64

PyMieSim-1.7.0-cp311-cp311-macosx_10_13_universal2.whl (34.9 MB view details)

Uploaded CPython 3.11 macOS 10.13+ universal2 (ARM64, x86-64)

PyMieSim-1.7.0-cp310-cp310-win_amd64.whl (32.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

PyMieSim-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (32.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PyMieSim-1.7.0-cp310-cp310-macosx_11_0_arm64.whl (32.4 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

PyMieSim-1.7.0-cp310-cp310-macosx_10_13_x86_64.whl (32.4 MB view details)

Uploaded CPython 3.10 macOS 10.13+ x86-64

PyMieSim-1.7.0-cp310-cp310-macosx_10_13_universal2.whl (32.4 MB view details)

Uploaded CPython 3.10 macOS 10.13+ universal2 (ARM64, x86-64)

File details

Details for the file PyMieSim-1.7.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: PyMieSim-1.7.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 36.7 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for PyMieSim-1.7.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0e3c1fd640d8fdd15ea7e80f586310bdefb990071bd6ebeac82841292b7e00eb
MD5 36b54c4ca90e7a755ef46f1e526adbce
BLAKE2b-256 d4d2d58f083dd267b448f04a9c29aaeb9782dd59b801476ac5b9f266b9abbbce

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1dcb5841cc32af94311c4958b6d1943b212ef1973205b0d84643e3fb71ff830e
MD5 3aac9dac016f0067c8f2f108c51b05a7
BLAKE2b-256 693a35a4790ec6d064adb1405b1c3ed2e924d7a31f7e8724991ba50706836f28

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 01677be02e69c169df97dd561239a695f0aed4b535a15ec3b451f325011a799f
MD5 9a07212eec8b6c9cd0a0ad129bfeb0e2
BLAKE2b-256 628c19d544452fd9b2e64ddd7aa3543f2fe628238853120195d2a526233a6026

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp312-cp312-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 793f574b2ba842b845cf946d1b5d454c98a2c94c94b622774a7e5586ac0778f6
MD5 81b0de3a9d597f75ca811341841a7feb
BLAKE2b-256 9b1c91c353f90ef72bc58c52c2b3b844b30df23ed79935b3940fade6de2d40ae

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp312-cp312-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 43747587292f1b7e834c4d5e8c52e9b1d080884252dd57bf252aedcd92a4a6b6
MD5 7aefd2e3df159a4f61beb575786bc98d
BLAKE2b-256 d5b98a6eddbc35e182f405db1f9611a52664305962c9231de8b733ea1eb1d198

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: PyMieSim-1.7.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 34.4 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for PyMieSim-1.7.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4f5548617db4f8043bc0c022c33f6f98dd995936abf0065580fee5aaad312de9
MD5 45a3334e44123cd32b30f0de7bc55da7
BLAKE2b-256 8085e7c77c972d761f1be6e60609312172d15c83dd6889e35d65a36cc0a822be

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 13782a96b5b1c5052da92a235c36efd1b334b9d9a2efa97b75b4206dc0099a56
MD5 7b6bbfaf2784183062ac16fc32eb7089
BLAKE2b-256 9974ac1684ad6a02009ca5232153eabb03a0e8a0648c8644c5c8eab2f50d87a1

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c4dac21c843813f6ff59675108566f4ff02309e74702c2e46e07706348ab6245
MD5 ec0faede56c12a28281979d5ca18e90c
BLAKE2b-256 f24b2df04e85b1b6edd46a52487836853ce33732960bf4f9303056107e18a612

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp311-cp311-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 f0585a459f7747bcf93bbdda5ccbce00fe5e7d574635a43490fc07153fac438a
MD5 c4caf4b498c268899767930deb3f9cc8
BLAKE2b-256 fadbfb4cadbefdb349929bf2f7b49f1f301f402038d78707a8e2975dfd24c672

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp311-cp311-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp311-cp311-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 56b9863e34f3d7bcdcd2ca7df9275d41d09be3e369bbd24e419b3e1387401b57
MD5 563dd65edb724b67b630e3c095bee399
BLAKE2b-256 107a890335492ac78939c211832558678a1edd6ac368585812f8b7f33495f7c7

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: PyMieSim-1.7.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 32.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for PyMieSim-1.7.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 90701a091c46eb1c436ac49c0fb7d3666ac4cc2783c3817c29a68ae1b0327e50
MD5 385579641b2180f8eee5221d0a390642
BLAKE2b-256 ee27f32501244ef3e9ca2a69645da79233e6b5c4aa1584bd5289173bd3e79ebd

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7075d542d154c9609ce50bd73519e4cadc10314b8bc5ad46b51a243db09038e4
MD5 22e6f8e53000aec4ddb353e164c6c7fe
BLAKE2b-256 ea9f4d14d4fd9bcf13694498657891551fc0ad9e1967be18d40da059507e3632

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 414c26329b4781900bd7a51b42f31950c82c02eb302a517d75dfc5ffbf1b80db
MD5 dac3a086569889b04e8c7b391ddf7733
BLAKE2b-256 cce38620262d210920dacbd0d1e756a140a63a41639cb9d07f7bc6560a93e8d0

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp310-cp310-macosx_10_13_x86_64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 edf3b0b477cb6bf35231658b00d7b015662af871ee902c6a6f103a633a53f4ed
MD5 ad2bcf5c7e6d8be63b2de5485abee1a4
BLAKE2b-256 09c06705e07a90ab33aafa7facf7f134f24ded2dc43fc3bae9de734ae088383d

See more details on using hashes here.

File details

Details for the file PyMieSim-1.7.0-cp310-cp310-macosx_10_13_universal2.whl.

File metadata

File hashes

Hashes for PyMieSim-1.7.0-cp310-cp310-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 29366d888904bfea8a2b4fabe5461a2d860e2c9ca7b06f70c1791af62e59a98d
MD5 7d80831b06b3b6785d0805be4d4cd9ae
BLAKE2b-256 6355fa93354f91695bf0f9c0220ea7cec13a63d751b8394efe430dda71d341b1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page