Skip to main content

A simple python Mie solver for core-shell nano-spheres.

Project description

logo

pyMieCS

Mie theory for core-shell nanoparticles

Simple Mie solver for core-shell particles supporting magnetic optical response of the materials (useful for effective medium fitting).

pyMieCS is fully numpy vectorized and therefore fast.

Getting started

Simple example

import pymiecs as mie

# - setup a core-shell sphere
wavelengths = np.linspace(400, 900, 100)  # wavelength in nm
k0 = 2 * np.pi / wavelengths

r_core = 120.0
r_shell = r_core + 10.0

n_env = 1
mat_core = mie.materials.MaterialDatabase("Si")
mat_shell = mie.materials.MaterialDatabase("Au")
n_core = mat_core.get_refindex(wavelength=wavelengths)
n_shell = mat_shell.get_refindex(wavelength=wavelengths)


# - calculate efficiencies
q_res = mie.Q(k0, r_core=r_core, n_core=n_core, r_shell=r_shell, n_shell=n_shell)

# - plot
plt.plot(wavelengths, q_res["qsca"][0], label="scat")
plt.plot(wavelengths, q_res["qabs"][0], label="abs.")
plt.plot(wavelengths, q_res["qext"][0], label="extinct")

plt.legend()
plt.xlabel("wavelength (nm)")
plt.ylabel(r"efficiency (1/$\sigma_{geo}$)")
plt.tight_layout()
plt.show()
#...

Features

List of features

  • internal and external Mie coefficients
  • efficiencies
  • differential scattering
  • angular scattering
  • core-shell t-matrix class for smuthi

Installing / Requirements

Installation should work via pip from the gitlab repository:

pip install https://gitlab.com/wiechapeter/pymiecs/-/archive/main/pymiecs-main.zip

Requirements:

  • scipy
  • numpy

Contributing

If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.

Links

Licensing

The code in this project is licensed under the GNU GPLv3.

Project details


Download files

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

Source Distribution

pymiecs-0.1.tar.gz (14.0 kB view details)

Uploaded Source

File details

Details for the file pymiecs-0.1.tar.gz.

File metadata

  • Download URL: pymiecs-0.1.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.3

File hashes

Hashes for pymiecs-0.1.tar.gz
Algorithm Hash digest
SHA256 35848f98eae6d3d072257632afea93d54d55867c40274c27de81947b62fd66d8
MD5 09d32c7ace6bd061e24317f185b6b865
BLAKE2b-256 4f51f60ac8ec7105a86da54005ffc4221519a3261cce3cd44230a98cadabbbd0

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