{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Using the CrossRCW module"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"In this notebook, we demonstrate the `CrossRCW` model, which implements rigorous coupled wave (RCW) analysis for cross gratings. First, import the modules we will need:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"from pySCATMECH.crossrcw import *"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We will use a cross grating consisting of a square grid of cylindrical holes to demonstrate the use of the module. We set up the grating below and feed it to the RCW solver. I have a file named \"fusedsilica\" that contains the index of refraction of fused silica as a function of wavelength."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"period = 0.5\n",
"order = 5\n",
"theta = 70\n",
"\n",
"gratingParameters = {\n",
" None : 'Cylinder_CrossGrating',\n",
" 'medium_i' : 1,\n",
" 'medium_t' : \"fusedsilica\",\n",
" 'zeta' : 0,\n",
" 'd1' : period,\n",
" 'd2' : period,\n",
" 'grid1' : 256,\n",
" 'grid2' : 256,\n",
" 'rtop' : 0.1,\n",
" 'rbottom' : 0.1,\n",
" 'thickness' : 0.1,\n",
" 'nlevels' : 1,\n",
" 'inside' : 1,\n",
" 'outside' : \"fusedsilica\"}\n",
"\n",
"rcwParameters = {\n",
" 'thetai' : theta,\n",
" 'rotation' : 0,\n",
" 'lambda' : 0.532,\n",
" 'type' : '0',\n",
" 'order1' : order,\n",
" 'order2' : order,\n",
" 'grating' : gratingParameters\n",
" }\n",
"\n",
"model = CrossRCW_Model(rcwParameters)\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's show the NCS parameters (NCS refering to the unique elements of the non-depolarizing Mueller matrix: 01, 22, and 23) 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": [
"