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

Uploaded CPython 3.12 Windows x86-64

PyMieSim-1.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

PyMieSim-1.9.1-cp312-cp312-macosx_11_0_arm64.whl (8.9 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

PyMieSim-1.9.1-cp312-cp312-macosx_10_13_x86_64.whl (8.9 MB view details)

Uploaded CPython 3.12 macOS 10.13+ x86-64

PyMieSim-1.9.1-cp312-cp312-macosx_10_13_universal2.whl (8.9 MB view details)

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

PyMieSim-1.9.1-cp311-cp311-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.11 Windows x86-64

PyMieSim-1.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (5.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

PyMieSim-1.9.1-cp311-cp311-macosx_11_0_arm64.whl (6.1 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

PyMieSim-1.9.1-cp311-cp311-macosx_10_13_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.11 macOS 10.13+ x86-64

PyMieSim-1.9.1-cp311-cp311-macosx_10_13_universal2.whl (6.1 MB view details)

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

PyMieSim-1.9.1-cp310-cp310-win_amd64.whl (3.1 MB view details)

Uploaded CPython 3.10 Windows x86-64

PyMieSim-1.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

PyMieSim-1.9.1-cp310-cp310-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

PyMieSim-1.9.1-cp310-cp310-macosx_10_13_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10 macOS 10.13+ x86-64

PyMieSim-1.9.1-cp310-cp310-macosx_10_13_universal2.whl (3.3 MB view details)

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

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 697009b15b05c2c87717f828d3e5f5a53823d0361068501cd0601569c275db47
MD5 c7841deac4a9bf6d864b5e1437791272
BLAKE2b-256 fd5b4c5bd8e884cac888f3af625873b4136f9c7b4e2078e025cca9b15187cf32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 73f431e6ff43289eb5984ee590945da1ceae3a7c464413fce40a3be69c7d0f29
MD5 8116345bf9b27f41f25d89781310fd42
BLAKE2b-256 1a681982a864ee5951e861453f5659dfba1c7280b28c9e88efa9c89231b6a8f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e6e01cecd3a263d43615bd6bb45473fa6e3feb1d74c6ab0deb862fdcdd59677
MD5 535a2a073317febfb9212ca454cb6026
BLAKE2b-256 a5dce552bd3de629e65cb3803092ef147946b0ec68d71c6d9f092ec04f42081d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 14fad8361a392638f62bd1bcff94ef9bc8a049a07f4d7cf102b4603513b83752
MD5 d4844db6314d17b736f519e67e71d8b2
BLAKE2b-256 31315b263236ddff4b79746b5850e90fa728c75e1cb46242a11470897b73c564

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 e1d16a1a9cac79bbe7147096ed2a14413701db74f88a87b4e58989e59a769424
MD5 e8c5a114fa83d5ba18984d9ac844ee54
BLAKE2b-256 fd7046b5e5795d4f3e66921d16f5ac9cb96296cab5cc3d2abca369931414d3dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 819b21ec9329807d4ae4877412862afc45e2567e4ed1e7fbfbef6f27b9f8a1a4
MD5 10637341bc0f166e40fff54d49d71c6c
BLAKE2b-256 1ec8625fa8762a5017b0e3250d036c897dde174fafb0b54a0ef415628e7865f1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8a4285d81772806963128de64280c6be802eef06494b954e8782aa2a5ac91a60
MD5 98afcacf72f0c73713e55b1f1c76062d
BLAKE2b-256 7988219500851359e137d7398c6fd83f4f626c806f55157eb13c39e848d9b407

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fab04f2d5887c1c9f49255ae6dc1667520c03eb10d152e185c5cab6a4f7d3ab3
MD5 2da85c013ebd855579ee4887598c2d3f
BLAKE2b-256 868dbd6b717ac2a0f6d633912ec692799005178cd12d390339e17083acfef7e5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 64c19d8fe3928958ecc1ad491ce9eaf6794a60768b37af3345e41a7563912100
MD5 089ae5ff556b22ddfa364ff0fb01bb42
BLAKE2b-256 2c21417e6bf6ae65690ac6090e33a091b00b563904c660e4ffe87ed524f974c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp311-cp311-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 d0ba4fa8e5a64c9b017a7bf4201454f264d99725f6a3a85db853aacd34b28452
MD5 6defb5cf82c0e322cf76adf60e57a942
BLAKE2b-256 b11a3bb432be324d125ab4f93fb5c0a07c8c943479b5648c4a49b011d4dd57a2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ff599b4003c7e3954eed907c14f38d321a03fb668e720bb7ff181606bef25df4
MD5 100ac8fe55997111d6742163dd66dc8e
BLAKE2b-256 be072002c5cea728c75d839ca6f92fb70044ada348e775a8f249d4e170ba6c50

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd5ce020a3b0dac8260766a05eca26e169385ae537e4d5d505ed19372872c98f
MD5 082ec3e0814b527335c8726b238f7be9
BLAKE2b-256 cfb416a516158d18bda6db0af559252089430f98d39f659dcbb428d07f495e2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1782104c5ebf16be4348ea973d9ce282a0a7d875ce83dda77e449fecdb697a6e
MD5 e930e1be75b40f5494c38f6f3e54701a
BLAKE2b-256 7062557d42b33c9230d4c12f1c0192e2a9ae52ca5201285f5cedf2322fc2f4d4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 6d19309f86521821198276e010a43e6721c6dee45632987160dfdf4160864bd0
MD5 9f0925cf728c5a7b49ebebf3817d1302
BLAKE2b-256 257fcb6df531052841024c9acfd52c72737d4c3f192b4c9cc2eb0a1256f080db

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.9.1-cp310-cp310-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 cca6680b408997b91d7967f83785641ea9040c1c57d8c96cf44f07d1b7bfa63a
MD5 1366c201b4a5ab2a37d83e68add4e0a5
BLAKE2b-256 03714b6f31e7276062360636f0fa2eaaf731a276b6c968cecea5ac7142f06a12

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