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.8.2-cp312-cp312-win_amd64.whl (8.0 MB view details)

Uploaded CPython 3.12 Windows x86-64

PyMieSim-1.8.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

PyMieSim-1.8.2-cp312-cp312-macosx_11_0_arm64.whl (8.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

PyMieSim-1.8.2-cp312-cp312-macosx_10_13_x86_64.whl (8.4 MB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

PyMieSim-1.8.2-cp312-cp312-macosx_10_13_universal2.whl (8.4 MB view details)

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

PyMieSim-1.8.2-cp311-cp311-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.11 Windows x86-64

PyMieSim-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.8 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

PyMieSim-1.8.2-cp311-cp311-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

PyMieSim-1.8.2-cp311-cp311-macosx_10_13_x86_64.whl (5.8 MB view details)

Uploaded CPython 3.11 macOS 10.13+ x86-64

PyMieSim-1.8.2-cp311-cp311-macosx_10_13_universal2.whl (5.8 MB view details)

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

PyMieSim-1.8.2-cp310-cp310-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

PyMieSim-1.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PyMieSim-1.8.2-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

PyMieSim-1.8.2-cp310-cp310-macosx_10_13_x86_64.whl (3.1 MB view details)

Uploaded CPython 3.10 macOS 10.13+ x86-64

PyMieSim-1.8.2-cp310-cp310-macosx_10_13_universal2.whl (3.1 MB view details)

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

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 eeee69e1348f19eb0e64887baae0344dfa014b7fb9259bce0e85519013e9b84e
MD5 90f346483bda9898b004d587e6c14136
BLAKE2b-256 bf153cba1390134c0f9a95863d66c6f37e8cbffb441dda867739124376b7a617

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 943a26e8805b5e65c88fa58ebefb2c20f6dfe65bbff8a43bcbd97bb4e99efc7a
MD5 e157fefe76fa6f8bcbdb745c2c36202e
BLAKE2b-256 88f2c20208264f9d844496be23161512e700d4f9a765a2a757a452689dd3151e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bff558e1093c2aaed53ed19da2a2fb51da083a701a5ef95d308ac9fe956e7992
MD5 5510d4865b63126755e7ada5a818c468
BLAKE2b-256 287cfd485a640bd48caa5586d83edc168333d1b8dbfe3517ef9d28eb10dab63a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 eddd1c96178ced0fb4232cc562cf84410fe20f161d33956dc0e683f8fba1a71c
MD5 7f3286de4afc2218ccb8ea65e2927e7e
BLAKE2b-256 def68aa955e6303c75558dd18feaed901ee0df644db2079414b84426f1ff1424

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 6eb6e210c7580e5b634f4564344ab981e2f776557d32cdb3ee98e6d25374d290
MD5 a32a03ca04e4dd53109824b4c4dff6e4
BLAKE2b-256 89cd0107683998dbdcfd65e901266e0555ccf171c21b6ac15f4af4356cb1b37f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 2819f9706679e53df0d443ec29d49e259b2842c6d74ce13b374ddfe67fa81ff7
MD5 5ba09550628fa77ebe3dad0a5ee8b565
BLAKE2b-256 abbf7c323bdef596cd0ca4dc66a94e9877aedfddeaf5068dfc255c7191c89a7d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f3dc0cb15d467a4628d1689aaa06770971bf56e38d643a709a2f0fff48a2d559
MD5 16bc4e3fb2bf8503299168a3298ef022
BLAKE2b-256 9c37c625340c1fb882a9912241b4144fc5a40d95c20bd9093f5f87dd858e26c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3eca8b0e402262949cff1d12915a5e45db03d16322dd7ba59eec8127c03e2b5f
MD5 5cfc67873758f4715c3dd510459229b9
BLAKE2b-256 77fcf1b0bba213dfada4f5e13ceda670c64bae1e6aa38f5720252cdc05271bf9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 66e435212adbdd306357e87d4ea769ea9d1857b821d7f68568601d741c6c653b
MD5 6fde00ec6c4681a1c83fe6fbdd859c77
BLAKE2b-256 92411bcead9bae7fc02cfc54f6e92e580d1ffc71b39d2f811a28f5d5186c3bda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp311-cp311-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 0241d1b117e9326b4a378278e9fe019f375fc3345d22e227886a7e7236477bb4
MD5 7f9eab9e1e257a03a63aceed6e65199e
BLAKE2b-256 9469ab462a750ebe1857edd306274095ac82966269818f7a9cab54db9254a3fe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 10d6105cc698a8dafa0e51204b2c8ada26a5cc893d73a573b2e8dcc8f1a9b9a7
MD5 c4b9834bddeef6b73308bf29fe9e9dd2
BLAKE2b-256 3d609ebd7468f4d5222de3300e942c4c241a8600b37d6895205f93b07bcae5c3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bba7e2f16dc2c1e9208dc4b333830d3d83d983dbd58146955294b3db7a24a0e8
MD5 d851b465841d936453f4a67290fefa24
BLAKE2b-256 7d8bd654ee9db085d92fdee20e63cdba4265003ee59ef277eb5be37928e899b3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f69af93c4f29871db689801d311ba2f14afdb1f944d942016d0e49081184a254
MD5 6316491ebecac1e970ea1f65952d269f
BLAKE2b-256 d292dcf167f98d452618d03c2796ac501408f3a992e4cdfebc4cd28af4ff95d8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 176677b50ada74f77e290e1641a1de72e08b36fd507e1e1d7e2440a70dc3302c
MD5 a30ad54b41197a91b3e1861deac4be3e
BLAKE2b-256 0561392feb7e38f7b358879dabff05882a5afb9175f175b695be0c674a66d8ce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.2-cp310-cp310-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 066537ad295a7c50e0b8e64fd484550882c951d32bc0a8f1d160eb0569803be6
MD5 4893530d4844a60f256f6720e28739cd
BLAKE2b-256 6e7658e5907ec84c08a08f2c591fff223d959971ff47115d501382046b0d19c5

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