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

PyMieSim was developed to be a used in Python script as shown in the documentation section. Although, since version 1.7.0 it is possible to use the new graphical user interface. To use is, you first need to install it:

>>> pip install PyMieSim

Once this is done you can run 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.4-cp312-cp312-win_amd64.whl (36.8 MB view details)

Uploaded CPython 3.12 Windows x86-64

PyMieSim-1.7.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (36.6 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

PyMieSim-1.7.4-cp312-cp312-macosx_11_0_arm64.whl (37.5 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

PyMieSim-1.7.4-cp312-cp312-macosx_10_13_x86_64.whl (37.5 MB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

PyMieSim-1.7.4-cp312-cp312-macosx_10_13_universal2.whl (37.5 MB view details)

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

PyMieSim-1.7.4-cp311-cp311-win_amd64.whl (34.5 MB view details)

Uploaded CPython 3.11 Windows x86-64

PyMieSim-1.7.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (34.7 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

PyMieSim-1.7.4-cp311-cp311-macosx_11_0_arm64.whl (35.0 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

PyMieSim-1.7.4-cp311-cp311-macosx_10_13_x86_64.whl (35.0 MB view details)

Uploaded CPython 3.11 macOS 10.13+ x86-64

PyMieSim-1.7.4-cp311-cp311-macosx_10_13_universal2.whl (35.0 MB view details)

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

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

Uploaded CPython 3.10 Windows x86-64

PyMieSim-1.7.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (32.8 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PyMieSim-1.7.4-cp310-cp310-macosx_11_0_arm64.whl (32.5 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

PyMieSim-1.7.4-cp310-cp310-macosx_10_13_x86_64.whl (32.5 MB view details)

Uploaded CPython 3.10 macOS 10.13+ x86-64

PyMieSim-1.7.4-cp310-cp310-macosx_10_13_universal2.whl (32.5 MB view details)

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

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8e4508c99044c10315029a28fb2b383bd37d572bba58e3bec002b09506204799
MD5 562fb723cd6b163bd01e6492b5aeaf27
BLAKE2b-256 d34aa528f1f86aa63a5a195ea06424ef06b94a47946eac1e83990d34e1c43ba4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 75db6ac067a03704b8df626eec1c4c6ecd52ddf2804edfb3a3af8b439ec216c5
MD5 d2c86c22c1efe7634d7137a00fe712a6
BLAKE2b-256 e1bd9d509a8babe624d013da54bd87a2c6c81a20c6f4abeeb264b776d0be3e2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c76a3836012c91c1c3cdd53883d6ce68c533083f36a698ffb1e8b8d58c070553
MD5 b55c5349bdcc21239bd2843d0bc6808f
BLAKE2b-256 f41e246167b3b9822f1c38974b054b9e02a426453b0ce536976ac66df0e653ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 83689f4c8edae7de1dcd4f4fb6b394f299a7f81a3ba81e057aef2e9674d7b46d
MD5 7302fdc176d6d789fe7e80750aa3f082
BLAKE2b-256 32ff9cb3d9cf7c9a33a69f8f415432c71cde5dae531d957e7b9cd88ebd2eea37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 9048635967be60d5a0b9904a652d99b54dae1f05618c025b5d207753d62d9a6c
MD5 36ffd156134402e403e6601846bf7a6d
BLAKE2b-256 e419e416056625ab35ce794c3aeed9c442c85dddf1f6607b1632a0178157a8c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 472ed9a2ae422d01150808544e5bc5eb299e2036d61ab71a4b174b04c25310a5
MD5 fd9dbba9c615881b8f95eae1b618d946
BLAKE2b-256 ca25f596e380997bde53247ab31b1198df80bee78e30c50c17a3c9014c82413b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 384d1889d6ed7e2c2c2b1cca6849fcd9278665104ac3409012fb6fd936393238
MD5 05b372b8a3f5e2ee8629d18e73b43323
BLAKE2b-256 2750d470fd0de2d62d80bcbd3b8248401bd5f3b7a4f31471d700159a98e9e18f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6114b5a7b4926fa33b502ab8193948646197fa27135b22bcfba1526ab011fa55
MD5 081604e2924c1db5d4aa887906155fd5
BLAKE2b-256 468b2b3f25b7be1fa41b93192d963965ee22a1e26a8809c7a8b55ded22da1053

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6bd50ea623a38c72ad2e73794a9ded23cc9b3ed5ac8518b104fa71c26b907b6c
MD5 ff47851cbbd45b630771ce1e4d00e0ad
BLAKE2b-256 b4cddeb03fdfcee52546d2f6748368a91b26f43900b8189f2e3f9f60d24727d0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp311-cp311-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e2105e7784d7c7d71a5b91f37a62d4e6842fd3c4f188773dff4229fae60e7a65
MD5 caf3c4b663c386f04e5b49cc132fd279
BLAKE2b-256 d67656042a37c1ccbf46889fb76052f4792272f08b86757e3cb81657a3da0c5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 527975b8a767f57fd1b42a1aea471f7fdd8743dc4f23280eb454ed2b8e35cbd2
MD5 cbdeda48ca31ebe16b3abc74116fd61e
BLAKE2b-256 11eecc6bbfe3587f190a6123a7c9d64922a646d8a4bd556fd21af8685e2a6deb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4497e909a76a0393112f04c315e609e76566199c776cc8ee11c3088aa54da8fb
MD5 624518f7d21aee90afdb00f82e50e9ba
BLAKE2b-256 83145177e8f8cdf93a59c309fd00912a2914a46aa10954ee53abc9ce91184784

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a55240a882b559bf28a1a49b76fed39e285e48b4fc65e9a50733cfc463ea24b8
MD5 2b8fc3ae1ac20590788708aba0b7ed72
BLAKE2b-256 0cf0fca4d786c81b10a84de677f534337d389e1ec82e23a6fc3ac7e5a94ad46e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 9b451df69b37d60bdf725759b817933bf001afe443c3ef108b34f3b6c301e265
MD5 bdd5239903b5af5815669df2f94dbe7b
BLAKE2b-256 900d2c9e174616fbd924036bcadecddbb98b044d1bc6362db0d3a22ed24bd917

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.7.4-cp310-cp310-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 a6f2ff726fffab5589ee13172059eb32f033502593315443e19a1434c8dba901
MD5 8c6ac4f0fc71ca57d8fdae4dd44e7e8b
BLAKE2b-256 814ddb206c05080475ce33fb407e5017587e9763db8a5cff2cb361b130697241

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