{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using the RCW module"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The RCW module of pySCATMECH implements the `SCATMECH::RCW_Model` class, which is a rigorous coupled wave (RCW) solver for one-dimensionally periodic gratings. This notebook will demonstrate a number of its features.\n",
"\n",
"First, we import the module. Since we are also using `numpy` and `matplotlib`, we will import those, too."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from pySCATMECH.rcw import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Single line grating\n",
"\n",
"We will start our demonstration with a single line grating. We can create a `RCW_Model` with parameters:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"{None : 'RCW_Model',\n",
"'order' : '25',\n",
"'type' : '0',\n",
"'lambda' : '0.532',\n",
"'thetai' : '70',\n",
"'rotation' : '0',\n",
"'grating' : {None : 'Single_Line_Grating',\n",
" 'period' : '0.2',\n",
" 'medium_i' : '(1,0)',\n",
" 'medium_t' : 'silicon',\n",
" 'material' : 'silicon',\n",
" 'space' : '(1,0)',\n",
" 'height' : '0.2',\n",
" 'topwidth' : '0.1',\n",
" 'bottomwidth' : '0.15',\n",
" 'offset' : '0',\n",
" 'nlevels' : '10'}}\n"
]
}
],
"source": [
"gratingParameters = {\n",
" None : 'Single_Line_Grating', # The Grating model can be assigned with the `None` key\n",
" 'period' : 0.2, # The period \n",
" 'medium_i' : 1, # The incident medium0\n",
" 'medium_t' : 'silicon', # The transmitting (substrate) material\n",
" 'material' : 'silicon', # The grating material\n",
" 'space' : 1, # The space material\n",
" 'height' : 0.2, # The height\n",
" 'topwidth' : 0.1, # Top width\n",
" 'bottomwidth' : 0.15, # Bottom width\n",
" 'offset' : 0, # Offset of top, relative to bottom\n",
" 'nlevels' : 10} # Number of layers in the staircase approximation\n",
"\n",
"rcwParameters = {\n",
" 'order' : 25, # number of Floquet orders considered\n",
" 'type' : 0, # 0 indicates reflection\n",
" 'lambda' : 0.532, # wavelength\n",
" 'thetai' : 70, # incident angle in degrees \n",
" 'rotation' : 0, # rotation angle in degrees\n",
" 'grating' : gratingParameters\n",
" }\n",
"\n",
"model = RCW_Model(rcwParameters)\n",
"\n",
"print(model)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's show the NCS parameters for the 0th order diffraction (specular) as a function of wavelength:"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"image/svg+xml": [
"\r\n",
"\r\n",
"\r\n",
"\r\n"
],
"text/plain": [
"