|
5 | 5 | This example demonstrates how to compute and visualize the coupling efficiency as a function of core diameter for CoreShell scatterers using PyMieSim. |
6 | 6 | """ |
7 | 7 |
|
8 | | -# %% |
9 | | -# Importing the package dependencies: numpy, PyMieSim |
10 | 8 | import numpy |
11 | 9 | from PyMieSim.units import ureg |
12 | 10 |
|
13 | | -from PyMieSim.experiment.detector import Photodiode |
14 | | -from PyMieSim.experiment.scatterer import CoreShell |
15 | | -from PyMieSim.experiment.source import Gaussian, PolarizationSet |
| 11 | +from PyMieSim.experiment.detector import PhotodiodeSet |
| 12 | +from PyMieSim.experiment.scatterer import CoreShellSet |
| 13 | +from PyMieSim.experiment.source import GaussianSet, PolarizationSet |
16 | 14 | from PyMieSim.experiment import Setup |
17 | 15 | from PyOptik import Material |
18 | 16 |
|
19 | 17 | polarization_set = PolarizationSet( |
20 | 18 | angles=[90.0] * ureg.degree, |
21 | 19 | ) |
22 | 20 |
|
23 | | -source = Gaussian( |
24 | | - wavelength=1.2 * ureg.micrometer, # 1200 nm |
25 | | - polarization=polarization_set, # Polarization angle in ureg.degrees |
26 | | - optical_power=1e-3 * ureg.watt, # 1 milliureg.watt |
27 | | - numerical_aperture=0.2 * ureg.AU, # Numerical Aperture |
| 21 | +source = GaussianSet( |
| 22 | + wavelength=[1.2] * ureg.micrometer, |
| 23 | + polarization=polarization_set, |
| 24 | + optical_power=[1e-3] * ureg.watt, |
| 25 | + numerical_aperture=[0.2] * ureg.AU, |
28 | 26 | ) |
29 | 27 |
|
30 | | -scatterer = CoreShell( |
31 | | - core_diameter=numpy.geomspace(100, 600, 400) |
32 | | - * ureg.nanometer, # Core diameters from 100 nm to 600 nm |
33 | | - shell_thickness=800 * ureg.nanometer, # Shell width of 800 nm |
34 | | - core_refractive_index=Material.silver, # Core material |
35 | | - shell_refractive_index=Material.BK7, # Shell material |
36 | | - medium_refractive_index=1 * ureg.RIU, # Surrounding medium's refractive index |
| 28 | +scatterer = CoreShellSet( |
| 29 | + core_diameter=numpy.geomspace(100, 600, 400) * ureg.nanometer, |
| 30 | + shell_thickness=[800] * ureg.nanometer, |
| 31 | + core_material=[Material.silver], |
| 32 | + shell_material=[Material.BK7], |
| 33 | + medium_refractive_index=[1] * ureg.RIU, |
37 | 34 | source=source, |
38 | 35 | ) |
39 | 36 |
|
40 | | -detector = Photodiode( |
41 | | - numerical_aperture=[0.1] * ureg.AU, # Numerical Apertures for the detector |
42 | | - phi_offset=-180.0 * ureg.degree, # Phi offset in ureg.degrees |
43 | | - gamma_offset=0.0 * ureg.degree, # Gamma offset in ureg.degrees |
44 | | - sampling=600, # Number of sampling points |
45 | | - polarization_filter=1 * ureg.degree, |
| 37 | +detector = PhotodiodeSet( |
| 38 | + numerical_aperture=[0.1] * ureg.AU, |
| 39 | + phi_offset=[-180.0] * ureg.degree, |
| 40 | + gamma_offset=[0.0] * ureg.degree, |
| 41 | + sampling=[600], |
| 42 | + polarization_filter=[1] * ureg.degree, |
46 | 43 | ) |
47 | 44 |
|
48 | 45 | experiment = Setup(scatterer=scatterer, source=source, detector=detector) |
|
0 commit comments