Note
Go to the end to download the full example code.
Print properties#
This example demonstrates the computation of scattering properties using PyMieSim.
Importing the package: PyMieSim
from PyMieSim.single.scatterer import Cylinder
from PyMieSim.single.source import Gaussian
from PyMieSim.units import nanometer, degree, watt, AU, RIU
from PyOptik import Material
Defining the source
source = Gaussian(
wavelength=750 * nanometer, # 750 nm
polarization=30 * degree, # Right circular polarization
optical_power=1 * watt, # Power in watt
NA=0.3 * AU # Numerical Aperture
)
Defining the scatterer
scatterer = Cylinder(
diameter=300 * nanometer, # 300 nm
source=source,
property=(1.4 + 0.1j) * RIU,
medium_property=Material.water
)
scatterer.print_properties()
Property Value
-------------- ----------------------
size_parameter 1.2566370614359172
area 300000.00000000006 µm²
g 0.37557408799482683
Qsca 0.023186330283701
Qext 0.25098397196276695
Qabs 0.22779764167906594
Csca 6955.899085110302 µm²
Cext 75295.1915888301 µm²
Cabs 68339.2925037198 µm²
Total running time of the script: (0 minutes 0.058 seconds)