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

Uploaded CPython 3.12 Windows x86-64

PyMieSim-1.8.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (8.4 MB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

PyMieSim-1.8.1-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.1-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.1-cp311-cp311-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.11 Windows x86-64

PyMieSim-1.8.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (5.8 MB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

PyMieSim-1.8.1-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.1-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.1-cp310-cp310-win_amd64.whl (2.9 MB view details)

Uploaded CPython 3.10 Windows x86-64

PyMieSim-1.8.1-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.1-cp310-cp310-macosx_11_0_arm64.whl (3.1 MB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

PyMieSim-1.8.1-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.1-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.1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7c340dc1089bd6ac132f6fc59d3360673ad76532f444be638017dcca7a95e2e5
MD5 3491585b1ff7ca877cbc20abb02d843c
BLAKE2b-256 3c4e5b1a018c7f1af236050e16db8bf4eac04cf508429cf7ab9a683ae9bf4e0c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc4bd9e6a1f189f92f89dc64b193e7010a57ae1ff766708dd9f94fde69b39fb7
MD5 a6137575549bb2ea715227c2640a04d1
BLAKE2b-256 47673940e087ed9e6b5da2d75e24c9e71ea31218d844b05ef8f6fcd879317be3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 331dfb71ed2f03885f85cc01078488d501932d24d6321ae199aedcfcd971061a
MD5 c831758044fd7b5adb0ed98fae43f5f9
BLAKE2b-256 e65ebea1393b96fcf92bfa4c466ddf706a0dfec696b4d07023a921b0ed35dddb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp312-cp312-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 d3aeb3ad166b84717a8b253000d6472247b29277552b5633825c0ba4ee3ba3d4
MD5 741a0bae0596a8eed4bf31f24f744477
BLAKE2b-256 9ba526cd4e2604621d7459144057f0d11ce8398672be9d5a19ffc9fdb7f38f1d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp312-cp312-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 f200b0ffe4d8fe0c5d7a7c2a463179358d255503b1c04e75e8feaa6c616b30c1
MD5 61627fb18b20c05ecbdb16042b10334c
BLAKE2b-256 e96f43ac19125161866d3c6c989ac3f13fed451e265824403b7e63de9679a1ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ba4787c0915b0ee9ec47a532b17ed2aeceb1595a0e7970794770e920b11d5079
MD5 319e05f501ee871a7ba0511c406cd074
BLAKE2b-256 e1e8d83f1c5146ec47c7e8d0df4ab43a6c54efaf42221c8910ed625032f76749

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4b621d4a19d82f226f753c1c48dbf04cd26fcf07590b9db3d0e5593c535e09a6
MD5 19ac37707dff09875dfabd9fe5ea8d8d
BLAKE2b-256 e25b58575506873c5dfabf6dd172a3e0b16a585464e7faca0bca37ab3f91193b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b462288e69f40142b3f2d821e51a8703a6a28ee15d32235d882c26d84f60178
MD5 c303ee47a2b550dcc69e365a2383357a
BLAKE2b-256 73187ddc16992017d3ef718f18d23e1550643d4cc75ad4a0ee1627f93f36eb18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp311-cp311-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8ace62b41c62ef63c700b144c214d55e4defc5482715edf6074a3d3143beae4e
MD5 c3ed1d04087c5438e9ba157f3b28c1cb
BLAKE2b-256 14674f61427a82f69fe586c26ea4f24b4c5d6ca6624b09e5dee29f1c2504130d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp311-cp311-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 4ea71c774bffe8f0d9b94a4b773f5fda8dc164a93001d982fde4ab9708b59538
MD5 b5b48cf126c685db81c6447bc2110ef4
BLAKE2b-256 0a86d3a02b9bf267f8a0de99545651dbdaaf67fc8ba7ee6e0786f5387f596994

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8758c2066d600cb651abb2c7f8da4b9b0ad322239921e094f1e102bfb9cc8f1a
MD5 68a255cda9876ca04f2948ebcdd73500
BLAKE2b-256 332f8e103a2342f55d906b78aa9fa6c2db8fd6f9aed092fb6a12dbb5a74e61f4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5c730d21a94d9a42adacb32ce0986b53d5fa207499c98ade45436e8fb9c226d4
MD5 5c1499429ed02c29bd6298761d0b2976
BLAKE2b-256 5331cb34b5370ac59c3299945249c0de2a60b255a000cd7fab961420e4d9c349

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4325c2ecc8fd59f92baf8797849b736fc973478130edc442542f32479057fb31
MD5 f04d6221543cf51b9e4b9821a7e678e6
BLAKE2b-256 e6a684afa2d70fb69d5e69a6ec6aed385c11f80f75df34c781ea56ef997235e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp310-cp310-macosx_10_13_x86_64.whl
Algorithm Hash digest
SHA256 8191a324714e92dbb7510e4f1d36f003563c1b9d4f26f46b61b3945a544bcb9f
MD5 aa0673572e811ea369c2616e23ccfa44
BLAKE2b-256 6c19479708ec4d8db6f88abc45b9a84e2bd9e361799453594343728157c49c64

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for PyMieSim-1.8.1-cp310-cp310-macosx_10_13_universal2.whl
Algorithm Hash digest
SHA256 2f15af22e99121609837529527646fbb405cb9a2f3ed71531557fed96ce1fc54
MD5 e35bb134260cba5b6daba0d1e3617ec2
BLAKE2b-256 b1ebfa5b79f8af0d0dffda9f79739e180a9f2253f66d53ace7742746956767bf

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