Code inspired by “Improved recursive algorithm for light scattering by a multilayered sphere” from Applied Optics Yang 2003 and posted on our group webpage for use here.

Section 1: Background Information

This walkthrough aims to teach the reader about a recursive algorithm developed by Wen Yang on the topic as well as the addition of a Near Field Enhancement calculation to the system.

This algorithm has been developed to apply Mie Theory 1 to a multilayered sphere. The algorithm works only for layered spheres, and will not correctly interpret any other morphology. The image below shows an example of concentric layers of spheres as one unit. Multilayer Diagram

Material File

The user must have text files containing the wavelength-dependent refractive index values for the materials in the multilayered sphere. This file must be placed in the same directory as the code.

The files have to be tab separated lists with a header row and no spaces. Below is an example of a file with silver, silica dioxide, and gold index values. User can input multiple files with separate materials if they want.

Dielectric Example

The script will interpolate between these wavelengths if your refractive index file has asymmetric gaps. The user has the option of compiling refractive indices into one text file or mulitple. When using mulitple refractive index files, make sure that every files has its first column as the wavelengths (in nm).

Section 2: Settings Text File

The script will need information about the system to be analyzed. The mieSettings.txt file is a text file containing the settings of the code. It is crucial that the format of the document is not changed. If altered, you’ll need to look up how to format the document into a JSON format.

Setting 1: How many layers?

Input how many layers in total the system has. This must be an integer greater than 1. If the user wants to run a homomaterial system, just input two or more layers and when asked their radii, let the outermost radius be the true radius and assign the other radii values smaller than the first. Finally, just assign the same refractive index to every shell to get a homomaterial system.

Setting 2: Refractive Index File Location?

Each item in this array should be the refractive index file for the material of each layer. If the files are not stored in the same directory as the python script, you will need to type the correct path. It is possible to have one refractive index file with multiple materials’ information, just copy the path multiple times in the array.

Setting 3: What is the radius of each layer?

Input, starting with the innermost core layer, the outer radius measurement of each layer in nm. These can be float values (with decimals).

Setting 4: What columns of the refractive index file are for each layer?

Input, starting with the innermost core layer, the column index (where the first column of wavelengths is indexed at 0) for the real and imaginary component of the refractive index of each layer’s material. Ex: for the image above, the columns for silver (Ag) are 1 and 2.

Setting 6: Wavelength Interval

Refractive index files should contain these wavelengths as data points. Interval between wavelengths will be linearly interpolated by .py script. Wavelengths should be in nanometers.

Section 3: Output File

The script will begin to calculate multiple data points for each wavelength. The output file will be a text file containing a header row, columns for each data point, and a row for each wavelength.

Output File

The outputs are as follows:

  • Column 0: Lambda/Wavelength
  • Column 1: Qext
  • Column 2: Qsca
  • Column 3: Qabs
  • Column 4: Cext
  • Column 5: Csca
  • Column 6: Cabs
  • Column 7+: Near Field Enhancement for each layer

The script for this project can be found here.

For a list of changes made to the project, see the next blog post.

  1. Describes the scattering of light by a non-absorbing, partially-absorbing, or perfectly conducting sphere. 


<
Previous Post
How to host Jupyter Notebook on a remote server
>
Next Post
Changes to the Mie Multilayer code on ywangcomp.org