From 17e8ff09fd272b2d56017b6652d2efcb7a07cb8d Mon Sep 17 00:00:00 2001
From: Simon Ans <simon.ans34@gmail.com>
Date: Thu, 14 Mar 2024 15:00:02 +0000
Subject: [PATCH] Topology optimization on diffraction gratings

---
 DiffractionGratingsTopOpt/.gitkeep            |   0
 DiffractionGratingsTopOpt/README.md           | 117 ++++
 .../config_topopt_conical_data.py             | 162 +++++
 .../optimization_functions.py                 | 413 +++++++++++++
 .../resolution_functions.py                   | 216 +++++++
 DiffractionGratingsTopOpt/tabs_material.py    | 201 ++++++
 DiffractionGratingsTopOpt/topopt_conical.geo  |  71 +++
 DiffractionGratingsTopOpt/topopt_conical.pro  | 576 ++++++++++++++++++
 .../topopt_conical_clean.sh                   |  18 +
 .../topopt_conical_main.py                    |  85 +++
 10 files changed, 1859 insertions(+)
 create mode 100644 DiffractionGratingsTopOpt/.gitkeep
 create mode 100644 DiffractionGratingsTopOpt/README.md
 create mode 100644 DiffractionGratingsTopOpt/config_topopt_conical_data.py
 create mode 100644 DiffractionGratingsTopOpt/optimization_functions.py
 create mode 100644 DiffractionGratingsTopOpt/resolution_functions.py
 create mode 100644 DiffractionGratingsTopOpt/tabs_material.py
 create mode 100644 DiffractionGratingsTopOpt/topopt_conical.geo
 create mode 100644 DiffractionGratingsTopOpt/topopt_conical.pro
 create mode 100644 DiffractionGratingsTopOpt/topopt_conical_clean.sh
 create mode 100644 DiffractionGratingsTopOpt/topopt_conical_main.py

diff --git a/DiffractionGratingsTopOpt/.gitkeep b/DiffractionGratingsTopOpt/.gitkeep
new file mode 100644
index 0000000..e69de29
diff --git a/DiffractionGratingsTopOpt/README.md b/DiffractionGratingsTopOpt/README.md
new file mode 100644
index 0000000..bd9c9a6
--- /dev/null
+++ b/DiffractionGratingsTopOpt/README.md
@@ -0,0 +1,117 @@
+# Directory in git repository : ```src_blaze/PhD/Maxwell_solvers/meshGrating_topopt_conical```
+
+File : ```README.md```\
+Author : ©Simon Ans\
+Last update : 05/03/2024\
+To get a pdf file from this ```.md``` file, run in a shell terminal :
+
+> ```pandoc README.md --pdf-engine=xelatex -o README.pdf```
+
+## About this directory
+
+---
+
+This directory gathers all the code files necessary to compute the mesh-based topology optimization of a periodic grating. Each element of the Finite Element triangulation can have a different permittivity in order to get the best reflection efficiency possible on a particular order for a given wavelength range.
+
+**One should read the paper "Topology optimization of blazed gratings under conical incidence" available on <u>link</u> before using this script.**
+
+## Quick Start
+
+---
+
+#### **Software Requirements**
+
+Make sure you have got all the following softwares and that they are updated :
+
+* ```gmsh``` 4.11.1 and more (**The location is given in the header of ```config_topopt_conical_data.py```**),
+
+* ```getdp``` 3.5.0 and more (**The location is given in the header of ```config_topopt_conical_data.py```**),
+
+* ```python``` 3.10 and more, with the libraries ```numpy```, ```scipy```, ```matplotlib.pyplot```, ```joblib```, ```os```, ```multiprocessing```, ```time```, ```meshio``` and most importantly ```nlopt``` (https://github.com/stevengj/nlopt). The code has been written using a machine with ```Miniconda3``` installed, hence the ```python``` command is used instead of ```python3```.
+
+#### **Lunch the optimization**
+
+While being in this directory, run in the shell terminal
+
+> ```$ python topopt_conical_main.py```
+
+The two main files of interest are ```rho_opt.pos``` and ```rho_opt.txt```. They define the optimal density distribution in two ways. The first one can be directly displayed with ```Gmsh``` and the second one is automatically displayed into the PDF file ```rho_opt.pdf```.
+
+Once the plots and the results are analysed and/or moved, run
+
+> ```$ sh topopt_conical_clean.sh```
+
+## More detailed description of the directory
+
+---
+
+#### General organization
+
+* ```config_topopt_conical_data.py``` : a Python file that gathers all the data for the simulation,
+
+* ```topopt_conical_main.py``` : the main Python file that handles all the resolution and plots the results,
+
+* ```resolution_functions.py``` : the Python file with all the functions that enable the resolution of the Finite Element problem and the plot of the results,
+
+* ```optimization_functions.py``` : the Python file with the definition of the target and the computation of the Jacobian. There is also the test function for the adjoint method,
+
+* ```tabs_material.py``` : a function that enables the main code to handle any material with its $\varepsilon_r$. See the website https://refractiveindex.info to add the materials,
+
+* ```topopt_conical.geo``` : the geometrical description of the pattern and the definition of the mesh using ```Gmsh```,
+
+* ```topopt_conical.pro``` : the computation file, that solves a given problem on the geometry defined by ```topopt_conical.geo``` with the Finite Element Method using GetDP,
+
+* ```topopt_conical_clean.sh``` : a Shell script that cleans the directory after using.
+  
+#### **Parameters and results obtained**
+
+The output is the local optimal density map ```rho_opt``` (depending on the initial density), saved in the files ```rho_opt.txt``` and ```rho_opt.pos```.
+
+The main parameters are as follows - they are all defined in the ```config``` Python file :
+
+| **Parameter**             | **Name in the scripts**    |  **Default value**   | **Description**|
+|---------------------------|----------------------------|----------------------|----------------|
+| $d$                       | ```period```               | 3300nm               | Period of the pattern |
+| $h_{\text{PML}^+}$        | ```h_PML_sup```            | 500nm                | Superior PML height |
+| $h_{\mathcal{S}^+}$       | ```h_super```              | 1500nm               | Superstrate height |
+| $h_{\mathcal{S}^-}$       | ```h_subs```               | 200nm                | Substrate height |
+| $h_{\text{PML}^-}$        | ```h_PML_inf```            | 200nm                | Inferior PML height |
+| $h_d$                     | ```h_design```             | 650nm                | Height of the design region |
+| $\Lambda_t$               | ```target_wavelength```    | [700nm]              | Target wavelengths for the optimization (Python list) |
+| $A_e$                     | ```amplitude```            | 1                    | Amplitude of the incident electric field |
+| $\theta_i$                | ```theta_i```              | 5°                   | Incidence angle on the (Oxy) plane |
+| $\varphi_i$               | ```phi_i```                | -66°                 | Incidence angle on the (Oyz) plane |
+| $\psi_i$                  | ```psi_i```                | 90°                  | Minimum polarization angle |
+| $N$                       | ```nb_orders```            | 1                    | Number of diffraction orders computed in one direction (total is $[-N,N]$) |
+|                           | ```wanted_order```         | -1                   | Order on which the optimization is proceeded |
+|                           | ```material_superstrate``` | Air                  | Material for the superstrate |
+|                           | ```material_min```         | Air                  | Material with minimal permittivity |
+|                           | ```material_max```         | Fused silica         | Material with maximal permittivity  |
+|                           | ```material_substrate```   | Silver (widerange)   | Material for the substrate |
+|                           | ```num_threads_multilambda```| ```len(lambda_target)```                   | Number of threads to run the multi-wavelength optimization in parallel |
+|                           | ```num_threads_resolution```| 1                   | Number of threads to run the Finite Element Method in parallel |
+|                           | ```tol```                  | 1e-5                 | Tolerance of oscillation of the target function |
+|                           | ```maxiter```              | 100                  | Maximum number of optimization iterations in a single binarization iteration |
+|                           | ```filter_radius```        | 200nm                | Radius of diffusion for the connectedness |
+
+#### Customization
+
+##### **A flexible script**
+
+There are other parameters in the ```config``` file, such as the initial configuration given in the ```analytic_init_density``` function (/!\ every length must be multiplied by ```nm```) and the refinement of the mesh with ```paramaille```, which is typically $\min(\Lambda_t)/h_{\max}$ ($h$ being the size of a mesh element). This size of the mesh can be defined differently in each region.
+
+There are also several flags in order to decide if one wants binarization, connectedness, a metal, etc.
+
+##### **Some other features**
+
+During the optimization, the directory ```res_conical``` is created and filled with a lot of data. The most interesting are the efficiency files ```efficiency_*.txt``` on the targeted diffraction order. The current efficiency is always updated but there are also the ```efficiency_r_*_list.txt``` files that keep the evolutions of each diffraction efficiency in reflection.
+
+Furthermore the total electric field is saved and updated. It can be directly displayed using ```Gmsh```. The adjoint fields are also available, although they are commented by default since they are not necessary for the optimization. The total absorption is also computed.
+
+Finally, at each optimization step, an image of the current density distribution is saved with the name ```myimage_*.png```. It enables to directly make a film of the optimization process.
+
+##### **Check the adjoint method**
+
+In order to be sure that the adjoint method provides the same derivatives as the finite difference method (with the step ```h_0``` in the ```config``` file), there is the function ```optimization_functions.test_Target_n```. One can run some tests. In order to launch a run quickly, it is better to take a small period (max 100nm) on the order 0. However the pattern can be random.
+
+The lines to launch this test is in the main function, and one can launch it by changing ```Flag_test``` to 1 in the ```config``` file. The relative difference between both Jacobians should be around $10^{-2}$ for a simple case.
\ No newline at end of file
diff --git a/DiffractionGratingsTopOpt/config_topopt_conical_data.py b/DiffractionGratingsTopOpt/config_topopt_conical_data.py
new file mode 100644
index 0000000..b7c1359
--- /dev/null
+++ b/DiffractionGratingsTopOpt/config_topopt_conical_data.py
@@ -0,0 +1,162 @@
+import numpy as np
+import matplotlib.pyplot as plt
+import meshio as mio
+import random
+
+'''
+© Simon Ans
+File : config_topopt_conical_main.py
+
+Gathers all the parameters of the simulation.
+        ____________________________________________________
+       | /!\ The reference unity for distances is nanometer |
+       ------------------------------------------------------
+'''
+
+## Paths to the softwares and documents -----------------------------------------------------------------------------------------------
+
+res_folder_name = "res_conical/"
+gmsh_path = ""
+GetDP_path = "~/programs/getdp/build/"
+mesh_file = "design_region.msh"
+
+## Global constants -------------------------------------------------------------------------------------------------------------------
+
+nm           = 1000      # resizing factor for GetDP
+ep0          = 8.854187817e-3 * nm
+mu0          = 400 * np.pi * nm
+cel          = 1 / (np.sqrt(ep0 * mu0))
+deg2rad      = np.pi/180
+
+## Parameters of the simulation -------------------------------------------------------------------------------------------------------
+
+## Dimensions ##
+period    = 3300
+h_PML_sup = 700          # superior PML thickness
+h_super   = 1000         # superstrate thickness
+h_subs    = 200          # substrate thickness
+h_PML_inf = 200          # inferior PML thickness
+
+h_design = 650           # thickness of the design space
+
+## Incident field ##
+target_wavelength = [700]
+#target_wavelength = [400,425,450,475,500,525,550,575,600,650,700,750,800,850,900,950,1000,1050,1100,1150,1200,1300,1400,1500]
+nb_wavelengths    = len(target_wavelength)
+amplitude         = 1
+# Incidence angles (in degrees)
+theta_i           = 5
+phi_i             = -66
+psi_i             = 90
+# phi = -90 and psi = 90  : 2D case with E// polarization
+#               psi = 180 : 2D case with H// polarization
+
+nb_orders    = 1
+wanted_order = -1                       # (integer) diffraction order on which the optimization is carried out
+target_order = nb_orders + wanted_order # (>= 0 integer) shifting of the wanted order for numerical purpose
+
+## Materials ##
+material_superstrate = 'air'        #'silicon_dioxide'  #'niobium_pentoxide'  #'PMMA'  #'silver_IEF' #silver_widerange  #'silver_Johnson_Christy'
+                                    #'ITO_Refractive'  #'BK7_schott' #'ITO_GT'  #'gold_ief_V2'  #'titanium'  #'titanium_dioxyde'
+                                    #'fused_silica'  #'silicon_nitride' #'silicon_internet2'  #'silver_palik'  #'copper_palik'
+                                    #'alu_palik'  #'gold_johnson' #'gold_olmon_evap'  #'chromium_BBM'  #'solar_etr'  #'solar_global_tilt'
+                                    #'solar_direct_circumsolar' #'silicon_salzberg'  #'silicon_odp0'  #'silicon'
+                                    #'silicon_webber'  #'silicon_internet'
+material_min    = 'air'           # minimal epsilon
+material_max    = 'fused_silica'  # maximal epsilon
+                                  # /!\ depending on the type of material, change the Flag_design_metal below !
+material_substrate = 'silver_widerange'
+
+## Numerical parameters ##
+paramaille  = 15         # minimum number of mesh elements per wavelength
+# Refinement coefficients on each region of the geometry (fraction of paramaille)
+paramaille_pmlSup      = 1
+paramaille_superstrate = 1
+paramaille_design      = 1.5
+paramaille_substrate   = 2
+paramaille_pmlInf      = 1
+
+## Parallel computation
+num_threads_multilambda = nb_wavelengths
+num_threads_resolution  = 1
+# /!\ num_threads_multilambda * num_threads_resolution must be < number of available threads on the machine
+
+## Initial density field ##
+def analytic_init_density(x,y):
+    return -(x - period*nm/2)/(period*nm)
+    # return random.random()
+
+## Optimization parameter ##
+# Boundaries of the densities for the simulation
+low_bnd = 0.
+up_bnd  = 1.
+
+# Stopping criteria
+tol = 1e-5
+maxiter = 100
+
+# Filters parameter
+filter_radius = 200   # diffusion
+nu = 1/2              # binarization
+nb_binarizations = 7
+
+# (For the finite differences only) Step of the finite differences
+h_0 = 1e-2
+
+## Choices for the simulation ##
+# Flags
+Flag_diffusion    = 1      # Impose the connectedness (1) or not (0)
+Flag_binarize     = 1      # Binarize the densities (1) or not (0)
+Flag_design_metal = 0      # Is the nanostructure made of metal (1) or not (0)
+Flag_pml_inf      = 0      # Do we need an inferior PML (1) or not (0)?
+Flag_test         = 0      # Launch an optimization (0) or a test on the Jacobian (1)
+Flag_o2_geom      = 0      # Type of finite elements (0 : tetrahedron ; 1 : curved)
+Flag_o2_interp    = 1      # Type of interpolation method (0 : P^2 ; 1 : more)
+
+## Identification of the surfaces of integration --------------------------------------------------------------------------------------
+#  (normally one does not have to change these values)
+PML_SUP     = 2000
+SUPERSTRATE = 2100
+DESIGN      = 2200
+SUBSTRATE   = 2300
+PML_INF     = 2400
+
+SURF_LEFT      = 100
+SURF_RIGHT     = 101
+SURF_UP        = 102
+SURF_DOWN      = 103
+SURF_INTEG_SUP = 120
+SURF_INTEG_SUB = 121
+SURF_PLOT      = 140
+PRINT_POINT    = 150
+
+## Optimization feedbacks -------------------------------------------------------------------------------------------------------------
+
+# Tool for the feedback
+optim_iter = 0
+np.savetxt("optim_iter.txt", np.array([optim_iter]))
+
+def plot_msh_density(current_msh_density, fig_msh_density_filename):
+    ''' Plot and save the density field written in a Python simple array '''
+
+    mesh = mio.read("design_region.msh")
+    fig  = plt.figure(figsize=(6,6))
+    im   = plt.tripcolor(mesh.points[:, 0],mesh.points[:, 1],mesh.cells_dict['triangle'], facecolors=current_msh_density, cmap='Blues', vmin=0, vmax=1)
+    plt.axis('scaled')
+    plt.axis('off')
+    plt.colorbar(im, fraction=0.046, pad=0.04, shrink=0.82)
+    plt.savefig(fig_msh_density_filename, bbox_inches='tight')
+    plt.close(fig)
+
+    return(0)
+
+def display_density(current_rho):
+    ''' Update the iteration of the optimization process and store the current density '''
+
+    global optim_iter
+    optim_iter += 1
+    print("###   Solving problem (direct and inverse) - iteration %03d...   ###"%optim_iter)
+    plot_msh_density(current_rho, "myimage_%03d.png"%optim_iter)
+    np.savetxt("optim_iter.txt", np.array([optim_iter]))
+
+    return(0)
\ No newline at end of file
diff --git a/DiffractionGratingsTopOpt/optimization_functions.py b/DiffractionGratingsTopOpt/optimization_functions.py
new file mode 100644
index 0000000..db716fc
--- /dev/null
+++ b/DiffractionGratingsTopOpt/optimization_functions.py
@@ -0,0 +1,413 @@
+import numpy as np
+import matplotlib.pyplot as plt
+import meshio as mio
+import os
+import re
+import time
+from joblib import Parallel, delayed
+from sklearn.metrics.pairwise import euclidean_distances
+from config_topopt_conical_data import *
+import resolution_functions
+import tabs_material
+
+'''
+© Simon Ans
+File : optimization_functions.py
+'''
+
+##########################################################
+##                   DENSITY FUNCTIONS                  ##
+##   Settle and change the density field on the mesh    ##
+##########################################################
+
+def init_density(templatefile, outfile, initfunc):
+    ''' Initialize a density field on the mesh with an analytic function '''
+    
+    print("###### Initializing template file... ######")
+
+    # Solve a P^0 problem in order to spot the triangles of the mesh
+    os.system(GetDP_path + 'getdp topopt_conical.pro -pre res_init_densities -msh topopt_conical.msh -cal -v 1')
+
+    # Prepare the files that read and store the positions of the triangles
+    f_in  = open(templatefile, 'r')
+    f_out = open(outfile, 'w')
+    lines_in = f_in.readlines()
+    f_out.write(lines_in[0])
+    vals = []
+
+    # Store the value of the density inside each triangle of the mesh (detected through its barycentre)
+    for line in lines_in[1:-1]:
+        bary = np.mean(np.array(re.search(r'\((.*?)\)',line).group(1).split(','),float).reshape(3,3),axis=0)
+        val = initfunc(bary[0],bary[1])
+        f_out.write(re.sub('{.*?}','{%.10f,%.10f,%.10f}'%(val,val,val),line))
+        vals.append(val)
+
+    f_out.write(lines_in[-1])
+    f_in.close()
+    f_out.close()
+
+    print('######  Template file initialized.   ######\n')
+
+    return(np.array(vals, dtype=float))
+
+## -------------------------------------------------------------------------------------------------------------
+
+def get_barycenters():
+    ''' Get the barycenter matrix of the triangles of the mesh topopt_conical.msh '''
+
+    msh = mio.read(mesh_file)
+    res=[]
+    for k in range(len(msh.cells_dict['triangle'])):
+        t = msh.cells_dict['triangle'][k]
+        a,b,c = msh.points[t[0]],msh.points[t[1]],msh.points[t[2]]
+        res.append(np.mean(np.array([a,b,c]),axis=0).tolist())
+    
+    return np.array(res)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def update_density(templatefile, outfile, tab):
+    ''' Update the density field with the current density in the optimization process '''
+
+    # Same as init_density
+    f_in  = open(templatefile, 'r')
+    f_out = open(outfile, 'w')
+    lines_in = f_in.readlines()
+    f_out.write(lines_in[0])
+        
+    # Update (read the table of the template mesh and put the values of the current densities)
+    counter = 0
+    for line in lines_in[1:-1]:
+        template_density = tab[counter]
+        f_out.write(re.sub('{.*?}','{%.10f,%.10f,%.10f}'%(template_density,template_density,template_density),line))
+        counter += 1
+    f_out.write(lines_in[-1])
+    f_in.close()
+    f_out.close()
+
+    return(0)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def read_real_posfile(posfile):
+    ''' Read a complex .pos file to make an array '''
+
+    # Same as init_density
+    f_in  = open(posfile, 'r')
+    lines_in = f_in.readlines()
+    real_table = []
+
+    # Read the accurate inputs of the .pos file
+    for line in lines_in[1:-1]:
+        current_line = np.array(re.search(r'\{(.*?)\}',line).group(1).split(','),float)
+        real_table.append(current_line[0])
+    f_in.close()
+
+    real_table = np.array(np.real(real_table), dtype=float)
+    
+    return(real_table)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def read_complex_posfile(posfile):
+    ''' Read a complex .pos file to make an array '''
+
+    # Same as init_density
+    f_in  = open(posfile, 'r')
+    lines_in = f_in.readlines()
+    complex_table = []
+
+    # Read the accurate inputs of the .pos file
+    for line in lines_in[1:-2]:
+        current_line = np.array(re.search(r'\{(.*?)\}',line).group(1).split(','),float)
+        complex_table.append(current_line[0]+1j*current_line[3])
+    f_in.close()
+
+    complex_table = np.array(np.real(complex_table), dtype=float) + 1j*np.array(np.imag(complex_table), dtype=float)
+    
+    return(complex_table)
+
+##########################################################
+##                CONSTRAINTS FUNCTIONS                 ##
+##   Apply the diffusion and/or binarization filters    ##
+##########################################################
+
+def diffusion_filter(density):
+    ''' Filter of the mesh to avoid the isolated points of density '''
+
+    midpoint = get_barycenters()
+    distance_temp = filter_radius*nm - euclidean_distances(midpoint, midpoint)
+    distance_temp[distance_temp < 0] = 0
+    distance_mat = distance_temp.copy()
+    distance_sum = distance_mat.sum(1)
+    rho_diffusion_Filtered = np.divide(distance_mat @ (density.flatten()), distance_sum)
+    return rho_diffusion_Filtered
+
+## -------------------------------------------------------------------------------------------------------------
+
+def diffusion_filter_jacobian():
+    ''' Jacobian of the diffusion filter '''
+
+    midpoint = get_barycenters()
+    distance_temp = filter_radius*nm - euclidean_distances(midpoint, midpoint)
+    distance_temp[distance_temp < 0] = 0
+    distance_mat = distance_temp.copy()
+    distance_sum = distance_mat.sum(1)
+    diffusion_jacobian = np.divide(distance_mat, distance_sum)
+    return diffusion_jacobian
+
+## -------------------------------------------------------------------------------------------------------------
+
+def binarize_filter(density, iter_bin):
+    ''' Binarize the mesh with a degree given by iter_bin '''
+
+    beta_f = 2**iter_bin
+    return ( (np.tanh(beta_f*nu) + np.tanh(beta_f*(density - nu))) / (np.tanh(beta_f*nu) + np.tanh(beta_f*(1 - nu))) )
+
+## -------------------------------------------------------------------------------------------------------------
+
+def binarize_filter_jacobian(density, iter_bin):
+    ''' Jacobian of the binarization filter '''
+
+    beta_f = 2**iter_bin
+    return np.diag( (beta_f * (1 - np.tanh(beta_f*(density-nu))**2)) / (np.tanh(beta_f*nu) + np.tanh(beta_f*(1 - nu))) )
+
+## -------------------------------------------------------------------------------------------------------------
+
+def composition_filters(density, iter_bin):
+    ''' Compose the filters previously defined depending on the flags '''
+
+    raw_density = density.copy()
+    if ((Flag_diffusion == 0) and (Flag_binarize == 0)): return raw_density
+    if ((Flag_diffusion == 1) and (Flag_binarize == 0)): return diffusion_filter(raw_density)
+    if ((Flag_diffusion == 0) and (Flag_binarize == 1)): return binarize_filter(raw_density, iter_bin)
+    if ((Flag_diffusion == 1) and (Flag_binarize == 1)): return binarize_filter(diffusion_filter(raw_density), iter_bin)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def composition_filters_jacobian(density, iter_bin):
+    ''' Compute the Jacobian matrix of the composition of the filters depending on the flags '''
+
+    raw_density = density.copy()
+    problem_size = np.size(raw_density)
+    if ((Flag_diffusion == 0) and (Flag_binarize == 0)): return np.identity(problem_size)
+    if ((Flag_diffusion == 1) and (Flag_binarize == 0)): return diffusion_filter_jacobian()
+    if ((Flag_diffusion == 0) and (Flag_binarize == 1)): return binarize_filter_jacobian(raw_density, iter_bin)
+    if ((Flag_diffusion == 1) and (Flag_binarize == 1)): return np.matmul( diffusion_filter_jacobian(), binarize_filter_jacobian(diffusion_filter(raw_density), iter_bin) )
+
+## -------------------------------------------------------------------------------------------------------------
+
+def final_binarization(templatefile, nonbin_posfile):
+    ''' After the optimization, a final binarization to counter the last diffusion filter applied '''
+
+    rho_opt_nonbin = read_real_posfile(nonbin_posfile)
+    rho_opt_bin = binarize_filter(rho_opt_nonbin, nb_binarizations)
+    np.savetxt("rho_opt.txt", rho_opt_bin)
+    update_density(templatefile, "rho_opt.pos", rho_opt_bin)
+    last_iter = (nb_binarizations+1)*maxiter+1
+    plot_msh_density(rho_opt_bin, "myimage_%03d.png"%last_iter)
+
+    return(0)
+
+##########################################################
+##                OPTIMIZATION FUNCTIONS                ##
+##     Main functions for the topology optimization     ##
+##########################################################
+
+def compute_target_and_jacobian(i_wavelength):
+    ''' Calculate the Jacobian of the target using the complex amplitudes and their derivatives '''
+
+    wavelength = target_wavelength[i_wavelength]
+
+    # Components of the wave vectors (same reasoning as in the .pro file)
+    lambda0 = wavelength*nm
+    k0      = 2*np.pi / lambda0
+    n_super, k_super, epsilon_r_super = np.real(tabs_material.epsilon(material_superstrate, wavelength*1e-9))
+    deg2rad = np.pi/180
+
+    alpha      = -k0*n_super*np.sin(theta_i*deg2rad)*np.sin(phi_i*deg2rad)
+    beta_super = -k0*n_super*np.cos(theta_i*deg2rad)
+    gamma      = -k0*n_super*np.sin(theta_i*deg2rad)*np.cos(phi_i*deg2rad)
+
+    alpha_n      = alpha + 2*np.pi/(period*nm) * wanted_order
+    beta_n_super = -np.sqrt(epsilon_r_super*k0**2 - alpha_n**2 - gamma**2)
+
+    # Read the result files in order to get the complex amplitudes and their derivatives
+    comp_amp_x_tab = np.loadtxt(res_folder_name + "comp_amp_x_r_%d_%d.txt"%(wanted_order,i_wavelength))
+    comp_amp_z_tab = np.loadtxt(res_folder_name + "comp_amp_z_r_%d_%d.txt"%(wanted_order,i_wavelength))
+    comp_amp_x     = comp_amp_x_tab[1] + 1j*comp_amp_x_tab[2]
+    comp_amp_z     = comp_amp_z_tab[1] + 1j*comp_amp_z_tab[2]
+
+    comp_amp_x_derivative = read_complex_posfile(res_folder_name + "comp_amp_deriv_x_r_project_%d.pos"%i_wavelength)
+    comp_amp_z_derivative = read_complex_posfile(res_folder_name + "comp_amp_deriv_z_r_project_%d.pos"%i_wavelength)
+
+    target_jacobian = -2/(beta_n_super*beta_super*amplitude**2) * np.real((beta_n_super**2 + alpha_n**2) * comp_amp_x_derivative*np.conjugate(comp_amp_x)
+                                                                        + (beta_n_super**2 + gamma**2)   * comp_amp_z_derivative*np.conjugate(comp_amp_z)
+                                                                        + alpha_n*gamma * (comp_amp_x_derivative*np.conjugate(comp_amp_z) + comp_amp_x*np.conjugate(comp_amp_z_derivative)))
+
+    return(np.array(target_jacobian, dtype=float))
+
+## -------------------------------------------------------------------------------------------------------------
+
+def get_sum_targetJacobian(target_jacobian):
+    ''' Solve the direct and adjoint problems for each wavelength and add them together
+        in order to get the wanted efficiencies and their Jacobian '''
+
+    # Enable each wavelength to access the current density
+    for i_wavelength in range(nb_wavelengths):
+        os.system("cp -r rho_opt.pos topopt_conical_wavelength" + str(i_wavelength))
+
+    # Run the direct and adjoint problem to compute the target and its Jacobian 
+    temp_target_jacobian = np.zeros(np.size(target_jacobian))
+    temp_target   = 0
+    Parallel(n_jobs=num_threads_multilambda)(delayed(resolution_functions.solve)(i_wavelength) for i_wavelength in range(nb_wavelengths))
+    for i_wavelength in range(nb_wavelengths) :
+        temp_target_jacobian += compute_target_and_jacobian(i_wavelength)
+        temp_target   += np.loadtxt(res_folder_name + "efficiency_r_%d_%d.txt"%(wanted_order,i_wavelength))[1]
+
+    return temp_target, temp_target_jacobian
+
+## -------------------------------------------------------------------------------------------------------------
+
+def target(input_density, target_jacobian):
+    ''' Definition of the target function and its jacobian for the optimization problem
+        The fact that 'target_jacobian' is an input is a requirement of the NLopt class '''
+
+    iter_bin = int(np.loadtxt("iter_bin.txt"))
+
+    # Filter the densities depending on the filtering flags
+    updated_density  = composition_filters(input_density, iter_bin)
+    # Compute the Jacobian of this filter
+    filters_jacobian = composition_filters_jacobian(input_density, iter_bin)
+
+    # Store the filtered density file for the solver
+    update_density(res_folder_name + "template_density_table.pos", "rho_opt.pos", updated_density)
+
+    if (Flag_test == 0):
+        # Display the updated densities on the pattern
+        display_density(updated_density)
+    # Access the efficiencies and their Jacobian for each wavelength, and add them together
+    temp_target, temp_target_jacobian = get_sum_targetJacobian(target_jacobian)
+
+    # Update the Jacobian
+    if (np.size(target_jacobian) > 0):
+        target_jacobian[:] = 1/nb_wavelengths * np.matmul(filters_jacobian, temp_target_jacobian)
+        np.savetxt("jacobian.txt", target_jacobian)
+
+    # Update the target
+    target = 1 - temp_target/nb_wavelengths
+
+    return(target)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def feedback_result(min_value, successful_termination):
+    ''' Displays the termination of the optimization with sentences '''
+
+    if (successful_termination > 0):
+        print("######              Optimization ended successfully.          ######\n")
+        if (successful_termination == 3):
+            print("The tolerance on the target function is reached.")
+        elif (successful_termination == 5):
+            print("The maximal number of iterations is reached.")
+        print("Reflection efficiency : %.6f"%(1-min_value))
+    else :
+        print("######          Issue encountered during optimization.        ######\n")
+        print(("Value of the termination : %d (see the nlopt reference https://nlopt.readthedocs.io/en/latest/ for details).\n"%successful_termination))
+    
+    return(0)
+
+##########################################################
+##                   TEST FUNCTIONS                     ##
+##    Comparison adjoint / finite element derivatives   ##
+##########################################################
+
+def test_jacobian(rho_init, iter_bin):
+    ''' Compare the derivatives computed with the adjoint problem and with the finite differences for the target function
+        * The first one is given by the Jacobian computed by target(rho_init, jacobian)
+        * The second one is the result of (target(rho_init,...) - target(rho_init + h_0,...)) / h_0 on each triangle of the mesh '''
+
+    print("######  Test of the adjoint method   ######\n")
+    plot_msh_density(rho_init, "rho_init.pdf")
+    np.savetxt("iter_bin.txt", np.array([iter_bin]))
+    problem_size = np.size(rho_init)
+
+    jacobian = np.zeros(problem_size)
+    target_rho_plus_h0 = np.zeros_like(jacobian)
+
+    # Estimation of the test duration ---------------------------------------------
+    t1 = time.time()
+
+    # Solve the direct and adjoint problems in order to access the target with the initial densities
+    # and the Jacobian computed by the adjoint method
+    target_rho = target(rho_init, jacobian)
+    numerical_jacobian_adjoint = np.loadtxt("jacobian.txt")
+
+    t2 = time.time()
+    print("## Finite differences computation : beginning the loop on %d triangles."%problem_size)
+    print("## Estimated remaining time : %dmin%02ds"%((t2-t1)*problem_size//60, (t2-t1)*problem_size%60))
+    # -----------------------------------------------------------------------------
+    
+    # Loop on the triangles to compute the finite differences for each one    
+    for i_triangle in range(problem_size):
+        rho_plus_h0 = rho_init.copy()
+        rho_plus_h0[i_triangle] += h_0
+
+        # Compute the target with the slightly different densities
+        target_rho_plus_h0[i_triangle] = target(rho_plus_h0, jacobian)
+
+    # Final computation of the finite differences
+    numerical_jacobian_finite_diff = (target_rho_plus_h0 - target_rho) / h_0
+    # Relative difference between both methods
+    diff_rel = (numerical_jacobian_finite_diff - numerical_jacobian_adjoint) / np.mean(np.abs(numerical_jacobian_finite_diff))
+
+    # Save the results in text files
+    np.savetxt("adjoint.txt", numerical_jacobian_adjoint)
+    np.savetxt("finite_diff.txt", numerical_jacobian_finite_diff)
+    np.savetxt("diff_rel.txt", diff_rel)
+
+    # Plot the results on the pattern
+    plot_msh_density(numerical_jacobian_adjoint, "adjoint_jacobian_Target_n.pdf")
+    plot_msh_density(numerical_jacobian_finite_diff, "finite_diff_jacobian_Target_n.pdf")
+    plot_msh_density(np.abs(diff_rel), "diff_jacobian_Target_n.pdf")
+
+    print("######         End of the test       ######\n")
+
+    return(0)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def test_jacobian_soloPoint(rho_init, iter_bin, x_point, y_point):
+    ''' Compare the derivatives computed with the adjoint problem and with the finite differences for the target function,
+        but only for one specific point '''
+
+    print("######  Test of the adjoint method   ######\n")
+    plot_msh_density(rho_init, "rho_init.pdf")
+    np.savetxt("iter_bin.txt", np.array([iter_bin]))
+    problem_size = np.size(rho_init)
+    jacobian = np.zeros(problem_size)
+
+    # Spot the closest triangle to the point (x_point, y_point)
+    midpoint = get_barycenters()/nm
+    closest_point = np.argmin( np.sqrt((x_point-midpoint[:,0])**2 + (y_point-midpoint[:,1])**2) )
+
+    # Solve the direct and adjoint problems in order to access the target with the initial densities
+    # and the Jacobian computed by the adjoint method
+    target_rho = target(rho_init, jacobian)
+    numerical_jacobian_adjoint = np.loadtxt("jacobian.txt")[closest_point]
+
+    # Compute the target on the triangle closest_point
+    rho_plus_h0 = rho_init.copy()
+    rho_plus_h0[closest_point] += h_0
+    target_rho_plus_h0 = target(rho_plus_h0, jacobian)
+
+    # Final computation of the finite differences
+    numerical_jacobian_finite_diff = (target_rho_plus_h0 - target_rho) / h_0
+    # Relative difference between both methods
+    diff_rel = (numerical_jacobian_finite_diff - numerical_jacobian_adjoint) / np.abs(numerical_jacobian_finite_diff)
+    print("######         End of the test       ######\n")
+    print("Jacobian computed : * with the adjoint method     on the point (%.0f,%.0f) : %.5f"%(x_point,y_point,numerical_jacobian_adjoint))
+    print("                    * with the finite differences on the point (%.0f,%.0f) : %.5f"%(x_point,y_point,numerical_jacobian_finite_diff))
+    print("Relative differences between both Jacobian methods : %.5f"%diff_rel)
+    
+    return(0)
\ No newline at end of file
diff --git a/DiffractionGratingsTopOpt/resolution_functions.py b/DiffractionGratingsTopOpt/resolution_functions.py
new file mode 100644
index 0000000..63a274c
--- /dev/null
+++ b/DiffractionGratingsTopOpt/resolution_functions.py
@@ -0,0 +1,216 @@
+import numpy as np
+import matplotlib.pyplot as plt
+import os
+import multiprocessing
+import tabs_material
+from config_topopt_conical_data import *
+
+##########################################################
+##             FUNCTIONS USING THE TERMINAL             ##
+##                  Use Gmsh and GetDP                  ##
+##########################################################
+
+def generate_mesh():
+    ''' Once the file param.dat is created, run this line to generate the corresponding mesh '''
+    print("######            Meshing...         ######")
+    os.system(gmsh_path + "gmsh topopt_conical.geo -v 0 -")
+    print("######       Meshing completed.      ######\n")
+
+    return(0)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def make_computation_directories():
+    ''' Prepare the directories to run the resolution for every wavelength
+        Adapt the param.dat file'''
+
+    # Initial wavelength
+    initial_wavelength = target_wavelength[0]
+    # Initial permittivities and permeabilities
+    initial_n_super, initial_k_super, initial_epsilon_r_super = tabs_material.epsilon(material_superstrate, target_wavelength[0]*1e-9)
+    initial_n_min  , initial_k_min  , initial_epsilon_r_min   = tabs_material.epsilon(material_min, target_wavelength[0]*1e-9)
+    initial_n_max  , initial_k_max  , initial_epsilon_r_max   = tabs_material.epsilon(material_max, target_wavelength[0]*1e-9)
+    initial_n_subs , initial_k_subs , initial_epsilon_r_subs  = tabs_material.epsilon(material_substrate, target_wavelength[0]*1e-9)
+
+    for i_wavelength in range(nb_wavelengths):
+        ## Make directory and copy the useful files
+        os.system("mkdir topopt_conical_wavelength" + str(i_wavelength))
+        os.system("cp -r param.dat topopt_conical.geo topopt_conical.msh topopt_conical.pro tabs_material.py topopt_conical_wavelength" + str(i_wavelength))
+    
+        ## Adapt the param.dat file
+        os.chdir("topopt_conical_wavelength" + str(i_wavelength))
+
+        # Wavelength and iteration
+        current_wavelength  = target_wavelength[i_wavelength]
+        os.system("sed -i 's/lambda_wavelength = %.15e;/lambda_wavelength = %.15e;/g' param.dat"%(initial_wavelength, current_wavelength))
+        os.system("sed -i 's/i_lambda = 0;/i_lambda = %d;/g' param.dat"%i_wavelength)
+
+        # Permittivities and permeabilities for every wavelength
+        current_n_super, current_k_super, current_epsilon_r_super = tabs_material.epsilon(material_superstrate, target_wavelength[i_wavelength]*1e-9)
+        current_n_min  , current_k_min  , current_epsilon_r_min   = tabs_material.epsilon(material_min, target_wavelength[i_wavelength]*1e-9)
+        current_n_max  , current_k_max  , current_epsilon_r_max   = tabs_material.epsilon(material_max, target_wavelength[i_wavelength]*1e-9)
+        current_n_subs , current_k_subs , current_epsilon_r_subs  = tabs_material.epsilon(material_substrate, target_wavelength[i_wavelength]*1e-9)
+
+        os.system("sed -i 's/epsilon_r_super_re = %.15e;/epsilon_r_super_re = %.15e;/g' param.dat"%(np.real(initial_epsilon_r_super), np.real(current_epsilon_r_super)))
+        os.system("sed -i 's/epsilon_r_super_im = %.15e;/epsilon_r_super_im = %.15e;/g' param.dat"%(np.imag(initial_epsilon_r_super), np.imag(current_epsilon_r_super)))
+        os.system("sed -i 's/n_super = %.15e;/n_super = %.15e;/g' param.dat"%(initial_n_super, current_n_super))
+        os.system("sed -i 's/k_super = %.15e;/k_super = %.15e;/g' param.dat"%(initial_k_super, current_k_super))
+        os.system("sed -i 's/epsilon_r_min_re = %.15e;/epsilon_r_min_re = %.15e;/g' param.dat"%(np.real(initial_epsilon_r_min), np.real(current_epsilon_r_min)))
+        os.system("sed -i 's/epsilon_r_min_im = %.15e;/epsilon_r_min_im = %.15e;/g' param.dat"%(np.imag(initial_epsilon_r_min), np.imag(current_epsilon_r_min)))
+        os.system("sed -i 's/n_min = %.15e;/n_min = %.15e;/g' param.dat"%(initial_n_min, current_n_min))
+        os.system("sed -i 's/k_min = %.15e;/k_min = %.15e;/g' param.dat"%(initial_k_min, current_k_min))
+        os.system("sed -i 's/epsilon_r_max_re = %.15e;/epsilon_r_max_re = %.15e;/g' param.dat"%(np.real(initial_epsilon_r_max), np.real(current_epsilon_r_max)))
+        os.system("sed -i 's/epsilon_r_max_im = %.15e;/epsilon_r_max_im = %.15e;/g' param.dat"%(np.imag(initial_epsilon_r_max), np.imag(current_epsilon_r_max)))
+        os.system("sed -i 's/n_max = %.15e;/n_max = %.15e;/g' param.dat"%(initial_n_max, current_n_max))
+        os.system("sed -i 's/k_max = %.15e;/k_max = %.15e;/g' param.dat"%(initial_k_max, current_k_max))
+        os.system("sed -i 's/epsilon_r_subs_re = %.15e;/epsilon_r_subs_re = %.15e;/g' param.dat"%(np.real(initial_epsilon_r_subs), np.real(current_epsilon_r_subs)))
+        os.system("sed -i 's/epsilon_r_subs_im = %.15e;/epsilon_r_subs_im = %.15e;/g' param.dat"%(np.imag(initial_epsilon_r_subs), np.imag(current_epsilon_r_subs)))
+        os.system("sed -i 's/n_subs = %.15e;/n_subs = %.15e;/g' param.dat"%(initial_n_subs, current_n_subs))
+        os.system("sed -i 's/k_subs = %.15e;/k_subs = %.15e;/g' param.dat"%(initial_k_subs, current_k_subs))
+        os.chdir("..")
+
+    return(0)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def solve(i_wavelength):
+    ''' Launch GetDP to solve the problem on the mesh generated with the current data file '''
+
+    current_wavelength = target_wavelength[i_wavelength]
+    # Move into the corresponding directory
+    os.chdir("topopt_conical_wavelength" + str(i_wavelength))
+
+    os.system(GetDP_path + "getdp topopt_conical.pro -pre helmholtz_conical_direct_inverse -msh topopt_conical.msh -cal -petsc_prealloc 200 -setnumber lambda0 " + str(current_wavelength * nm) + " -v 1")
+
+    # Move again into the main directory
+    os.chdir("..")
+
+    return(0)
+
+##########################################################
+##                 TOOLS FOR THE DATA                   ##
+##            Functions to reduce set_data              ##
+##########################################################
+
+def check_quantites():
+    ''' In the set_data program, check if the quantities are coherent '''
+
+    if h_design > h_super:
+        raise ValueError("h_design > h_super, please increase h_super.")
+    if ((theta_i > 90) or (theta_i < 0)):
+        raise ValueError("The angle of incidence out of the plane is not in the correct interval (0° < theta_i < 90°)")
+    if ((phi_i > 180) or (phi_i < -180)):
+        raise ValueError("The angle of incidence in the plane is not in the correct interval (-180° < phi_i < 180°)")
+    if ((psi_i > 180) or (psi_i < -180)):
+        raise ValueError("The angle of polarization is not in the correct interval (-180° < psi_i < 180°)")
+    if multiprocessing.cpu_count() < num_threads_multilambda * num_threads_resolution :
+        raise ValueError("The number of CPUs of the current machine is too low regarding the number of threads allocated (for the multi-wavelength and the Finite Element resolutions).")
+    if paramaille < 10:
+        print("Warning : The number of mesh elements per wavelength is quite low (minimum should be 10). The result might not be precise enough.")
+        wait = input("Do you want to continue anyway ? (Press Enter if yes)")
+
+    return(0)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def write_param(integer_parameters_name, integer_parameters_value, float_parameters_name, float_parameters_value):
+    ''' Write in a file called param.dat all the data contained in parameters '''
+
+    param = open("param.dat","w")
+
+    length_integers = len(integer_parameters_name)
+    length_float    = len(float_parameters_name)
+
+    for i_integers in range (length_integers):
+        param.write("%s = %d;\n"%(integer_parameters_name[i_integers], integer_parameters_value[i_integers]))
+    
+    for i_float in range (length_float):
+        param.write("%s = %.15e;\n"%(float_parameters_name[i_float], float_parameters_value[i_float]))
+
+    param.close()
+
+    return(0)
+
+##########################################################
+##                   MAIN FUNCTIONS                     ##
+##       Parameters and resolution of the problem       ##
+##########################################################
+
+def set_data():
+    ''' Input the data into a file to create the periodic 2D geometry with its physical parameters
+        It is read by the .geo and .pro files '''    
+
+    ## Check if the quantities are coherent  -------------------------------------------------------------------
+
+    check_quantites()
+
+    ## Permittivities ------------------------------------------------------------------------------------------
+    n_super, k_super, epsilon_r_super = tabs_material.epsilon(material_superstrate, target_wavelength[0]*1e-9)
+    n_min, k_min, epsilon_r_min = tabs_material.epsilon(material_min, target_wavelength[0]*1e-9)
+    n_max, k_max, epsilon_r_max = tabs_material.epsilon(material_max, target_wavelength[0]*1e-9)
+    n_subs, k_subs, epsilon_r_subs    = tabs_material.epsilon(material_substrate, target_wavelength[0]*1e-9)
+
+    epsilon_r_super_re = epsilon_r_super.real
+    epsilon_r_super_im = epsilon_r_super.imag
+    mu_r_super_re = 1
+    mu_r_super_im = 0
+    epsilon_r_min_re = epsilon_r_min.real
+    epsilon_r_min_im = epsilon_r_min.imag
+    epsilon_r_max_re = epsilon_r_max.real
+    epsilon_r_max_im = epsilon_r_max.imag
+    mu_r_voxel_re = 1
+    mu_r_voxel_im = 0
+    epsilon_r_subs_re = epsilon_r_subs.real
+    epsilon_r_subs_im = epsilon_r_subs.imag
+    mu_r_subs_re = 1
+    mu_r_subs_im = 0    
+
+    ## Resize the quantities -----------------------------------------------------------------------------------
+
+    Period  = nm * period
+    hpmlsup = nm * h_PML_sup
+    hsuper  = nm * h_super
+    hdesign = nm * h_design
+    hsubs   = nm * h_subs
+    hpmlinf = nm * h_PML_inf
+
+    ## Write in the file ---------------------------------------------------------------------------------------
+
+    # list of the names of the integer parameters to write the param.dat file
+    integer_parameters_name = ["i_lambda", "target_order", "nb_orders", "Flag_o2_geom", "Flag_o2_interp", "Flag_pml_inf", "Flag_design_metal", "PML_SUP", "SUPERSTRATE", "SUBSTRATE", "PML_INF", "SURF_LEFT", "SURF_RIGHT", "SURF_UP", "SURF_DOWN", "SURF_INTEG_SUP", "SURF_INTEG_SUB", "SURF_PLOT", "PRINT_POINT", "DESIGN"]
+
+    # list of the values of the integers parameters to write the param.dat file
+    integer_parameters_value = [0, target_order, nb_orders, Flag_o2_geom, Flag_o2_interp, Flag_pml_inf, Flag_design_metal, PML_SUP,  SUPERSTRATE, SUBSTRATE, PML_INF, SURF_LEFT, SURF_RIGHT, SURF_UP, SURF_DOWN, SURF_INTEG_SUP, SURF_INTEG_SUB, SURF_PLOT, PRINT_POINT, DESIGN]
+
+    # list of the names of the float parameters to write the param.dat file
+    float_parameters_name = ["lambda_wavelength", "nm", "ep0", "mu0", "cel", "deg2rad", "period", "h_PML_sup", "h_super", "h_design", "h_subs", "h_PML_inf", "paramaille", "paramaille_pmlSup", "paramaille_superstrate", "paramaille_design", "paramaille_substrate", "paramaille_pmlInf", "theta_incidence", "phi_incidence", "psi_incidence", "A"]
+    float_parameters_name += ["epsilon_r_super_re", "epsilon_r_super_im", "n_super", "k_super", "mu_r_super_re", "mu_r_super_im", "epsilon_r_min_re", "epsilon_r_min_im", "n_min", "k_min", "epsilon_r_max_re", "epsilon_r_max_im", "n_max", "k_max", "mu_r_voxel_re", "mu_r_voxel_im", "epsilon_r_subs_re", "epsilon_r_subs_im", "n_subs", "k_subs", "mu_r_subs_re", "mu_r_subs_im"]
+    
+    # list of the values of the float parameters to write the param.dat file
+    float_parameters_value = [target_wavelength[0], nm, ep0, mu0, cel, deg2rad, Period, hpmlsup, hsuper, hdesign, hsubs, hpmlinf, paramaille, paramaille_pmlSup, paramaille_superstrate, paramaille_design, paramaille_substrate, paramaille_pmlInf, theta_i, phi_i, psi_i, amplitude]
+    float_parameters_value += [epsilon_r_super_re, epsilon_r_super_im, n_super, k_super, mu_r_super_re, mu_r_super_im, epsilon_r_min_re, epsilon_r_min_im, n_min, k_min, epsilon_r_max_re, epsilon_r_max_im, n_max, k_max, mu_r_voxel_re, mu_r_voxel_im, epsilon_r_subs_re, epsilon_r_subs_im, n_subs, k_subs, mu_r_subs_re, mu_r_subs_im]
+
+    write_param(integer_parameters_name, integer_parameters_value, float_parameters_name, float_parameters_value)
+
+    return(0)
+
+## -------------------------------------------------------------------------------------------------------------
+
+def print_sum_energies():
+    ''' Check the sum of the efficiencies and losses (must be 1 is nb_orders is high) '''
+
+    sum_efficiency_r = np.zeros(nb_wavelengths)
+    sum_efficiency_t = np.zeros_like(sum_efficiency_r)
+    losses_tot       = np.zeros_like(sum_efficiency_r)
+    sum_energies     = np.zeros_like(sum_efficiency_r)
+    for i_wavelength in range (nb_wavelengths):
+        for i_order in range (2*nb_orders+1):
+            sum_efficiency_r[i_wavelength] += np.loadtxt(res_folder_name + "efficiency_r_%d_%d.txt"%(i_order-nb_orders,i_wavelength))[1]
+            sum_efficiency_t[i_wavelength] += np.loadtxt(res_folder_name + "efficiency_t_%d_%d.txt"%(i_order-nb_orders,i_wavelength))[1]
+        losses_tot[i_wavelength] = np.loadtxt(res_folder_name + "absorption-Q_tot_%d.txt"%i_wavelength)[1]
+        sum_energies[i_wavelength] = sum_efficiency_r[i_wavelength] + sum_efficiency_t[i_wavelength] + losses_tot[i_wavelength]
+
+    print("Sum of the efficiencies and losses for the wavelengths of target_wavelength :")
+    print(sum_energies)
+
+    return(0)
\ No newline at end of file
diff --git a/DiffractionGratingsTopOpt/tabs_material.py b/DiffractionGratingsTopOpt/tabs_material.py
new file mode 100644
index 0000000..c6c9293
--- /dev/null
+++ b/DiffractionGratingsTopOpt/tabs_material.py
@@ -0,0 +1,201 @@
+import scipy as sc
+from scipy.interpolate import interp1d
+import numpy as np
+
+'''
+File : tabs_material.py
+
+INPUT :
+    * material : complex number or string that has to refer to the ones presented below
+                 Material which one wants to know the permittivity
+    * wavelength : float that has to be in a certain interval
+                   Wavelength (m) to obtain the corresponding permittivity
+
+This file gathers the optical index / permittivity of some materials found on the
+website : refractiveindex.info
+'''
+
+def epsilon(material,wavelength):
+    lambda_data = np.array([])
+    eps_data = np.array([])
+    if (type(material)==float or type(material)==complex or type(material)==int):return (np.sqrt((np.abs(material)+np.real(material))/2), np.sqrt((np.abs(material)-np.real(material))/2), complex(material))
+    else:
+        if material=='silicon_dioxide':
+            lambda_data = np.array([0.1984,0.2066,0.2139,0.2144,0.2267,0.2302,0.2378,0.2399,0.2483,0.2652,0.2699,0.2753,0.2803,0.2894,0.2967,0.3021,0.3303,0.3341,0.3404,0.3466,0.3611,0.365,0.4047,0.4358,0.4678,0.4861,0.5086,0.5461,0.577,0.5791,0.5876,0.5893,0.6438,0.6563,0.6678,0.7065,0.8521,0.8943,1.014,1.083,1.1287,1.3622,1.3951,1.4695,1.5295,1.6606,1.681,1.6932,1.7091,1.8131,1.9701,2.0581,2.1526,2.3254,2.4374,3.2439])*1e-6
+            n_data      = np.array([1.554,1.543,1.5343,1.5337,1.5228,1.5201,1.5147,1.5134,1.5084,1.5,1.4981,1.4959,1.494,1.491,1.4887,1.4872,1.4805,1.4798,1.4786,1.4775,1.4751,1.4745,1.4696,1.4667,1.4643,1.4631,1.4619,1.4601,1.4589,1.4588,1.4585,1.4584,1.4567,1.4564,1.4561,1.4551,1.4525,1.4519,1.4503,1.4494,1.4489,1.4462,1.4458,1.445,1.4443,1.4427,1.4424,1.4423,1.4421,1.4407,1.4385,1.4372,1.4358,1.4329,1.4309,1.4131])
+            k_data      = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
+            eps_data    = (n_data+1j*k_data)**2
+        elif material=='niobium_pentoxide':
+            lambda_data = np.arange(320,1602,2)*1e-9
+            n_data      = np.flip([2.180329,2.180363,2.180398,2.180432,2.180466,2.180501,2.180536,2.18057,2.180605,2.180641,2.180676,2.180711,2.180747,2.180782,2.180818,2.180854,2.18089,2.180927,2.180963,2.180999,2.181036,2.181073,2.18111,2.181147,2.181184,2.181222,2.181259,2.181297,2.181335,2.181373,2.181411,2.181449,2.181488,2.181526,2.181565,2.181604,2.181643,2.181682,2.181721,2.181761,2.181801,2.181841,2.181881,2.181921,2.181961,2.182002,2.182042,2.182083,2.182124,2.182165,2.182207,2.182248,2.18229,2.182332,2.182374,2.182416,2.182459,2.182501,2.182544,2.182587,2.18263,2.182673,2.182717,2.18276,2.182804,2.182848,2.182892,2.182937,2.182981,2.183026,2.183071,2.183116,2.183161,2.183207,2.183253,2.183299,2.183345,2.183391,2.183437,2.183484,2.183531,2.183578,2.183625,2.183673,2.183721,2.183769,2.183817,2.183865,2.183914,2.183962,2.184011,2.18406,2.18411,2.184159,2.184209,2.184259,2.18431,2.18436,2.184411,2.184462,2.184513,2.184564,2.184616,2.184668,2.18472,2.184772,2.184825,2.184877,2.18493,2.184984,2.185037,2.185091,2.185145,2.185199,2.185253,2.185308,2.185363,2.185418,2.185474,2.185529,2.185585,2.185641,2.185698,2.185755,2.185812,2.185869,2.185926,2.185984,2.186042,2.186101,2.186159,2.186218,2.186277,2.186336,2.186396,2.186456,2.186516,2.186577,2.186638,2.186699,2.18676,2.186822,2.186884,2.186946,2.187008,2.187071,2.187134,2.187198,2.187262,2.187326,2.18739,2.187455,2.187519,2.187585,2.18765,2.187716,2.187782,2.187849,2.187916,2.187983,2.188051,2.188118,2.188187,2.188255,2.188324,2.188393,2.188463,2.188532,2.188603,2.188673,2.188744,2.188815,2.188887,2.188959,2.189031,2.189104,2.189177,2.18925,2.189324,2.189398,2.189473,2.189548,2.189623,2.189699,2.189775,2.189851,2.189928,2.190005,2.190083,2.190161,2.190239,2.190318,2.190397,2.190477,2.190557,2.190637,2.190718,2.190799,2.190881,2.190963,2.191046,2.191129,2.191212,2.191296,2.19138,2.191465,2.19155,2.191636,2.191722,2.191808,2.191895,2.191983,2.192071,2.192159,2.192248,2.192337,2.192427,2.192517,2.192608,2.192699,2.192791,2.192883,2.192976,2.193069,2.193163,2.193257,2.193352,2.193448,2.193543,2.19364,2.193737,2.193834,2.193932,2.194031,2.19413,2.194229,2.19433,2.19443,2.194532,2.194633,2.194736,2.194839,2.194943,2.195047,2.195152,2.195257,2.195363,2.195469,2.195577,2.195684,2.195793,2.195902,2.196012,2.196122,2.196233,2.196344,2.196457,2.196569,2.196683,2.196797,2.196912,2.197028,2.197144,2.197261,2.197378,2.197497,2.197616,2.197735,2.197856,2.197977,2.198099,2.198221,2.198344,2.198469,2.198593,2.198719,2.198845,2.198972,2.1991,2.199229,2.199358,2.199488,2.199619,2.199751,2.199884,2.200017,2.200151,2.200287,2.200422,2.200559,2.200697,2.200835,2.200975,2.201115,2.201256,2.201398,2.201541,2.201685,2.201829,2.201975,2.202122,2.202269,2.202418,2.202567,2.202717,2.202869,2.203021,2.203174,2.203329,2.203484,2.20364,2.203797,2.203956,2.204115,2.204276,2.204437,2.2046,2.204763,2.204928,2.205094,2.205261,2.205429,2.205598,2.205769,2.20594,2.206113,2.206286,2.206461,2.206638,2.206815,2.206994,2.207173,2.207354,2.207537,2.20772,2.207905,2.208091,2.208279,2.208467,2.208657,2.208849,2.209041,2.209235,2.209431,2.209628,2.209826,2.210026,2.210227,2.210429,2.210633,2.210838,2.211045,2.211254,2.211464,2.211675,2.211888,2.212103,2.212319,2.212536,2.212756,2.212977,2.213199,2.213423,2.213649,2.213877,2.214106,2.214337,2.21457,2.214804,2.21504,2.215278,2.215518,2.21576,2.216003,2.216249,2.216496,2.216745,2.216996,2.217249,2.217504,2.217761,2.21802,2.218281,2.218545,2.21881,2.219077,2.219346,2.219618,2.219892,2.220168,2.220446,2.220726,2.221009,2.221294,2.221581,2.22187,2.222162,2.222457,2.222753,2.223053,2.223354,2.223658,2.223965,2.224274,2.224586,2.224901,2.225218,2.225538,2.22586,2.226185,2.226513,2.226844,2.227178,2.227514,2.227854,2.228196,2.228542,2.22889,2.229241,2.229596,2.229954,2.230314,2.230679,2.231046,2.231416,2.23179,2.232167,2.232548,2.232932,2.23332,2.233711,2.234105,2.234504,2.234905,2.235311,2.235721,2.236134,2.236551,2.236972,2.237397,2.237826,2.238259,2.238696,2.239137,2.239583,2.240032,2.240486,2.240945,2.241408,2.241875,2.242347,2.242824,2.243306,2.243792,2.244283,2.244779,2.245279,2.245785,2.246296,2.246812,2.247334,2.24786,2.248392,2.24893,2.249473,2.250022,2.250576,2.251136,2.251703,2.252275,2.252853,2.253437,2.254028,2.254624,2.255228,2.255837,2.256454,2.257077,2.257707,2.258343,2.258987,2.259638,2.260296,2.260962,2.261635,2.262316,2.26300,2.2637,2.264404,2.265117,2.265837,2.266566,2.267303,2.268049,2.268803,2.269567,2.27034,2.271121,2.271912,2.272713,2.273524,2.274344,2.275174,2.276014,2.276865,2.277726,2.278598,2.279481,2.280376,2.281281,2.282198,2.283126,2.284067,2.28502,2.285985,2.286962,2.287953,2.288957,2.289973,2.291004,2.292048,2.293107,2.294179,2.295267,2.296369,2.297487,2.29862,2.299769,2.300934,2.302116,2.303314,2.30453,2.305763,2.307014,2.308283,2.309571,2.310878,2.312204,2.31355,2.314917,2.316304,2.317712,2.319142,2.320594,2.322069,2.323567,2.325089,2.326634,2.328205,2.329801,2.331423,2.333072,2.334747,2.336451,2.338183,2.339945,2.341736,2.343559,2.345412,2.347299,2.349218,2.351171,2.35316,2.355184,2.357245,2.359344,2.361482,2.36366,2.365879,2.368141,2.370446,2.372795,2.375191,2.377635,2.380127,2.382669,2.385264,2.387912,2.390615,2.393376,2.396196,2.399076,2.402019,2.405028,2.408103,2.411249,2.414467,2.417759,2.421129,2.42458,2.428114,2.431736,2.435447,2.439253,2.443156,2.447161,2.451273,2.455495,2.459834,2.464294,2.468881,2.473602,2.478463,2.48347,2.488633,2.493959,2.499458,2.505139,2.511015,2.517096,2.523397,2.529933,2.536721,2.54378,2.551132,2.558803,2.566822,2.575225,2.584054,2.593365,2.603228,2.613739,2.625049,2.637494,2.651528,2.666473,2.681984,2.697857,2.71394,2.730112,2.746275,2.76235,2.778271,2.793987,2.80943,2.824549,2.839299,2.853641,2.867537,2.880953,2.893861])
+            k_data      = np.flip([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,1E-06,2E-06,2E-06,2E-06,2E-06,2E-06,2E-06,3E-06,3E-06,3E-06,4E-06,4E-06,5E-06,5E-06,6E-06,6E-06,7E-06,8E-06,9E-06,1E-05,1.1E-05,1.2E-05,1.4E-05,1.5E-05,1.7E-05,2E-05,2.2E-05,2.5E-05,2.8E-05,3.2E-05,3.6E-05,4.1E-05,4.6E-05,5.2E-05,5.9E-05,6.8E-05,7.7E-05,8.8E-05,0.000101,0.000115,0.000132,0.000152,0.000174,0.0002,0.000231,0.000266,0.000308,0.000356,0.000412,0.000479,0.000556,0.000648,0.000755,0.000882,0.001031,0.001208,0.001418,0.001667,0.001962,0.002314,0.002734,0.003236,0.003837,0.004557,0.005423,0.006464,0.007718,0.009231,0.011058,0.013272,0.01596,0.019234,0.023231,0.028123,0.034128,0.041517,0.050633,0.061618,0.073647,0.086592,0.100418,0.115089,0.130572,0.146831,0.163834])
+            eps_data    = (n_data+1j*k_data)**2
+        elif material=='PMMA':
+            lambda_data = np.array([])
+            lambda_data = np.array([4006.6833,4022.5149,4038.3464,4054.1780,4070.0095,4085.8413,4101.6729,4117.5044,4133.3364,4149.1680,4165.0000,4180.8315,4196.6631,4212.4951,4228.3267,4244.1587,4259.9902,4275.8218,4291.6538,4307.4854,4323.3169,4339.1484,4354.9805,4370.8120,4386.6436,4402.4746,4418.3062,4434.1377,4449.9688,4465.8003,4481.6313,4497.4624,4513.2939,4529.1245,4544.9556,4560.7866,4576.6172,4592.4482,4608.2788,4624.1094,4639.9395,4655.7700,4671.6001,4687.4302,4703.2603,4719.0903,4734.9199,4750.7500,4766.5796,4782.4087,4798.2383,4814.0674,4829.8965,4845.7256,4861.5542,4877.3828,4893.2114,4909.0396,4924.8677,4940.6958,4956.5234,4972.3516,988.1787,5004.0063,5019.8335,5035.6602,5051.4873,5067.3140,5083.1401,5098.9663,5114.7925,5130.6187,5146.4438,5162.2695,5178.0947,5193.9199,5209.7446,5225.5693,5241.3936,5257.2178,5273.0415,5288.8652,5304.6885,5320.5117,5336.3350,5352.1572,5367.9800,5383.8022,5399.6240,5415.4458,5431.2671,5447.0884,5462.9092,5478.7295,5494.5498,5510.3701,5526.1899,5542.0093,5557.8286,5573.6475,5589.4658,5605.2842,5621.1021,5636.9199,5652.7368,5668.5542,5684.3706,5700.1870,5716.0034,5731.8188,5747.6343,5763.4492,5779.2642,5795.0786,5810.8926,5826.7061,5842.5195,5858.3325,5874.1450,5889.9570,5905.7690,5921.5806,5937.3916,5953.2021,5969.0127,5984.8228,6000.6323,6016.4414,6032.2505,6048.0586,6063.8667,6079.6743,6095.4814,6111.2881,6127.0947,6142.9004,6158.7061,6174.5112,6190.3159,6206.1201,6221.9238,6237.7271,6253.5298,6269.3325,6285.1343,6300.9360,6316.7368,6332.5376,6348.3379,6364.1377,6379.9365,6395.7354,6411.5337,6427.3315,6443.1289,6458.9258,6474.7222,6490.5181,6506.3130,6522.1079,6537.9023,6553.6963,6569.4893,6585.2822,6601.0747,6616.8662,6632.6577,6648.4482,6664.2383,6680.0278,6695.8169,6711.6055,6727.3936,6743.1812,6758.9678,6774.7544,6790.5400,6806.3252,6822.1099,6837.8940,6853.6772,6869.4604,6885.2427,6901.0244,6916.8057,6932.5864,6948.3662,6964.1455,6979.9243,6995.7026,7011.4800,7027.2568,7043.0332,7058.8091,7074.5840,7090.3589,7106.1323,7121.9058,7137.6782,7153.4502,7169.2217,7184.9922,7200.7622,7216.5317,7232.3003,7248.0684,7263.8354,7279.6025,7295.3682,7311.1338,7326.8984,7342.6626,7358.4258,7374.1885,7389.9502,7405.7114,7421.4722,7437.2319,7452.9912,7468.7495,7484.5073,7500.2642,7516.0205,7531.7759,7547.5308,7563.2852,7579.0381,7594.7910,7610.5430,7626.2939,7642.0444,7657.7939,7673.5430,7689.2910,7705.0386,7720.7852,7736.5313,7752.2764,7768.0205,7783.7642,7799.5068,7815.2485,7830.9897,7846.7305,7862.4702,7878.2090,7893.9468,7909.6841,7925.4204,7941.1563,7956.8906,7972.6245,7988.3579,8004.0903,8019.8218,8035.5522,8051.2822,8067.0112,8082.7393,8098.4668,8114.1929,8129.9185,8145.6436,8161.3672,8177.0903,8192.8125,8208.5332,8224.2539,8239.9736,8255.6924,8271.4102,8287.1270,8302.8428,8318.5576,8334.2725,8349.9854,8365.6982,8381.4092,8397.1201,8412.8291,8428.5381,8444.2461,8459.9531,8475.6592,8491.3643,8507.0684,8522.7715,8538.4736,8554.1748,8569.8750,8585.5742,8601.2725,8616.9707,8632.6670,8648.3623,8664.0566,8679.7510,8695.4434,8711.1348,8726.8252,8742.5156,8758.2041,8773.8916,8789.5781,8805.2637,8820.9482,8836.6318,8852.3145,8867.9961,8883.6768,8899.3564,8915.0352,8930.7129,8946.3896,8962.0654,8977.7393,8993.4131])*1e-10
+            eps_data    = np.array([2.2965225,2.2956270,2.2947433,2.2938712,2.2930104,2.2921607,2.2913219,2.2904940,2.2896765,2.2888695,2.2880726,2.2872858,2.2865089,2.2857416,2.2849839,2.2842355,2.2834964,2.2827663,2.2820452,2.2813328,2.2806290,2.2799338,2.2792468,2.2785681,2.2778975,2.2772348,2.2765799,2.2759328,2.2752932,2.2746611,2.2740363,2.2734187,2.2728083,2.2722048,2.2716083,2.2710185,2.2704354,2.2698589,2.2692889,2.2687253,2.2681680,2.2676168,2.2670718,2.2665328,2.2659997,2.2654724,2.2649509,2.2644350,2.2639248,2.2634200,2.2629206,2.2624266,2.2619379,2.2614543,2.2609759,2.2605025,2.2600341,2.2595706,2.2591119,2.2586579,2.2582087,2.2577641,2.2573241,2.2568886,2.2564575,2.2560308,2.2556084,2.2551903,2.2547764,2.2543667,2.2539610,2.2535594,2.2531618,2.2527681,2.2523782,2.2519922,2.2516100,2.2512315,2.2508567,2.2504855,2.2501179,2.2497539,2.2493933,2.2490362,2.2486824,2.2483321,2.2479850,2.2476413,2.2473007,2.2469634,2.2466292,2.2462981,2.2459701,2.2456451,2.2453231,2.2450041,2.2446879,2.2443747,2.2440644,2.2437568,2.2434521,2.2431500,2.2428507,2.2425541,2.2422601,2.2419688,2.2416800,2.2413938,2.2411101,2.2408290,2.2405502,2.2402740,2.2400001,2.2397286,2.2394595,2.2391926,2.2389281,2.2386659,2.2384059,2.2381481,2.2378925,2.2376391,2.2373879,2.2371387,2.2368917,2.2366467,2.2364038,2.2361629,2.2359240,2.2356871,2.2354521,2.2352191,2.2349880,2.2347588,2.2345314,2.2343060,2.2340823,2.2338605,2.2336404,2.2334222,2.2332057,2.2329909,2.2327779,2.2325665,2.2323568,2.2321488,2.2319425,2.2317377,2.2315346,2.2313331,2.2311331,2.2309347,2.2307379,2.2305425,2.2303487,2.2301564,2.2299656,2.2297762,2.2295883,2.2294018,2.2292168,2.2290331,2.2288508,2.2286700,2.2284904,2.2283123,2.2281354,2.2279599,2.2277857,2.2276128,2.2274412,2.2272709,2.2271018,2.2269339,2.2267673,2.2266019,2.2264378,2.2262748,2.2261130,2.2259524,2.2257929,2.2256346,2.2254774,2.2253214,2.2251665,2.2250127,2.2248600,2.2247084,2.2245578,2.2244083,2.2242599,2.2241125,2.2239662,2.2238209,2.2236766,2.2235333,2.2233910,2.2232497,2.2231094,2.2229700,2.2228316,2.2226942,2.2225577,2.2224222,2.2222875,2.2221538,2.2220210,2.2218891,2.2217581,2.2216280,2.2214987,2.2213704,2.2212428,2.2211162,2.2209904,2.2208654,2.2207412,2.2206179,2.2204954,2.2203737,2.2202528,2.2201327,2.2200134,2.2198949,2.2197771,2.2196601,2.2195439,2.2194284,2.2193137,2.2191997,2.2190865,2.2189739,2.2188621,2.2187510,2.2186407,2.2185310,2.2184220,2.2183137,2.2182061,2.2180992,2.2179930,2.2178874,2.2177825,2.2176782,2.2175746,2.2174717,2.2173694,2.2172677,2.2171666,2.2170662,2.2169664,2.2168672,2.2167687,2.2166707,2.2165733,2.2164765,2.2163803,2.2162847,2.2161897,2.2160953,2.2160014,2.2159081,2.2158153,2.2157232,2.2156315,2.2155404,2.2154499,2.2153599,2.2152704,2.2151815,2.2150931,2.2150052,2.2149178,2.2148310,2.2147446,2.2146588,2.2145735,2.2144886,2.2144043,2.2143204,2.2142371,2.2141542,2.2140718,2.2139899,2.2139084,2.2138275,2.2137469,2.2136669,2.2135873,2.2135081,2.2134295,2.2133512,2.2132734,2.2131961,2.2131191,2.2130426,2.2129666,2.2128910,2.2128158,2.2127410,2.2126666,2.2125927,2.2125191,2.2124460,2.2123733,2.2123009,2.2122290,2.2121575,2.2120864,2.2120156,2.2119453,2.2118753,2.2118057,2.2117365,2.2116677,2.2115992,2.2115312])
+        elif material=='silver_IEF':
+            lambda_data = np.array([])
+            lambda_data = np.array([4006.6833,4022.5149,4038.3464,4054.1780,4070.0095,4085.8413,4101.6729,4117.5044,4133.3364,4149.1680,4165.0000,4180.8315,4196.6631,4212.4951,4228.3267,4244.1587,4259.9902,4275.8218,4291.6538,4307.4854,4323.3169,4339.1484,4354.9805,4370.8120,4386.6436,4402.4746,4418.3062,4434.1377,4449.9688,4465.8003,4481.6313,4497.4624,4513.2939,4529.1245,4544.9556,4560.7866,4576.6172,4592.4482,4608.2788,4624.1094,4639.9395,4655.7700,4671.6001,4687.4302,4703.2603,4719.0903,4734.9199,4750.7500,4766.5796,4782.4087,4798.2383,4814.0674,4829.8965,4845.7256,4861.5542,4877.3828,4893.2114,4909.0396,4924.8677,4940.6958,4956.5234,4972.3516,988.1787,5004.0063,5019.8335,5035.6602,5051.4873,5067.3140,5083.1401,5098.9663,5114.7925,5130.6187,5146.4438,5162.2695,5178.0947,5193.9199,5209.7446,5225.5693,5241.3936,5257.2178,5273.0415,5288.8652,5304.6885,5320.5117,5336.3350,5352.1572,5367.9800,5383.8022,5399.6240,5415.4458,5431.2671,5447.0884,5462.9092,5478.7295,5494.5498,5510.3701,5526.1899,5542.0093,5557.8286,5573.6475,5589.4658,5605.2842,5621.1021,5636.9199,5652.7368,5668.5542,5684.3706,5700.1870,5716.0034,5731.8188,5747.6343,5763.4492,5779.2642,5795.0786,5810.8926,5826.7061,5842.5195,5858.3325,5874.1450,5889.9570,5905.7690,5921.5806,5937.3916,5953.2021,5969.0127,5984.8228,6000.6323,6016.4414,6032.2505,6048.0586,6063.8667,6079.6743,6095.4814,6111.2881,6127.0947,6142.9004,6158.7061,6174.5112,6190.3159,6206.1201,6221.9238,6237.7271,6253.5298,6269.3325,6285.1343,6300.9360,6316.7368,6332.5376,6348.3379,6364.1377,6379.9365,6395.7354,6411.5337,6427.3315,6443.1289,6458.9258,6474.7222,6490.5181,6506.3130,6522.1079,6537.9023,6553.6963,6569.4893,6585.2822,6601.0747,6616.8662,6632.6577,6648.4482,6664.2383,6680.0278,6695.8169,6711.6055,6727.3936,6743.1812,6758.9678,6774.7544,6790.5400,6806.3252,6822.1099,6837.8940,6853.6772,6869.4604,6885.2427,6901.0244,6916.8057,6932.5864,6948.3662,6964.1455,6979.9243,6995.7026,7011.4800,7027.2568,7043.0332,7058.8091,7074.5840,7090.3589,7106.1323,7121.9058,7137.6782,7153.4502,7169.2217,7184.9922,7200.7622,7216.5317,7232.3003,7248.0684,7263.8354,7279.6025,7295.3682,7311.1338,7326.8984,7342.6626,7358.4258,7374.1885,7389.9502,7405.7114,7421.4722,7437.2319,7452.9912,7468.7495,7484.5073,7500.2642,7516.0205,7531.7759,7547.5308,7563.2852,7579.0381,7594.7910,7610.5430,7626.2939,7642.0444,7657.7939,7673.5430,7689.2910,7705.0386,7720.7852,7736.5313,7752.2764,7768.0205,7783.7642,7799.5068,7815.2485,7830.9897,7846.7305,7862.4702,7878.2090,7893.9468,7909.6841,7925.4204,7941.1563,7956.8906,7972.6245,7988.3579,8004.0903,8019.8218,8035.5522,8051.2822,8067.0112,8082.7393,8098.4668,8114.1929,8129.9185,8145.6436,8161.3672,8177.0903,8192.8125,8208.5332,8224.2539,8239.9736,8255.6924,8271.4102,8287.1270,8302.8428,8318.5576,8334.2725,8349.9854,8365.6982,8381.4092,8397.1201,8412.8291,8428.5381,8444.2461,8459.9531,8475.6592,8491.3643,8507.0684,8522.7715,8538.4736,8554.1748,8569.8750,8585.5742,8601.2725,8616.9707,8632.6670,8648.3623,8664.0566,8679.7510,8695.4434,8711.1348,8726.8252,8742.5156,8758.2041,8773.8916,8789.5781,8805.2637,8820.9482,8836.6318,8852.3145,8867.9961,8883.6768,8899.3564,8915.0352,8930.7129,8946.3896,8962.0654,8977.7393,8993.4131])*1e-10
+            eps_re      = np.array([-3.8046900,-3.8975202,-3.9843382,-4.0648655,-4.1398248,-4.2113191,-4.2820778,-4.3535594,-4.4266576,-4.5020044,-4.5801120,-4.6610571,-4.7444947,-4.8296270,-4.9147307,-4.9981657,-5.0793581,-5.1583328,-5.2357113,-5.3129098,-5.3908711,-5.4699467,-5.5501936,-5.6313305,-5.7127659,-5.7941620,-5.8753711,-5.9563321,-6.0370602,-6.1176452,-6.1981594,-6.2786765,-6.3592998,-6.4401756,-6.5215528,-6.6035610,-6.6861924,-6.7693671,-6.8528912,-6.9363701,-7.0194400,-7.1019819,-7.1839926,-7.2655804,-7.3470046,-7.4287217,-7.5109881,-7.5939186,-7.6775240,-7.7617479,-7.8464148,-7.9312614,-8.0161466,-8.1009964,-8.1857763,-8.2704773,-8.3551343,-8.4398036,-8.5245204,-8.6093126,-8.6942011,-8.7792181,-8.8643956,-8.9498044,-9.0354654,-9.1213695,-9.2074880,-9.2937553,-9.3800735,-9.4662580,-9.5521208,-9.6375905,-9.7226589,-9.8073819,-9.8918537,-9.9762471,-10.060880,-10.146027,-10.231803,-10.318251,-10.405361,-10.493066,-10.581233,-10.669606,-10.757939,-10.846099,-10.934008,-11.021618,-11.108909,-11.195880,-11.282565,-11.369023,-11.455295,-11.541407,-11.627387,-11.713261,-11.799047,-11.884777,-11.970477,-12.056178,-12.141904,-12.227678,-12.313511,-12.399423,-12.485413,-12.571486,-12.657605,-12.743739,-12.829896,-12.916128,-13.002512,-13.089146,-13.176159,-13.263721,-13.352068,-13.441571,-13.532494,-13.624970,-13.719079,-13.814851,-13.912282,-14.011319,-14.111884,-14.213829,-14.316933,-14.421020,-14.525978,-14.631702,-14.738100,-14.845086,-14.952572,-15.060481,-15.168712,-15.277148,-15.385686,-15.494250,-15.602791,-15.711257,-15.819627,-15.927870,-16.035970,-16.143917,-16.251714,-16.359369,-16.466888,-16.574284,-16.681556,-16.788722,-16.895784,-17.002763,-17.109664,-17.216519,-17.323344,-17.430185,-17.537077,-17.644040,-17.751098,-17.858256,-17.965522,-18.072913,-18.180423,-18.288054,-18.395802,-18.503660,-18.611608,-18.719624,-18.827710,-18.935860,-19.044090,-19.152402,-19.260818,-19.369352,-19.478027,-19.586868,-19.695914,-19.805220,-19.914851,-20.024855,-20.135253,-20.246059,-20.357277,-20.468911,-20.580942,-20.693368,-20.806162,-20.919300,-21.032735,-21.146409,-21.260238,-21.374164,-21.488149,-21.602178,-21.716239,-21.830328,-21.944441,-22.058596,-22.172799,-22.287079,-22.401457,-22.515980,-22.630709,-22.745717,-22.861063,-22.976773,-23.092871,-23.209370,-23.326276,-23.443602,-23.561329,-23.679465,-23.797991,-23.916895,-24.036146,-24.155713,-24.275539,-24.395567,-24.515774,-24.636131,-24.756635,-24.877274,-24.998051,-25.118967,-25.240037,-25.361269,-25.482678,-25.604297,-25.726143,-25.848266,-25.970718,-26.093587,-26.216924,-26.340758,-26.465110,-26.589989,-26.715395,-26.841318,-26.967759,-27.094688,-27.222090,-27.349943,-27.478198,-27.606819,-27.735754,-27.864931,-27.994238,-28.123568,-28.252874,-28.382116,-28.511252,-28.640277,-28.769160,-28.897905,-29.026509,-29.154978,-29.283318,-29.411547,-29.539682,-29.667757,-29.795797,-29.923850,-30.051980,-30.180265,-30.308767,-30.437511,-30.566545,-30.695888,-30.825567,-30.955606,-31.086027,-31.216846,-31.348071,-31.479727,-31.611832,-31.744393,-31.877442,-32.010978,-32.145042,-32.279650,-32.414859,-32.550694,-32.687199,-32.824358,-32.962177,-33.100635,-33.239726,-33.379418,-33.519692,-33.660505,-33.801828,-33.943607,-34.085802,-34.228346,-34.371191,-34.514235,-34.657415,-34.800622,-34.943735,-35.086556,-35.228931,-35.370761,-35.511983,-35.652521,-35.792335,-35.931394,-36.069677,-36.207158,-36.343832,-36.479700,-36.614764,-36.749033,-36.882526,-37.015264,-37.147280,-37.278603,-37.409287,-37.539378,-37.668949])
+            eps_im      = np.array([0.65288872,0.65382028,0.65811689,0.66314293,0.66638334,0.66571695,0.66112444,0.65346667,0.64357011,0.63223437,0.62043747,0.60934487,0.60008144,0.59372030,0.59091299,0.59071337,0.59180606,0.59293261,0.59290135,0.59125370,0.58858077,0.58553482,0.58273987,0.58077382,0.57979986,0.57961881,0.58002639,0.58082671,0.58183491,0.58292811,0.58403559,0.58509117,0.58603154,0.58679883,0.58746108,0.58824847,0.58939313,0.59111775,0.59363552,0.59705472,0.60112718,0.60553453,0.60997064,0.61414180,0.61777474,0.62084432,0.62358438,0.62623340,0.62901997,0.63216402,0.63586038,0.64011864,0.64483909,0.64992408,0.65527972,0.66081537,0.66644805,0.67214073,0.67788514,0.68367396,0.68949976,0.69535591,0.70123616,0.70717104,0.71323279,0.71949396,0.72602472,0.73289179,0.74015967,0.74785897,0.75585239,0.76395180,0.77197560,0.77975008,0.78710666,0.79388360,0.80000988,0.80565882,0.81103986,0.81635503,0.82179956,0.82756134,0.83382145,0.84070099,0.84812132,0.85596168,0.86410565,0.87244054,0.88085777,0.88925225,0.89752532,0.90561891,0.91350293,0.92114838,0.92852814,0.93561555,0.94238469,0.94881139,0.95487320,0.96055742,0.96585443,0.97075528,0.97525104,0.97933372,0.98299508,0.98622787,0.98901557,0.99127685,0.99290424,0.99379414,0.99384649,0.99296466,0.99105545,0.98802893,0.98380076,0.97841770,0.97212207,0.96516621,0.95779380,0.95024106,0.94273640,0.93550186,0.92875118,0.92268921,0.91742962,0.91298736,0.90937066,0.90658789,0.90464676,0.90355451,0.90331798,0.90394355,0.90543717,0.90778666,0.91093025,0.91479909,0.91932659,0.92444742,0.93009902,0.93621975,0.94275011,0.94963230,0.95681030,0.96423600,0.97187251,0.97968567,0.98764118,0.99570724,1.0038515,1.0120435,1.0202528,1.0284513,1.0366100,1.0447079,1.0527467,1.0607341,1.0686782,1.0765860,1.0844646,1.0923219,1.1001640,1.1079976,1.1158291,1.1236649,1.1315041,1.1393252,1.1471048,1.1548191,1.1624463,1.1699638,1.1773508,1.1845866,1.1916509,1.1985244,1.2051884,1.2116272,1.2178616,1.2239375,1.2298995,1.2357915,1.2416556,1.2475334,1.2534646,1.2594886,1.2656433,1.2719655,1.2784909,1.2852527,1.2922446,1.2994218,1.3067384,1.3141506,1.3216155,1.3290912,1.3365363,1.3439121,1.3511791,1.3583005,1.3652390,1.3719597,1.3784312,1.3846636,1.3906952,1.3965631,1.4023037,1.4079524,1.4135435,1.4191114,1.4246878,1.4303054,1.4359950,1.4417871,1.4477107,1.4537948,1.4600568,1.4664738,1.4730153,1.4796501,1.4863490,1.4930828,1.4998234,1.5065433,1.5132158,1.5198148,1.5263145,1.5326906,1.5389184,1.5449749,1.5508388,1.5565290,1.5620986,1.5676005,1.5730865,1.5786072,1.5842115,1.5899473,1.5958619,1.6020002,1.6084071,1.6151261,1.6221989,1.6296668,1.6375701,1.6459479,1.6548151,1.6641224,1.6738126,1.6838289,1.6941148,1.7046174,1.7152823,1.7260586,1.7368957,1.7477442,1.7585559,1.7692838,1.7798817,1.7903054,1.8005105,1.8104545,1.8200990,1.8294423,1.8385053,1.8473074,1.8558695,1.8642105,1.8723498,1.8803060,1.8880978,1.8957426,1.9032576,1.9106603,1.9179675,1.9251952,1.9323600,1.9394766,1.9465613,1.9536283,1.9607042,1.9678492,1.9751305,1.9826115,1.9903555,1.9984235,2.0068762,2.0157716,2.0251676,2.0351197,2.0456830,2.0569103,2.0688544,2.0815655,2.0950947,2.1094876,2.1247938,2.1410584,2.1583273,2.1765965,2.1957735,2.2157584,2.2364544,2.2577629,2.2795902,2.3018444,2.3244359,2.3472748,2.3702751,2.3933526,2.4164242,2.4394080,2.4622254,2.4847983,2.5070512,2.5289082,2.5502984,2.5711492,2.5913915])
+            eps_data    = (eps_re+1j*eps_im)
+        elif material=='silver_widerange':
+            lambda_data = np.array([])
+            lambda_data = np.array([0.270000,0.280000,0.290000,0.300000,0.310000,0.320000,0.330000,0.340000,0.350000,0.360000,0.369900,0.379900,0.389900,0.399900,0.409900,0.419900,0.429900,0.439900,0.449900,0.459900,0.469900,0.479900,0.489900,0.499900,0.509900,0.519900,0.529900,0.539900,0.549900,0.559900,0.569900,0.579900,0.589900,0.599900,0.609900,0.619900,0.629900,0.639900,0.649900,0.659900,0.669900,0.679900,0.689900,0.699900,0.709900,0.719900,0.729900,0.739900,0.749900,0.759900,0.769900,0.779900,0.789900,0.799900,0.809900,0.819900,0.829900,0.839900,0.849900,0.859900,0.869900,0.879900,0.889900,0.899900,0.909900,0.919900,0.929900,0.939900,0.949900,0.959900,0.969800,0.979900,0.989900,0.999900,1.010000,1.020000,1.030000,1.040000,1.050000,1.060000,1.070000,1.080000,1.090000,1.100000,1.110000,1.120000,1.130000,1.140000,1.150000,1.160000,1.170000,1.180000,1.190000,1.200000,1.210000,1.220000,1.230000,1.240000,1.250000,1.260000,1.268000,1.270000,1.278000,1.280000,1.288000,1.290000,1.299000,1.300000,1.309000,1.310000,1.320000,1.320000,1.328000,1.330000,1.339000,1.340000,1.347000,1.350000,1.359000,1.367000,1.379000,1.388000,1.400000,1.409000,1.418000,1.427000,1.430000,1.437000,1.440000,1.450000,1.450000,1.460000,1.460000,1.469000,1.470000,1.480000,1.480000,1.490000,1.490000,1.497000,1.500000,1.507000,1.510000,1.518000,1.520000,1.528000,1.530000,1.539000,1.540000,1.547000,1.550000,1.558000,1.560000,1.569000,1.570000,1.577000,1.580000,1.588000,1.590000,1.596000,1.600000,1.608000,1.610000,1.616000,1.620000,1.628000,1.630000,1.636000,1.640000,1.649000,1.650000,1.657000,1.660000,1.666000,1.670000,1.679000,1.680000,1.688000,1.690000,1.696000,1.700000,1.705000,1.710000,1.719000,1.720000,1.728000,1.730000,1.737000,1.740000,1.747000,1.750000,1.756000,1.760000,1.766000,1.770000,1.775000,1.780000,1.785000,1.790000,1.795000,1.800000,1.805000,1.810000,1.815000,1.820000,1.825000,1.830000,1.836000,1.840000,1.846000,1.850000,1.857000,1.860000,1.868000,1.870000,1.878000,1.880000,1.889000,1.890000,1.895000,1.900000,1.906000,1.910000,1.917000,1.920000,1.929000,1.930000,1.934000,1.940000,1.946000,1.950000,1.958000,1.960000,1.970000,1.970000,1.976000,1.980000,1.988000,1.990000,1.994000,2.000000,2.006000,2.019000,2.025000,2.038000,2.044000,2.057000,2.064000,2.077000,2.084000,2.097000,2.104000,2.118000,2.125000,2.139000,2.146000,2.153000,2.167000,2.175000,2.189000,2.197000,2.204000,2.219000,2.227000,2.235000,2.242000,2.258000,2.266000,2.274000,2.282000,2.298000,2.306000,2.314000,2.323000,2.339000,2.348000,2.356000,2.365000,2.374000,2.382000,2.391000,2.409000,2.418000,2.427000,2.436000,2.445000,2.455000,2.464000,2.473000,2.483000,2.492000,2.502000,2.512000,2.522000,2.531000,2.541000,2.551000,2.561000,2.572000,2.582000,2.592000,2.603000,2.613000,2.624000,2.634000,2.645000,2.656000,2.667000,2.678000,2.689000,2.700000,2.711000,2.723000,2.734000,2.746000,2.758000,2.769000,2.781000,2.793000,2.805000,2.817000,2.830000,2.842000,2.855000,2.867000,2.880000,2.893000,2.906000,2.919000,2.932000,2.946000,2.959000,2.973000,2.986000,3.000000,3.014000,3.028000,3.042000,3.057000,3.071000,3.086000,3.101000,3.116000,3.131000,3.146000,3.161000,3.177000,3.192000,3.208000,3.224000,3.240000,3.256000,3.273000,3.289000,3.306000,3.323000,3.340000,3.358000,3.375000,3.393000,3.411000,3.429000,3.447000,3.465000,3.484000,3.503000,3.522000,3.541000,3.561000,3.580000,3.600000,3.620000,3.641000,3.661000,3.682000,3.703000,3.724000,3.746000,3.768000,3.790000,3.812000,3.834000,3.857000,3.880000,3.904000,3.927000,3.951000,3.976000,4.000000,4.025000,4.050000,4.076000,4.101000,4.128000,4.154000,4.181000,4.208000,4.235000,4.263000,4.292000,4.320000,4.349000,4.379000,4.408000,4.439000,4.469000,4.500000,4.532000,4.564000,4.596000,4.629000,4.662000,4.696000,4.730000,4.765000,4.800000,4.836000,4.872000,4.909000,4.947000,4.985000,5.023000,5.063000,5.103000,5.143000,5.184000,5.226000,5.269000,5.312000,5.356000,5.400000,5.446000,5.492000,5.539000,5.586000,5.635000,5.684000,5.735000,5.786000,5.838000,5.891000,5.945000,6.000000,6.056000,6.114000,6.172000,6.231000,6.292000,6.353000,6.416000,6.480000,6.546000,6.612000,6.681000,6.750000,6.821000,6.894000,6.968000,7.044000,7.121000,7.200000,7.281000,7.364000,7.449000,7.535000,7.624000,7.715000,7.808000,7.903000,8.001000,8.100000,8.203000,8.308000,8.416000,8.527000,8.641000,8.757000,8.877000,9.001000,9.127000,9.257000,9.392000,9.530000,9.672000,9.819000,9.970000,10.130000,10.290000,10.450000,10.620000,10.800000,10.980000,11.170000,11.370000,11.570000,11.780000,12.000000,12.230000,12.460000,12.710000,12.960000,13.230000,13.500000,13.790000,14.090000,14.400000,14.730000,15.070000,15.430000,15.810000,16.200000,16.620000,17.050000,17.510000,18.000000,18.520000,19.060000,19.640000,20.250000,20.900000,21.600000,22.350000,23.140000,24.000000,24.920000])*1e-6
+            n_data      = np.array([1.364000,1.477000,1.531000,1.609000,1.373000,0.819100,0.220700,0.110900,0.084430,0.073390,0.067270,0.063250,0.060350,0.058170,0.056470,0.055150,0.054110,0.053320,0.052710,0.052270,0.051980,0.051810,0.051750,0.051800,0.051930,0.052150,0.052450,0.052820,0.053260,0.053760,0.054310,0.054930,0.055600,0.056320,0.057090,0.057900,0.058760,0.059660,0.060610,0.061590,0.062620,0.063680,0.064780,0.065910,0.067080,0.068290,0.069530,0.070800,0.072100,0.073440,0.074800,0.076200,0.077620,0.079080,0.080570,0.082080,0.083620,0.085190,0.086790,0.088410,0.090070,0.091740,0.093450,0.095180,0.096940,0.098720,0.100500,0.102400,0.104200,0.106100,0.108000,0.110000,0.111900,0.113900,0.115900,0.117900,0.120000,0.122100,0.124200,0.126300,0.128500,0.130600,0.132800,0.135100,0.137300,0.139600,0.141900,0.144200,0.146500,0.148900,0.151300,0.153700,0.156100,0.158500,0.161000,0.163500,0.166000,0.168600,0.171100,0.173700,0.175900,0.176300,0.178500,0.179000,0.181200,0.181600,0.184000,0.184300,0.186800,0.187000,0.189700,0.189700,0.191900,0.192400,0.194900,0.195200,0.197300,0.198000,0.200400,0.202900,0.206200,0.208700,0.212200,0.214800,0.217600,0.220300,0.221000,0.223100,0.224000,0.227000,0.227000,0.230000,0.230100,0.233000,0.233100,0.236100,0.236200,0.239200,0.239300,0.241400,0.242400,0.244600,0.245500,0.248000,0.248700,0.251400,0.251800,0.254900,0.255000,0.257200,0.258200,0.260800,0.261500,0.264500,0.264700,0.267000,0.268000,0.270800,0.271300,0.273400,0.274700,0.277400,0.278000,0.280100,0.281400,0.284200,0.284800,0.287000,0.288200,0.291300,0.291600,0.294200,0.295100,0.297200,0.298500,0.301700,0.302000,0.304800,0.305600,0.307900,0.309100,0.311100,0.312700,0.315900,0.316200,0.319200,0.319800,0.322600,0.323500,0.326000,0.327100,0.329500,0.330800,0.333000,0.334500,0.336600,0.338200,0.340200,0.341900,0.343900,0.345700,0.347700,0.349400,0.351500,0.353200,0.355400,0.357000,0.359300,0.360900,0.363400,0.364700,0.367500,0.368600,0.371600,0.372500,0.375900,0.376400,0.380200,0.380400,0.382400,0.384300,0.386800,0.388300,0.391300,0.392300,0.395900,0.396400,0.398200,0.400400,0.403000,0.404500,0.407800,0.408600,0.412700,0.412700,0.415100,0.416800,0.420200,0.421000,0.422700,0.425100,0.427900,0.433100,0.435800,0.441200,0.444000,0.449500,0.452400,0.458100,0.461000,0.466900,0.469900,0.476000,0.479100,0.485300,0.488500,0.491700,0.498200,0.501500,0.508200,0.511600,0.515100,0.522100,0.525600,0.529200,0.532800,0.540200,0.543900,0.547700,0.551500,0.559300,0.563200,0.567200,0.571200,0.579400,0.583500,0.587700,0.592000,0.596300,0.600600,0.605000,0.613900,0.618500,0.623100,0.627700,0.632400,0.637200,0.642000,0.646800,0.651700,0.656700,0.661700,0.666800,0.672000,0.677200,0.682400,0.687800,0.693100,0.698600,0.704100,0.709700,0.715400,0.721100,0.726900,0.732700,0.738700,0.744700,0.750800,0.756900,0.763100,0.769500,0.775800,0.782300,0.788900,0.795500,0.802200,0.809000,0.815900,0.822900,0.830000,0.837100,0.844400,0.851700,0.859200,0.866700,0.874400,0.882100,0.890000,0.897900,0.906000,0.914200,0.922500,0.930900,0.939400,0.948000,0.956800,0.965700,0.974700,0.983800,0.993100,1.003000,1.012000,1.022000,1.031000,1.041000,1.052000,1.062000,1.072000,1.083000,1.093000,1.104000,1.115000,1.126000,1.138000,1.149000,1.161000,1.173000,1.185000,1.197000,1.210000,1.222000,1.235000,1.248000,1.262000,1.275000,1.289000,1.303000,1.317000,1.331000,1.346000,1.361000,1.376000,1.391000,1.407000,1.422000,1.439000,1.455000,1.472000,1.489000,1.506000,1.524000,1.541000,1.560000,1.578000,1.597000,1.616000,1.636000,1.656000,1.676000,1.697000,1.718000,1.739000,1.761000,1.783000,1.806000,1.829000,1.853000,1.877000,1.901000,1.926000,1.951000,1.977000,2.004000,2.031000,2.059000,2.087000,2.115000,2.145000,2.175000,2.205000,2.236000,2.268000,2.301000,2.334000,2.368000,2.403000,2.438000,2.474000,2.512000,2.550000,2.588000,2.628000,2.669000,2.710000,2.753000,2.796000,2.841000,2.886000,2.933000,2.981000,3.030000,3.080000,3.132000,3.185000,3.239000,3.294000,3.351000,3.410000,3.470000,3.532000,3.595000,3.660000,3.726000,3.795000,3.865000,3.938000,4.012000,4.089000,4.168000,4.249000,4.332000,4.418000,4.507000,4.598000,4.692000,4.788000,4.888000,4.991000,5.097000,5.207000,5.320000,5.437000,5.557000,5.682000,5.811000,5.944000,6.082000,6.225000,6.373000,6.526000,6.684000,6.848000,7.019000,7.195000,7.379000,7.569000,7.767000,7.972000,8.186000,8.408000,8.639000,8.880000,9.131000,9.393000,9.665000,9.950000,10.250000,10.560000,10.880000,11.220000,11.580000,11.950000,12.340000,12.750000,13.180000,13.630000,14.100000,14.600000,15.120000,15.670000,16.250000,16.870000,17.520000,18.200000,18.930000,19.700000,20.510000,21.370000,22.290000,23.270000,24.310000,25.410000,26.590000,27.850000,29.200000,30.650000,32.200000,33.860000,35.650000,37.570000,39.650000,41.890000,44.310000,46.940000,49.790000])
+            k_data      = np.array([1.318000,1.240000,1.168000,0.912600,0.519200,0.333400,0.677900,1.084000,1.341000,1.536000,1.699000,1.841000,1.971000,2.090000,2.203000,2.310000,2.413000,2.513000,2.609000,2.703000,2.795000,2.886000,2.974000,3.062000,3.148000,3.233000,3.318000,3.401000,3.484000,3.566000,3.648000,3.728000,3.809000,3.889000,3.968000,4.048000,4.126000,4.205000,4.283000,4.361000,4.438000,4.516000,4.593000,4.669000,4.746000,4.823000,4.899000,4.975000,5.051000,5.126000,5.202000,5.278000,5.353000,5.428000,5.503000,5.578000,5.653000,5.728000,5.802000,5.877000,5.951000,6.026000,6.100000,6.174000,6.248000,6.322000,6.396000,6.470000,6.544000,6.618000,6.691000,6.765000,6.838000,6.912000,6.985000,7.059000,7.132000,7.206000,7.279000,7.352000,7.425000,7.498000,7.571000,7.645000,7.718000,7.791000,7.863000,7.936000,8.009000,8.082000,8.155000,8.228000,8.300000,8.373000,8.446000,8.518000,8.591000,8.664000,8.736000,8.809000,8.869000,8.881000,8.942000,8.954000,9.015000,9.026000,9.090000,9.099000,9.166000,9.171000,9.243000,9.243000,9.302000,9.316000,9.381000,9.388000,9.442000,9.460000,9.524000,9.586000,9.670000,9.734000,9.820000,9.886000,9.953000,10.020000,10.040000,10.090000,10.110000,10.180000,10.180000,10.250000,10.260000,10.320000,10.330000,10.400000,10.400000,10.470000,10.470000,10.520000,10.540000,10.600000,10.620000,10.670000,10.690000,10.750000,10.760000,10.830000,10.830000,10.880000,10.900000,10.960000,10.980000,11.040000,11.050000,11.100000,11.120000,11.180000,11.190000,11.240000,11.260000,11.320000,11.340000,11.380000,11.410000,11.470000,11.480000,11.530000,11.550000,11.620000,11.620000,11.680000,11.690000,11.740000,11.770000,11.830000,11.840000,11.890000,11.910000,11.960000,11.980000,12.020000,12.050000,12.120000,12.130000,12.180000,12.200000,12.250000,12.270000,12.320000,12.340000,12.390000,12.410000,12.460000,12.480000,12.520000,12.560000,12.590000,12.630000,12.670000,12.700000,12.740000,12.770000,12.810000,12.840000,12.880000,12.910000,12.960000,12.990000,13.030000,13.060000,13.110000,13.130000,13.180000,13.200000,13.260000,13.270000,13.340000,13.340000,13.380000,13.420000,13.460000,13.490000,13.540000,13.560000,13.620000,13.630000,13.660000,13.700000,13.750000,13.770000,13.830000,13.840000,13.920000,13.920000,13.960000,13.990000,14.050000,14.060000,14.090000,14.130000,14.180000,14.270000,14.310000,14.400000,14.450000,14.540000,14.590000,14.680000,14.730000,14.830000,14.880000,14.970000,15.020000,15.120000,15.170000,15.230000,15.330000,15.380000,15.480000,15.540000,15.590000,15.700000,15.750000,15.810000,15.860000,15.970000,16.030000,16.090000,16.140000,16.260000,16.320000,16.380000,16.440000,16.560000,16.620000,16.680000,16.740000,16.800000,16.860000,16.920000,17.050000,17.120000,17.180000,17.240000,17.310000,17.380000,17.440000,17.510000,17.580000,17.650000,17.710000,17.780000,17.850000,17.920000,17.990000,18.060000,18.140000,18.210000,18.280000,18.350000,18.430000,18.500000,18.580000,18.650000,18.730000,18.810000,18.890000,18.960000,19.040000,19.120000,19.200000,19.280000,19.360000,19.450000,19.530000,19.610000,19.700000,19.780000,19.870000,19.960000,20.040000,20.130000,20.220000,20.310000,20.400000,20.490000,20.580000,20.680000,20.770000,20.860000,20.960000,21.060000,21.150000,21.250000,21.350000,21.450000,21.550000,21.650000,21.750000,21.860000,21.960000,22.070000,22.170000,22.280000,22.390000,22.500000,22.610000,22.720000,22.840000,22.950000,23.070000,23.180000,23.300000,23.420000,23.540000,23.660000,23.780000,23.900000,24.030000,24.160000,24.280000,24.410000,24.540000,24.670000,24.810000,24.940000,25.080000,25.210000,25.350000,25.490000,25.630000,25.780000,25.920000,26.070000,26.220000,26.370000,26.520000,26.670000,26.830000,26.980000,27.140000,27.300000,27.470000,27.630000,27.800000,27.970000,28.140000,28.310000,28.480000,28.660000,28.840000,29.020000,29.200000,29.390000,29.580000,29.770000,29.960000,30.160000,30.350000,30.560000,30.760000,30.960000,31.170000,31.380000,31.600000,31.820000,32.040000,32.260000,32.490000,32.720000,32.950000,33.180000,33.420000,33.670000,33.910000,34.160000,34.420000,34.670000,34.930000,35.200000,35.470000,35.740000,36.020000,36.300000,36.590000,36.880000,37.170000,37.470000,37.780000,38.090000,38.400000,38.720000,39.050000,39.380000,39.710000,40.050000,40.400000,40.760000,41.120000,41.480000,41.850000,42.230000,42.620000,43.010000,43.410000,43.820000,44.240000,44.660000,45.090000,45.530000,45.980000,46.440000,46.900000,47.380000,47.860000,48.360000,48.860000,49.380000,49.900000,50.440000,50.990000,51.550000,52.120000,52.710000,53.310000,53.920000,54.540000,55.180000,55.840000,56.510000,57.200000,57.900000,58.620000,59.360000,60.110000,60.890000,61.680000,62.500000,63.330000,64.190000,65.070000,65.980000,66.910000,67.870000,68.850000,69.860000,70.900000,71.970000,73.070000,74.210000,75.380000,76.580000,77.830000,79.110000,80.430000,81.800000,83.210000,84.670000,86.180000,87.740000,89.360000,91.030000,92.770000,94.570000,96.430000,98.370000,100.400000,102.500000,104.600000,106.900000,109.300000,111.700000,114.300000,116.900000,119.700000,122.600000,125.600000,128.800000,132.100000,135.600000,139.300000,143.100000,147.100000,151.400000])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='silver_Johnson_Christy':
+            lambda_data = np.array([])
+            lambda_data = np.array([1.879000000000000115e-01,1.915999999999999925e-01,1.953000000000000014e-01,1.993000000000000049e-01,2.033000000000000085e-01,2.073000000000000120e-01,2.119000000000000050e-01,2.164000000000000090e-01,2.214000000000000135e-01,2.262000000000000122e-01,2.313000000000000056e-01,2.371000000000000052e-01,2.426000000000000101e-01,2.489999999999999991e-01,2.550999999999999934e-01,2.615999999999999992e-01,2.688999999999999724e-01,2.761000000000000121e-01,2.843999999999999861e-01,2.923999999999999932e-01,3.009000000000000008e-01,3.106999999999999762e-01,3.204000000000000181e-01,3.315000000000000169e-01,3.425000000000000266e-01,3.542000000000000148e-01,3.679000000000000048e-01,3.815000000000000058e-01,3.973999999999999755e-01,4.133000000000000007e-01,4.304999999999999938e-01,4.509000000000000230e-01,4.713999999999999857e-01,4.959000000000000075e-01,5.209000000000000297e-01,5.485999999999999766e-01,5.820999999999999508e-01,6.168000000000000149e-01,6.594999999999999751e-01,7.045000000000000151e-01,7.560000000000000053e-01,8.211000000000000520e-01,8.920000000000000151e-01,9.839999999999999858e-01,1.088000000000000078e+00,1.215999999999999970e+00,1.393000000000000016e+00,1.610000000000000098e+00,1.937000000000000055e+00])*1e-6
+            n_data      = np.array([1.070000000000000062e+00,1.100000000000000089e+00,1.120000000000000107e+00,1.139999999999999902e+00,1.149999999999999911e+00,1.179999999999999938e+00,1.199999999999999956e+00,1.219999999999999973e+00,1.250000000000000000e+00,1.260000000000000009e+00,1.280000000000000027e+00,1.280000000000000027e+00,1.300000000000000044e+00,1.310000000000000053e+00,1.330000000000000071e+00,1.350000000000000089e+00,1.379999999999999893e+00,1.409999999999999920e+00,1.409999999999999920e+00,1.389999999999999902e+00,1.340000000000000080e+00,1.129999999999999893e+00,8.100000000000000533e-01,1.700000000000000122e-01,1.400000000000000133e-01,1.000000000000000056e-01,7.000000000000000666e-02,5.000000000000000278e-02,5.000000000000000278e-02,5.000000000000000278e-02,4.000000000000000083e-02,4.000000000000000083e-02,5.000000000000000278e-02,5.000000000000000278e-02,5.000000000000000278e-02,5.999999999999999778e-02,5.000000000000000278e-02,5.999999999999999778e-02,5.000000000000000278e-02,4.000000000000000083e-02,2.999999999999999889e-02,4.000000000000000083e-02,4.000000000000000083e-02,4.000000000000000083e-02,4.000000000000000083e-02,8.999999999999999667e-02,1.300000000000000044e-01,1.499999999999999944e-01,2.399999999999999911e-01])
+            k_data      = np.array([1.211999999999999966e+00,1.231999999999999984e+00,1.254999999999999893e+00,1.276999999999999913e+00,1.296000000000000041e+00,1.312000000000000055e+00,1.324999999999999956e+00,1.336000000000000076e+00,1.342000000000000082e+00,1.344000000000000083e+00,1.356999999999999984e+00,1.366999999999999993e+00,1.377999999999999892e+00,1.389000000000000012e+00,1.393000000000000016e+00,1.387000000000000011e+00,1.372000000000000108e+00,1.330999999999999961e+00,1.264000000000000012e+00,1.161000000000000032e+00,9.639999999999999680e-01,6.159999999999999920e-01,3.920000000000000151e-01,8.289999999999999591e-01,1.141999999999999904e+00,1.419000000000000039e+00,1.657000000000000028e+00,1.864000000000000101e+00,2.069999999999999840e+00,2.274999999999999911e+00,2.462000000000000188e+00,2.657000000000000028e+00,2.869000000000000217e+00,3.092999999999999972e+00,3.323999999999999844e+00,3.585999999999999854e+00,3.858000000000000096e+00,4.152000000000000135e+00,4.482999999999999652e+00,4.838000000000000078e+00,5.241999999999999993e+00,5.727000000000000313e+00,6.312000000000000277e+00,6.991999999999999993e+00,7.794999999999999929e+00,8.827999999999999403e+00,1.009999999999999964e+01,1.184999999999999964e+01,1.408000000000000007e+01])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='ITO_Refractive':
+            lambda_data = np.array([])
+            lambda_data = np.array([0.2500,0.2600,0.2700,0.2800,0.2900,0.3000,0.3100,0.3200,0.3300,0.3400,0.3500,0.3600,0.3700,0.3800,0.3900,0.4000,0.4100,0.4200,0.4300,0.4400,0.4500,0.4600,0.4700,0.4800,0.4900,0.5000,0.5100,0.5200,0.5300,0.5400,0.5500,0.5600,0.5700,0.5800,0.5900,0.6000,0.6100,0.6200,0.6300,0.6400,0.6500,0.6600,0.6700,0.6800,0.6900,0.7000,0.7100,0.7200,0.7300,0.7400,0.7500,0.7600,0.7700,0.7800,0.7900,0.8000,0.8100,0.8200,0.8300,0.8400,0.8500])*1e-6
+            n_data      = np.array([2.350461,2.355171,2.351314,2.341429,2.327366,2.310482,2.291769,2.271956,2.251578,2.231025,2.210578,2.190439,2.170753,2.151616,2.133092,2.11522,2.098022,2.081505,2.065663,2.050488,2.035964,2.02207,2.008785,1.996085,1.983947,1.972345,1.961256,1.950656,1.940521,1.930828,1.921556,1.912684,1.904192,1.896061,1.888273,1.88081,1.873656,1.866796,1.860214,1.853898,1.847834,1.842009,1.836412,1.831031,1.825857,1.820879,1.816089,1.811476,1.807033,1.802752,1.798626,1.794647,1.790808,1.787104,1.783528,1.780075,1.776739,1.773515,1.770399,1.767385,1.76447])
+            k_data      = np.array([0.2113379,0.1801257,0.1544102,0.1331719,0.1156021,0.1010547,8.900975e-2,7.904635e-02,7.082141e-02,6.405398e-02,5.851254e-02,5.400554e-02,5.037373E-02,4.748415E-02,4.522533E-02,4.350352E-02,4.223955E-02,4.136638E-02,4.082706E-02,4.057307E-02,4.056298E-02,0.0407613,4.113761E-02,4.166571E-02,4.232306E-02,4.309022E-02,4.395034E-02,4.488888E-02,4.589323E-02,4.695242E-02,4.805696E-02,4.919859E-02,5.037013E-02,5.156533E-02,5.277875E-02,5.400567E-02,5.524196E-02,5.648406E-02,5.772886E-02,5.897364E-02,6.021609E-02,6.145417E-02,6.268614E-02,6.391049E-02,6.512594E-02,6.633137E-02,6.752584E-02,6.870857E-02,6.987888E-02,7.103622E-02,7.218014E-02,7.331026E-02,7.442628E-02,7.552799E-02,7.661521E-02,7.768784E-02,0.0787458,7.978907E-02,8.081765E-02,8.183157E-02,0.0828309])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='BK7_schott':
+            lambda_data = np.array([])
+            lambda_data=1e-6*np.array([0.3000,0.3220,0.3440,0.3660,0.3880,0.4100,0.4320,0.4540,0.4760,0.4980,0.5200,0.5420,0.5640,0.5860,0.6080,0.6300,0.6520,0.6740,0.6960,0.7180,0.7400,0.7620,0.7840,0.8060,0.8280,0.8500,0.8720,0.8940,0.9160,0.9380,0.9600,0.9820,1.004,1.026,1.048,1.070,1.092,1.114,1.136,1.158,1.180,1.202,1.224,1.246,1.268,1.290,1.312,1.334,1.356,1.378,1.400,1.422,1.444,1.466,1.488,1.510,1.532,1.554,1.576,1.598,1.620,1.642,1.664,1.686,1.708,1.730,1.752,1.774,1.796,1.818,1.840,1.862,1.884,1.906,1.928,1.950,1.972,1.994,2.016,2.038,2.060,2.082,2.104,2.126,2.148,2.170,2.192,2.214,2.236,2.258,2.280,2.302,2.324,2.346,2.368,2.390,2.412,2.434,2.456,2.478,2.500,7.000])
+            n_data=np.array([1.5527702635739,1.5458699289209,1.5404466868331,1.536090527917,1.53252773217,1.529568767224,1.5270784291406,1.524957847324,1.5231331738499,1.5215482528369,1.5201596882463,1.5189334783109,1.5178426478869,1.516865556749,1.5159846691816,1.551856452759,1.5144566604975,1.513787889767,1.5131711117948,1.5125994024544,1.5120668948646,1.5115685899969,1.511100205936,1.5106580569705,1.5102389559626,1.5098401349174,1.5094591800239,1.5090939781792,1.5087426727363,1.5084036266923,1.500753919142,1.5077566832938,1.5074463569456,1.5071433917383,1.5068468735887,1.5065559820529,1.5062699788386,1.505988197987,1.5057100370628,1.5054349503657,1.5051624419507,1.5048920603512,1.504623393661,1.5043560652815,1.5040897301904,1.503240716592,1.5035587983604,1.5032936418104,1.5030283541053,1.502762705911,1.5024964846769,1.5022294930427,1.501961547416,1.5016924767046,1.5014221211688,1.5011503314064,1.5008769674285,1.5006018978322,1.5003249990526,1.5000461546874,1.499752548858,1.4994821957943,1.4991968790539,1.4989092113428,1.4986191039608,1.4983264724496,1.4980312362468,1.49773331837,.4974326451267,1.4971291458495,1.4968227526526,1.4965134002084,1.4962010255422,1.4958855678422,1.495566968286,1.495245198788,1.4949201173049,1.4945917567902,1.4942600359742,1.4939249037922,1.4935863103651,1.4932442068978,1.4928985455839,1492549279517,1.4921963626087,1.491839749511,1.4914793955446,1.4911152566309,1.4907472892292,1.4903754502768,1.489999697337,1.4896199875296,1.4892362795147,1.4888485314127,1.4884567017771,1.4880607493487,1.4876606330169,1.4872563117813,1.486477447166,1.4864348909385,1.486017709571,1.485866785332])
+            k_data=np.array([2.86070000e-06,6.08661429e-07,1.57115000e-07,3.28338000e-08,1.51328000e-08,9.16760000e-09,1.07080500e-08,1.05012500e-08,1.00028400e-08,9.61349500e-09,8.44231739e-09,7.19295652e-09,8.17725294e-09,9.64753500e-09,1.10901300e-08,1.20685000e-08,1.24898000e-08,1.13436250e-08,9.30175000e-09,8.99082500e-09,9.06455556e-09,9.13828611e-09,9.21201667e-09,9.28574722e-09,9.35947778e-09,9.43320833e-09,9.50693889e-09,9.58066944e-09,9.65440000e-09,9.72813056e-09,9.80186111e-09,9.87559167e-09,9.94932222e-09,1.00230528e-08,1.00967833e-08,2.09340426e+07,6.69889362e+07,1.13043830e+08,1.59098723e+08,2.05153617e+08,2.51208511e+08,2.97263404e+08,3.43318298e+08,3.89373191e+08,4.35428085e+08,4.81482979e+08,5.27537872e+08,5.73592766e+08,6.19647660e+08,6.65702553e+08,7.11757447e+08,7.57812340e+08,8.03867234e+08,8.49922128e+08,8.95977021e+08,9.42031915e+08,9.79427727e+08,9.30232727e+08,8.81037727e+08,8.31842727e+08,7.82647727e+08,7.33452727e+08,6.84257727e+08,6.35062727e+08,5.85867727e+08,5.36672727e+08,4.87477727e+08,4.38282727e+08,3.89087727e+08,3.39892727e+08,2.90697727e+08,2.41502727e+08,1.92307727e+08,1.43112727e+08,9.39177273e+07,4.47227273e+07,1.11131577e-06,1.30948930e-06,1.50766282e-06,1.70583634e-06,1.90400986e-06,2.10218338e-06,2.30035690e-06,2.49853042e-06,2.69670394e-06,2.89487746e-06,3.09305099e-06,3.29122451e-06,3.48939803e-06,3.68757155e-06,3.88574507e-06,4.08391859e-06,4.28209211e-06,4.75176800e-06,5.23437257e-06,5.71697714e-06,6.19958171e-06,6.68218629e-06,7.16479086e-06,7.64739543e-06,8.13000000e-06,9.26000000e-06])
+            eps_data = (n_data+1j*k_data)**2
+        elif material=='ITO_GT':
+            lambda_data = np.array([])
+            lambda_data = np.array([0.25,0.2675,0.285,0.3025,0.32,0.3375,0.355,0.3725,0.39,0.4075,0.425,0.4425,0.46,0.4775,0.495,0.5125,0.53,0.5475,0.565,0.5825,0.6,0.6175,0.635,0.6525,0.67,0.6875,0.705,0.7225,0.74,0.7575,0.775,0.7925,0.81,0.8275,0.845,0.8625,0.88,0.8975,0.915,0.9325,0.95,0.9675,0.985,1.0025,1.02,1.0375,1.055,1.0725,1.09,1.1075,1.125,1.1425,1.16,1.1775,1.195,1.2125,1.23,1.2475,1.265,1.2825,1.3,1.3175,1.335,1.3525,1.37,1.3875,1.405,1.4225,1.44,1.4575,1.475,1.4925,1.51,1.5275,1.545,1.5625,1.58,1.5975,1.615,1.6325,1.65,1.6675,1.685,1.7025,1.72,1.7375,1.755,1.7725,1.79,1.8075,1.825,1.8425,1.86,1.8775,1.895,1.9125,1.93,1.9475,1.965,1.9825,2])*1e-6
+            n_data      = np.array([2.086841,2.256838,2.312452,2.192289,2.1649,2.17426,2.127864,2.080262,2.041328,2.00946,1.982532,1.959003,1.937833,1.918317,1.899966,1.882438,1.865484,1.848917,1.832599,1.816422,1.800299,1.784161,1.767952,1.751624,1.735135,1.718451,1.701541,1.684377,1.666934,1.649189,1.631118,1.612702,1.593917,1.574744,1.555156,1.53513,1.514633,1.49363,1.472075,1.449909,1.427055,1.403412,1.378845,1.353175,1.326172,1.297547,1.26695,1.233992,1.198283,1.159497,1.117451,1.072181,1.023955,0.9732279,0.9205368,0.8663945,0.8112299,0.7554214,0.6994195,0.6439537,0.5902477,0.5400667,0.4953463,0.4574426,0.4266062,0.402139,0.3829249,0.3678525,0.3559961,0.3466423,0.3392583,0.3334495,0.3289228,0.3254583,0.3228894,0.3210882,0.3199554,0.3194133,0.3194004,0.3198677,0.320776,0.3220939,0.3237959,0.325862,0.3282759,0.3310248,0.3340991,0.3374914,0.3411963,0.3452107,0.3495328,0.3541622,0.3591004,0.3643494,0.3699128,0.3757952,0.382002,0.3885397,0.3954159,0.4026388,0.4102177])
+            k_data      = np.array([0.7211512,0.6626275,0.3831685,0.1567977,0.0055275,0.0065151,0.0277501,0.0338302,0.0346299,0.0341761,0.0336645,0.0334167,0.0334875,0.0338538,0.0344742,0.0353084,0.0363220,0.0374876,0.0387832,0.0401921,0.0417009,0.0432994,0.0449794,0.0467341,0.0485581,0.0504465,0.0523948,0.0543982,0.0564521,0.0585506,0.0606871,0.0628533,0.0650391,0.0672315,0.0694143,0.0715675,0.0736659,0.0756788,0.0775688,0.0792917,0.0807966,0.0820277,0.0829284,0.0834499,0.0835651,0.0832908,0.0827195,0.0820570,0.0816583,0.0820466,0.0838932,0.0879495,0.0949403,0.1054614,0.1199302,0.1386167,0.1617427,0.1896012,0.2226430,0.2614598,0.3065845,0.3580662,0.4150034,0.4755209,0.5373977,0.5988109,0.6586387,0.7163580,0.7718193,0.8250696,0.8762448,0.9255091,0.9730301,1.0189640,1.0634520,1.1066200,1.1485780,1.1894250,1.2292440,1.2681130,1.3060950,1.3432510,1.3796310,1.4152830,1.4502480,1.4845610,1.5182580,1.5513680,1.5839180,1.6159330,1.6474360,1.6784470,1.7089840,1.7390670,1.7687100,1.7979300,1.8267390,1.8551520,1.8831810,1.9108380,1.9381330])
+            eps_data    =  (n_data+1j*k_data)**2   
+        elif material=='gold_ief_V2':
+            lambda_data = np.array([])
+            lambda_data = (1e-6)*np.array([0.400,0.405,0.410,0.415,0.420,0.425,0.430,0.435,0.440,0.445,0.450,0.455,0.460,0.465,0.470,0.475,0.480,0.485,0.490,0.495,0.500,0.505,0.510,0.515,0.520,0.525,0.530,0.535,0.540,0.545,0.550,0.555,0.56,0.565,0.57,0.575,0.58,0.585,0.59,0.595,0.6,0.605,0.61,0.615,0.62,0.625,0.63,0.635,0.64,0.645,0.65,0.655,0.66,0.665,0.67,0.675,0.68,0.685,0.69,0.695,0.7,0.705,0.71,0.715,0.72,0.725,0.73,0.735,0.74,0.745,0.75,0.755,0.76,0.765,0.77,0.775,0.78,0.785,0.79,0.795,0.8,0.805,0.81,0.815,0.82,0.825,0.83,0.835,0.84,0.845,0.85,0.855,0.86,0.865,0.87,0.875,0.88,0.885,0.89,0.895,0.9,0.905,0.91,0.915,0.92,0.925,0.93,0.935,0.94,0.945,0.95,0.955,0.96,0.965,0.97,0.975,0.98,0.985,0.99,0.995,1.0,1.005,1.01,1.015,1.02,1.025,1.03,1.035,1.04,1.045,1.05,1.055,1.06,1.065,1.07,1.075,1.08,1.085,1.09,1.095,1.1,1.105,1.11,1.115,1.12,1.125,1.13,1.135,1.14,1.145,1.15,1.155,1.16,1.165,1.17,1.175,1.18,1.185,1.19,1.195,1.2,1.205,1.210,1.215,1.22,1.225,1.23,1.235,1.24,1.245,1.25,1.255,1.26,1.265,1.27,1.275,1.28,1.285,1.29,1.295,1.3,1.305,1.31,1.315,1.32,1.325,1.33,1.335,1.34,1.345,1.35,1.355,1.36,1.365,1.37,1.375,1.38,1.385,1.39,1.395,1.4,1.405,1.41,1.415,1.42,1.425,1.43,1.435,1.44,1.445,1.45,1.455,1.46,1.465,1.47,1.475,1.48,1.485,1.49,1.495,1.5,1.505,1.51,1.515,1.52,1.525,1.53,1.535,1.54,1.545,1.55,1.555,1.56,1.565,1.57,1.575,1.58,1.585,1.59,1.595,1.6,1.605,1.61,1.615,1.62,1.625,1.63,1.635,1.64,1.645,1.65])
+            n_data      = (1e-1)*np.array([15.646910,15.558650,15.512930,15.472270,15.410060,15.349390,15.240760,15.108560,14.974370,14.837930,14.598730,14.325420,14.034750,13.715530,13.289160,12.748070,12.037110,11.328820,10.444790,9.4416400,8.3950500,7.4556700,6.6078200,5.8644600,5.2979200,4.8214600,4.3907400,4.0695000,3.7839700,3.4623000,3.2085000,2.9728800,2.7971600,2.6633900,2.4715000,2.3762800,2.2566800,2.1680400,2.0622800,1.9311800,1.8446300,1.6995400,1.6499400,1.5753100,1.5292100,1.4764500,1.4116600,1.3667400,1.2513700,1.2720900,1.2657400,1.2115800,1.2490000,1.2112400,1.2308600,1.1798300,1.2039000,1.1914200,1.1710800,1.1517300,1.1438300,1.1603400,1.1770000,1.1837900,1.2401500,1.2461100,1.2385900,1.2687400,1.2973400,1.2337300,1.3036700,1.3166000,1.2492000,1.2495800,1.2418900,1.2437500,1.2624100,1.3869200,1.3549800,1.1885600,1.2067300,1.2437700,1.2305500,1.1854000,1.2027700,1.2274400,1.2239800,1.1699200,1.1790100,1.2965000,1.2658700,1.2965600,1.2964200,1.2784100,1.5370800,1.4223000,1.3780000,1.3930300,1.2956000,1.3493300,1.3172000,1.3198800,1.2784700,1.2808600,1.2712500,1.3230900,1.3315600,1.2621200,1.2859900,1.2477200,1.2638000,1.2714800,1.3106200,1.2734700,1.3170800,1.2924700,1.2832000,1.2481400,1.2348400,1.3109900,1.3244900,1.2671300,1.2717900,1.2217900,1.1585300,1.1863400,1.2524800,1.3092800,1.2763100,1.2475000,1.3123900,1.2620500,1.2553900,1.3859200,1.3184900,1.3527900,1.2901600,1.2484900,1.3077500,1.3671200,1.3431800,1.3671700,1.3704200,1.3884700,1.3105300,1.2327400,1.3613200,1.3904300,1.3452800,1.4167900,1.4827900,1.5082100,1.4960100,1.4879800,1.5365400,1.5969700,1.6509800,1.6134200,1.5765000,1.5143000,1.5915900,1.5127800,1.5599100,1.6244700,1.6831700,1.6155100,1.6535600,1.5795300,1.5983800,1.7520800,1.7707200,1.7307700,1.7951900,1.8495000,1.8354100,1.8295800,1.9277100,1.7938200,1.8426900,1.8409200,1.9650100,1.8607300,1.9159200,1.9426100,1.9959500,2.0866300,1.9492800,1.9293500,2.0447200,2.0774300,2.1126000,2.0868200,2.0814200,2.1307400,2.1065500,2.0128400,2.0561800,2.2184700,2.2851100,2.1714000,2.3167200,2.2305300,2.3307800,2.4398300,2.3732300,2.4053200,2.4099300,2.3728900,2.4351400,2.2612200,2.3920800,2.4820100,2.5349200,2.5337600,2.5615900,2.5598100,2.5736500,2.5666500,2.4610000,2.5899400,2.5900500,2.6145900,2.6609400,2.7556700,2.5306500,2.6600700,2.6528600,2.7769600,2.7706100,2.6501100,2.7880300,2.8844600,2.8242400,2.7782100,2.8079200,2.8806700,2.7954500,2.8517800,2.8799900,2.9278200,2.6152200,2.8917600,2.9752000,2.9510700,2.9732400,2.8253900,2.8687300,2.8378000,2.9013000,2.9321700,3.2267900])
+            k_data      = np.array([1.8992540,1.9046340,1.9044980,1.9024740,1.9014450,1.8978680,1.8934470,1.8858860,1.8761160,1.8667720,1.8525460,1.8382010,1.8205560,1.8009460,1.7794280,1.7578590,1.7350630,1.7195160,1.7141920,1.7295670,1.7620700,1.8147170,1.8786390,1.9529540,2.0272960,2.1039960,2.1789000,2.2503610,2.3229870,2.3935870,2.4597690,2.5246280,2.5903170,2.6520690,2.7131050,2.7592480,2.8198340,2.8799400,2.9346180,2.9913460,3.0506460,3.1021100,3.1562950,3.2057960,3.2627830,3.3151310,3.3677060,3.4163020,3.4676830,3.5165560,3.5635300,3.6144760,3.6667830,3.7112160,3.7612510,3.8112130,3.8610910,3.9103920,3.9545070,4.0002210,4.0484010,4.0970700,4.1412710,4.1833900,4.2355290,4.2781430,4.3239410,4.3659620,4.4154850,4.4551470,4.5002400,4.5331690,4.5836770,4.6269550,4.6584580,4.7078480,4.7555110,4.7966980,4.8438350,4.8786780,4.9161650,4.9576250,5.0017540,5.0393320,5.0882110,5.1087130,5.1518180,5.2031190,5.2473270,5.2759080,5.3260830,5.3678110,5.4009530,5.4360300,5.4701750,5.5065650,5.5621320,5.6831050,5.7320340,5.7587890,5.8143660,5.8331220,5.8993750,5.9238690,5.9527750,5.9952900,6.0281380,6.0825920,6.1200590,6.1662610,6.1967010,6.2223740,6.2637100,6.3227190,6.3615650,6.3474580,6.4365330,6.4925430,6.4425650,6.5519420,6.5875380,6.6289810,6.6555060,6.6854520,6.7054180,6.7349220,6.7717590,6.8099960,6.8528230,6.8910600,6.9375720,6.9917690,7.0232950,7.0457950,7.0776540,7.1449900,7.2056460,7.2217350,7.2569820,7.2752720,7.3337560,7.3781740,7.4158780,7.4399600,7.4595890,7.4953890,7.5452690,7.5590710,7.5917570,7.6425300,7.6391480,7.6823560,7.7626630,7.8190980,7.9037310,7.9224080,7.9465610,7.9554060,7.9971280,8.0002900,8.0365410,8.0817300,8.0996800,8.1705260,8.1936170,8.2524910,8.2865890,8.3032760,8.3173630,8.4210820,8.4202630,8.4877540,8.5603770,8.5865150,8.6374350,8.6515030,8.6394860,8.6833640,8.6938690,8.7700410,8.7382570,8.7588030,8.8392740,8.8634950,8.9308550,8.9346790,8.9743600,8.9811730,9.0481070,9.0757510,9.0903840,9.0978030,9.2167560,9.3033070,9.2498280,9.2237900,9.2347130,9.2208010,9.2920690,9.4089860,9.3883550,9.5315830,9.5951700,9.6899540,9.6836870,9.7217790,9.7170840,9.7674580,9.7824340,9.8220680,9.7949410,9.8960340,9.9612170,9.9591830,10.078740,10.078360,10.124820,10.122150,10.102410,10.087270,10.078390,10.093420,10.190430,10.210160,10.227460,10.291980,10.330670,10.397080,10.543920,10.534180,10.532970,10.546080,10.483610,10.512340,10.498530,10.561840,10.572880,10.585660,10.605550,10.622110,10.611870,10.875040,10.875630,10.829470,10.702580,10.686460,10.731770,10.750630,10.991190,10.800460,11.033790])
+            eps_data    =  (n_data+1j*k_data)**2        
+        elif material=='titanium':
+            lambda_data = np.array([])
+            lambda_data = (1e-6)*np.array([0.2066,0.2084,0.2101,0.2119,0.2138,0.2156,0.2175,0.2194,0.2214,0.2234,0.2254,0.2275,0.2296,0.2317,0.2339,0.2362,0.2384,0.2407,0.2431,0.2455,0.2480,0.2505,0.2530,0.2556,0.2583,0.2610,0.2638,0.2666,0.2695,0.2725,0.2755,0.2786,0.2818,0.2850,0.2883,0.2917,0.2952,0.2988,0.3024,0.3061,0.3100,0.3139,0.3179,0.3220,0.3263,0.3306,0.3351,0.3397,0.3444,0.3493,0.3542,0.3594,0.3647,0.3701,0.3757,0.3815,0.3875,0.3936,0.3999,0.4065,0.4133,0.4203,0.4275,0.4350,0.4428,0.4509,0.4592,0.4679,0.4769,0.4862,0.4959,0.5061,0.5166,0.5276,0.5391,0.5510,0.5636,0.5767,0.5904,0.6048,0.6199,0.6358,0.6525,0.6702,0.6888,0.7085,0.7293,0.7514,0.7749,0.7999,0.8266,0.8551,0.8856,0.9184,0.9537,0.9919,1.033,1.078,1.127,1.181,1.240])
+            n_data      = np.array([1.16,1.1675,1.18,1.195,1.21,1.22125,1.23,1.23625,1.24,1.244375,1.24,1.199375,1.18,1.266875,1.35,1.31625,1.26,1.25,1.25,1.245625,1.24,1.23,1.22,1.215625,1.21,1.195,1.18,1.174375,1.17,1.160625,1.15,1.140625,1.13,1.116875,1.1,1.07375,1.05,1.041875,1.04,1.038125,1.04,1.046875,1.06,1.0825,1.11,1.13875,1.17,1.205,1.24,1.27,1.3,1.334375,1.37,1.405625,1.44,1.47125,1.5,1.52625,1.55,1.570625,1.59,1.609375,1.63,1.655625,1.68,1.695625,1.71,1.73,1.75,1.765625,1.78,1.79375,1.81,1.833125,1.86,1.8875,1.92,1.9625,2.01,2.05875,2.11,2.1625,2.22,2.285625,2.36,2.44625,2.54,2.63625,2.74,2.860625,2.98,3.083125,3.17,3.2325,3.28,3.314375,3.35,3.405,3.47,3.5425,3.62])
+            k_data      = np.array([1.21,1.21625,1.22,1.22125,1.22,1.215,1.21,1.210625,1.21,1.2025,1.19,1.165,1.15,1.178125,1.21,1.20875,1.2,1.19875,1.2,1.204375,1.21,1.215,1.22,1.224375,1.23,1.23875,1.25,1.264375,1.28,1.295625,1.31,1.319375,1.33,1.346875,1.37,1.401875,1.44,1.484375,1.53,1.568125,1.61,1.66875,1.73,1.783125,1.83,1.8675,1.9,1.93125,1.96,1.985625,2.01,2.03625,2.06,2.07625,2.09,2.105,2.12,2.135625,2.15,2.159375,2.17,2.18875,2.21,2.23,2.25,2.269375,2.29,2.314375,2.34,2.363125,2.39,2.4275,2.47,2.513125,2.56,2.614375,2.67,2.72,2.77,2.824375,2.88,2.934375,2.99,3.049375,3.11,3.173125,3.23,3.27125,3.3,3.316875,3.32,3.303125,3.28,3.259375,3.25,3.266875,3.3,3.345625,3.4,3.459375,3.52])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='titanium_dioxyde':
+            lambda_data = np.array([])
+            lambda_data = (1e-6)*np.array([4.00e-01,4.299999999999999933e-01,4.410000000000000031e-01,4.520000000000000129e-01,4.630000000000000226e-01,4.739999999999999769e-01,4.849999999999999867e-01,4.959999999999999964e-01,5.070000000000000062e-01,5.180000000000000160e-01,5.290000000000000258e-01,5.400000000000000355e-01,5.510000000000000453e-01,5.620000000000000551e-01,5.729999999999999538e-01,5.839999999999999636e-01,5.949999999999999734e-01,6.059999999999999831e-01,6.169999999999999929e-01,6.280000000000000027e-01,6.390000000000000124e-01,6.500000000000000222e-01,6.610000000000000320e-01,6.720000000000000417e-01,6.830000000000000515e-01,6.939999999999999503e-01,7.049999999999999600e-01,7.159999999999999698e-01,7.269999999999999796e-01,7.379999999999999893e-01,7.489999999999999991e-01,7.600000000000000089e-01,7.710000000000000187e-01,7.820000000000000284e-01,7.930000000000000382e-01,8.040000000000000480e-01,8.149999999999999467e-01,8.259999999999999565e-01,8.369999999999999662e-01,8.479999999999999760e-01,8.589999999999999858e-01,8.699999999999999956e-01,8.810000000000000053e-01,8.920000000000000151e-01,9.030000000000000249e-01,9.140000000000000346e-01,9.250000000000000444e-01,9.360000000000000542e-01,9.469999999999999529e-01,9.579999999999999627e-01,9.689999999999999725e-01,9.799999999999999822e-01,9.909999999999999920e-01,1.002000000000000002e+00,1.012999999999999901e+00,1.024000000000000021e+00,1.034999999999999920e+00,1.046000000000000041e+00,1.056999999999999940e+00,1.068000000000000060e+00,1.078999999999999959e+00,1.090000000000000080e+00,1.100999999999999979e+00,1.112000000000000099e+00,1.122999999999999998e+00,1.133999999999999897e+00,1.145000000000000018e+00,1.155999999999999917e+00,1.167000000000000037e+00,1.177999999999999936e+00,1.189000000000000057e+00,1.199999999999999956e+00,1.211000000000000076e+00,1.221999999999999975e+00,1.233000000000000096e+00,1.243999999999999995e+00,1.254999999999999893e+00,1.266000000000000014e+00,1.276999999999999913e+00,1.288000000000000034e+00,1.298999999999999932e+00,1.310000000000000053e+00,1.320999999999999952e+00,1.332000000000000073e+00,1.342999999999999972e+00,1.354000000000000092e+00,1.364999999999999991e+00,1.375999999999999890e+00,1.387000000000000011e+00,1.397999999999999909e+00,1.409000000000000030e+00,1.419999999999999929e+00,1.431000000000000050e+00,1.441999999999999948e+00,1.453000000000000069e+00,1.463999999999999968e+00,1.475000000000000089e+00,1.485999999999999988e+00,1.497000000000000108e+00,1.508000000000000007e+00,1.518999999999999906e+00,1.530000000000000027e+00])
+            n_data      = np.array([2.969e+00,2.871698453467600221e+00,2.837399124235099990e+00,2.807398241715000076e+00,2.780953840721199999e+00,2.757485125996499864e+00,2.736530850786300206e+00,2.717720000924999990e+00,2.700750727057199985e+00,2.685374931502400031e+00,2.671386810383499899e+00,2.658614212606199789e+00,2.646912037767199966e+00,2.636157131785299867e+00,2.626244297552399853e+00,2.617083145934000044e+00,2.608595587281600015e+00,2.600713816238600096e+00,2.593378680120700164e+00,2.586538348224999950e+00,2.580147219191899932e+00,2.574165018140699868e+00,2.568556046188899877e+00,2.563288553160500083e+00,2.558334210518999896e+00,2.553667666326799868e+00,2.549266167719800080e+00,2.545109239246699850e+00,2.541178407666599970e+00,2.537456965567999934e+00,2.533929767571600156e+00,2.530583054002200072e+00,2.527404297810500022e+00,2.524382071250100168e+00,2.521505929404700197e+00,2.518766308135500065e+00,2.516154434413199859e+00,2.513662247320399779e+00,2.511282328274099918e+00,2.509007839242499927e+00,2.506832467908099993e+00,2.504750378887699913e+00,2.502756170243699785e+00,2.500844834632999891e+00,2.499011724527299805e+00,2.497252521017600202e+00,2.495563205782500127e+00,2.493940035851299974e+00,2.492379520845999785e+00,2.490878402421699889e+00,2.489433635665100120e+00,2.488042372235700128e+00,2.486701945064799801e+00,2.485409854447199862e+00,2.484163755380099925e+00,2.482961446022899921e+00,2.481800857162700158e+00,2.480680042586600020e+00,2.479597170271099937e+00,2.478550514309100006e+00,2.477538447504699981e+00,2.476559434571699914e+00,2.475612025879999845e+00,2.474694851699299925e+00,2.473806616895899868e+00,2.472946096039399855e+00,2.472112128886000182e+00,2.471303616203099907e+00,2.470519515906500096e+00,2.469758839484100132e+00,2.469020648680400054e+00,2.468304052420899897e+00,2.467608203956999979e+00,2.466932298212200170e+00,2.466275569314300142e+00,2.465637288297899854e+00,2.465016760965000220e+00,2.464413325889899919e+00,2.463826352557500154e+00,2.463255239626500170e+00,2.462699413305100116e+00,2.462158325833200045e+00,2.461631454061900204e+00,2.461118298124000070e+00,2.460618380187900023e+00,2.460131243289500169e+00,2.459656450236599845e+00,2.459193582580600168e+00,2.458742239649999828e+00,2.458302037642699833e+00,2.457872608772500023e+00,2.457453600465400179e+00,2.457044674603499956e+00,2.456645506812999979e+00,2.456255785791999990e+00,2.455875212678400032e+00,2.455503500451800214e+00,2.455140373370200191e+00,2.454785566437100108e+00,2.454438824899099814e+00,2.454099903769200175e+00,2.453768567377999865e+00])
+            k_data      = np.zeros(102)
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='fused_silica':
+            lambda_data = np.array([])
+            lambda_data = np.array([289.3594,312.5668,334.1476,365.0153,404.6563,435.8327,491.6068,546.0734,576.9598,589.29,623.4402,632.8164,671.6428,690.752,708.201,1060,2700,2900])*1e-9
+            n_data      = np.array([1.491039,1.484538,1.479812,1.474579,1.469657,1.46673,1.462841,1.460117,1.458885,1.458434,1.457334,1.457055,1.456005,1.455539,1.455135,1.4497,1.42588,1.42156])
+            k_data      = np.array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='silicon_nitride':
+            lambda_data = np.array([])
+            lambda_data = np.array([0.310000,0.361900,0.413900,0.465800,0.517800,0.569700,0.621600,0.673600,0.725500,0.777500,0.829400,0.881300,0.933300,0.985200,1.037000,1.089000,1.141000,1.193000,1.245000,1.297000,1.349000,1.401000,1.453000,1.505000,1.557000,1.609000,1.660000,1.712000,1.764000,1.816000,1.868000,1.920000,1.972000,2.024000,2.076000,2.128000,2.180000,2.232000,2.284000,2.336000,2.388000,2.440000,2.491000,2.543000,2.595000,2.647000,2.699000,2.751000,2.803000,2.855000,2.907000,2.959000,3.011000,3.063000,3.115000,3.167000,3.219000,3.271000,3.323000,3.374000,3.426000,3.478000,3.530000,3.582000,3.634000,3.686000,3.738000,3.790000,3.842000,3.894000,3.946000,3.998000,4.050000,4.102000,4.154000,4.206000,4.257000,4.309000,4.361000,4.413000,4.465000,4.517000,4.569000,4.621000,4.673000,4.725000,4.777000,4.829000,4.881000,4.933000,4.985000,5.037000,5.088000,5.140000,5.192000,5.244000,5.296000,5.348000,5.400000,5.452000,5.504000])*1e-6
+            n_data      = np.array([2.175939,2.124453,2.093455,2.073192,2.059047,2.048735,2.040907,2.034761,2.029817,2.025726,2.022278,2.019305,2.016689,2.014355,2.012241,2.010287,2.008463,2.006742,2.005099,2.003518,2.001982,2.000480,1.999001,1.997539,1.996084,1.994633,1.993207,1.991747,1.990278,1.988795,1.987297,1.985781,1.984245,1.982688,1.981107,1.979501,1.977870,1.976211,1.974525,1.972810,1.971064,1.969289,1.967517,1.965679,1.963809,1.961906,1.959970,1.958000,1.955996,1.953957,1.951883,1.949774,1.947629,1.945448,1.943231,1.940978,1.938687,1.936359,1.933994,1.931638,1.929198,1.926720,1.924203,1.921648,1.919053,1.916420,1.913747,1.911035,1.908282,1.905490,1.902657,1.899784,1.896870,1.893914,1.890918,1.887880,1.884860,1.881739,1.878575,1.875370,1.872121,1.868830,1.865495,1.862117,1.858695,1.855229,1.851719,1.848164,1.844564,1.840920,1.837229,1.833494,1.829785,1.825957,1.822083,1.818163,1.814194,1.810179,1.806115,1.802003,1.797843])
+            k_data      = np.zeros_like(n_data)
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='silicon_nitride_Luke':
+            lambda_data = np.array([0.31, 0.3619, 0.4139, 0.4658, 0.5178, 0.5697, 0.6216, 0.6736, 0.7255, 0.7775, 0.8294, 0.8813, 0.9333, 0.9852, 1.037, 1.089, 1.141, 1.193, 1.245, 1.297, 1.349, 1.401, 1.453, 1.505, 1.557, 1.609, 1.66, 1.712, 1.764, 1.816, 1.868, 1.92, 1.972, 2.024, 2.076, 2.128, 2.18, 2.232, 2.284, 2.336, 2.388, 2.44, 2.491, 2.543, 2.595, 2.647, 2.699, 2.751, 2.803, 2.855, 2.907, 2.959, 3.011, 3.063, 3.115, 3.167, 3.219, 3.271, 3.323, 3.374, 3.426, 3.478, 3.53, 3.582, 3.634, 3.686, 3.738, 3.79, 3.842, 3.894, 3.946, 3.998, 4.05, 4.102, 4.154, 4.206, 4.257, 4.309, 4.361, 4.413, 4.465, 4.517, 4.569, 4.621, 4.673, 4.725, 4.777, 4.829, 4.881, 4.933, 4.985, 5.037, 5.088, 5.14, 5.192, 5.244, 5.296, 5.348, 5.4, 5.452, 5.504])
+            n_data      = np.array([2.17593947, 2.12445268, 2.09345547, 2.07319213, 2.05904723, 2.0487351 , 2.0409071 , 2.03476064, 2.02981739, 2.02572648, 2.02227789, 2.01930477, 2.01668852, 2.01435537, 2.01224123, 2.01028668, 2.00846317, 2.00674172, 2.00509935, 2.00351768, 2.00198185, 2.00047974, 1.99900139, 1.99753852, 1.99608424, 1.99463275, 1.99320714, 1.99174738, 1.99027781, 1.98879533, 1.98729728, 1.98578132, 1.98424544, 1.98268785, 1.98110698, 1.97950143, 1.97786997, 1.97621149, 1.974525  , 1.97280959, 1.97106447, 1.96928888, 1.96751722, 1.96567937, 1.96380923, 1.96190626, 1.95996998, 1.95799992, 1.95599568, 1.95395684, 1.95188304, 1.94977391, 1.94762912, 1.94544835, 1.94323128, 1.94097762, 1.93868707, 1.93635938, 1.93399425, 1.931638  , 1.92919797, 1.92671975, 1.92420308, 1.92164773, 1.91905345, 1.91642001, 1.91374716, 1.91103468, 1.90828233, 1.90548987, 1.90265707, 1.8997837 , 1.89686952, 1.8939143 , 1.89091779, 1.88787977, 1.88485962, 1.88173865, 1.87857544, 1.87536975, 1.87212132, 1.8688299 , 1.86549524, 1.86211708, 1.85869516, 1.85522921, 1.85171896, 1.84816414, 1.84456447, 1.84091967, 1.83722945, 1.83349352, 1.82978475, 1.82595741, 1.82208345, 1.81816258, 1.81419447, 1.81017879, 1.80611523, 1.80200344, 1.79784309])
+            eps_data    =  n_data**2
+        elif material=='silicon_internet2': #
+            lambda_data = np.array([])
+            lambda_data = np.array([3.16e-007,3.18e-007,3.19e-007,3.21e-007,3.23e-007,3.25e-007,3.26e-007,3.28e-007,3.3e-007,3.31e-007,3.33e-007,3.35e-007,3.37e-007,3.39e-007,3.41e-007,3.42e-007,3.44e-007,3.46e-007,3.48e-007,3.5e-007,3.52e-007,3.54e-007,3.56e-007,3.58e-007,3.6e-007,3.62e-007,3.65e-007,3.67e-007,3.69e-007,3.71e-007,3.73e-007,3.76e-007,3.78e-007,3.8e-007,3.83e-007,3.85e-007,3.87e-007,3.9e-007,3.92e-007,3.95e-007,3.97e-007,4e-007,4.02e-007,4.05e-007,4.08e-007,4.1e-007,4.13e-007,4.16e-007,4.19e-007,4.22e-007,4.25e-007,4.27e-007,4.3e-007,4.33e-007,4.36e-007,4.4e-007,4.43e-007,4.46e-007,4.49e-007,4.52e-007,4.56e-007,4.59e-007,4.63e-007,4.66e-007,4.7e-007,4.73e-007,4.77e-007,4.8e-007,4.84e-007,4.88e-007,4.92e-007,4.96e-007,5e-007,5.04e-007,5.08e-007,5.12e-007,5.17e-007,5.21e-007,5.25e-007,5.3e-007,5.34e-007,5.39e-007,5.44e-007,5.49e-007,5.53e-007,5.58e-007,5.63e-007,5.69e-007,5.74e-007,5.79e-007,5.85e-007,5.9e-007,5.96e-007,6.02e-007,6.08e-007,6.14e-007,6.2e-007,6.26e-007,6.32e-007,6.39e-007,6.46e-007,6.52e-007,6.59e-007,6.66e-007,6.74e-007,6.81e-007,6.89e-007,6.96e-007,7.04e-007,7.12e-007,7.21e-007,7.29e-007,7.38e-007,7.47e-007,7.56e-007,7.65e-007,7.75e-007,7.85e-007,7.95e-007,8.05e-007,8.16e-007,8.26e-007,8.38e-007,8.49e-007,8.61e-007,8.73e-007,8.85e-007,8.98e-007,9.12e-007,9.25e-007,9.39e-007,9.54e-007,9.68e-007,9.84e-007,1e-006,1.016e-006,1.033e-006,1.051e-006,1.069e-006,1.087e-006,1.107e-006,1.127e-006,1.148e-006,1.169e-006,1.192e-006,1.215e-006,1.24e-006,1.265e-006,1.291e-006,1.319e-006,1.347e-006,1.377e-006,1.409e-006,1.441e-006,1.476e-006,1.512e-006,1.55e-006,1.589e-006,1.631e-006,1.675e-006])
+            re_eps_data = np.array([14.64947,15.00304,15.35015,15.6933,16.03423,16.3741,16.71375,17.0538,17.39488,17.73778,18.08364,18.43413,18.7916,19.15935,19.54175,19.94437,20.37421,20.84009,21.25398,21.93482,22.61654,23.46292,24.58865,26.17564,28.44932,31.56288,35.39683,39.43012,42.89018,45.14623,46.01252,47.71726,44.6525,43.16604,41.49542,39.78669,38.12726,36.56792,35.1351,33.83825,32.67491,31.63452,30.70195,29.86039,29.09379,28.38838,27.73337,27.12064,26.54423,25.9997,25.48364,24.99333,24.52659,24.08159,23.65679,23.25086,22.86266,22.49115,22.13544,21.7947,21.46823,21.15532,20.85532,20.56762,20.29165,20.02687,19.77257,19.5288,19.29454,19.06947,18.85316,18.64519,18.44514,18.25261,18.06721,17.88853,17.71621,17.54991,17.38925,17.23393,17.08365,16.93813,16.79708,16.66031,16.52765,16.39887,16.27378,16.15224,16.03405,15.91908,15.80718,15.69824,15.59212,15.48873,15.38794,15.28968,15.19384,15.10034,15.0091,14.92004,14.83308,14.74816,14.66521,14.58417,14.50499,14.42761,14.35198,14.27805,14.20577,14.13509,14.06597,13.99836,13.93224,13.86756,13.80427,13.74235,13.68177,13.62248,13.56447,13.5077,13.45214,13.39777,13.34457,13.29251,13.24157,13.19172,13.14295,13.09524,13.04857,13.00292,12.95828,12.91463,12.87196,12.83026,12.78952,12.74972,12.71086,12.67294,12.63595,12.59991,12.56479,12.53059,12.49731,12.4649,12.43336,12.40265,12.37275,12.34365,12.31533,12.28776,12.26095,12.23486,12.2095,12.18484,12.16089,12.13761,12.11502,12.09308,12.07181,12.05119])
+            im_eps_data = np.array([34.92782,34.51213,34.13324,33.78708,33.47041,33.18077,32.91648,32.67671,32.46141,32.27137,32.10813,31.97408,31.87234,31.80682,31.78222,31.80412,31.87942,32.01732,32.23106,32.54051,32.9739,33.56477,34.33495,35.24919,36.13536,36.61217,36.1389,34.27005,30.97944,26.74359,22.27232,18.14163,14.63067,11.78282,9.53092,7.77882,6.43242,5.40737,4.63036,4.0391,3.58228,3.21932,2.91991,2.66298,2.43518,2.22883,2.03987,1.86617,1.70647,1.55986,1.42552,1.3027,1.19066,1.08869,0.99612,0.91228,0.83654,0.76829,0.70694,0.65194,0.60275,0.55885,0.51976,0.48502,0.4542,0.42686,0.40264,0.38115,0.36208,0.34509,0.32989,0.31623,0.30386,0.29257,0.28215,0.27244,0.26331,0.25462,0.24628,0.23822,0.23038,0.22272,0.21525,0.20787,0.20064,0.19355,0.18659,0.17976,0.17305,0.16647,0.16002,0.1537,0.1475,0.14143,0.13549,0.12968,0.124,0.11844,0.11301,0.10771,0.10254,0.09749,0.09257,0.08778,0.08312,0.07859,0.07418,0.0699,0.06575,0.06173,0.05783,0.05406,0.05042,0.04691,0.04352,0.04027,0.03714,0.03413,0.03126,0.02851,0.0259,0.0234,0.02104,0.01881,0.0167,0.01427,0.01287,0.01114,0.00954,0.00808,0.00673,0.00552,0.00443,0.00348,0.00265,0.00194,0.00136,0.00091,0.00057,0.00033,0.00017,8e-005,4e-005,2e-005,1e-005,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0])
+            eps_data    =  re_eps_data+1j*im_eps_data
+        elif material=='silver_palik':
+            lambda_data = np.array([])
+            lambda_data = np.array([2.988e-007,3.024e-007,3.061e-007,3.1e-007,3.115e-007,3.139e-007,3.155e-007,3.179e-007,3.195e-007,3.22e-007,3.237e-007,3.263e-007,3.306e-007,3.324e-007,3.351e-007,3.397e-007,3.444e-007,3.542e-007,3.647e-007,3.757e-007,3.875e-007,4e-007,4.133e-007,4.275e-007,4.428e-007,4.592e-007,4.769e-007,4.959e-007,5.166e-007,5.391e-007,5.636e-007,5.904e-007,6.199e-007,6.526e-007,6.888e-007,7.293e-007,7.749e-007,8.266e-007,8.856e-007,9.537e-007,1.033e-006,1.127e-006,1.24e-006])
+            n_data      = np.array([1.522,1.496,1.432,1.323,1.246,1.149,1.044,0.932,0.815,0.708,0.616,0.526,0.371,0.321,0.294,0.259,0.238,0.209,0.186,0.2,0.192,0.173,0.173,0.16,0.157,0.144,0.132,0.13,0.13,0.129,0.12,0.121,0.131,0.14,0.14,0.148,0.143,0.145,0.163,0.198,0.226,0.251,0.329])
+            k_data      = np.array([0.992,0.882,0.766,0.647,0.586,0.54,0.514,0.504,0.526,0.565,0.609,0.663,0.813,0.902,0.986,1.12,1.24,1.44,1.61,1.67,1.81,1.95,2.11,2.26,2.4,2.56,2.72,2.88,3.07,3.25,3.45,3.66,3.88,4.15,4.44,4.74,5.09,5.5,5.95,6.43,6.99,7.67,8.49])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='copper_palik':
+            lambda_data = np.array([])
+            lambda_data = np.array([1.907e-007,2.066e-007,2.138e-007,2.114e-007,2.296e-007,2.384e-007,2.48e-007,2.583e-007,2.695e-007,2.818e-007,2.952e-007,3.099e-007,3.263e-007,3.444e-007,3.646e-007,3.874e-007,4.133e-007,4.428e-007,4.768e-007,5.166e-007,5.39e-007,5.635e-007,5.904e-007,6.199e-007,6.525e-007,6.702e-007,6.88e-007,7.084e-007,7.293e-007,8.265e-007,1.24e-006,1.265e-006,1.291e-006,1.319e-006,1.348e-006,1.378e-006,1.409e-006,1.442e-006,1.476e-006,1.512e-006,1.55e-006,1.589e-006,1.631e-006,1.675e-006,1.722e-006,1.771e-006,1.823e-006,1.878e-006,1.937e-006,2e-006,2.066e-006,2.138e-006,2.214e-006,2.296e-006,2.384e-006,2.48e-006,2.583e-006,2.695e-006,2.818e-006,2.952e-006,3.1e-006,3.263e-006,3.444e-006,3.646e-006])
+            n_data      = np.array([0.958,1.04,1.1,1.18,1.28,1.38,1.47,1.53,1.52,1.49,1.42,1.34,1.34,1.31,1.27,1.18,1.18,1.17,1.15,1.12,1.04,0.826,0.468,0.272,0.214,0.215,0.213,0.214,0.223,0.26,0.433,0.496,0.505,0.515,0.525,0.536,0.547,0.559,0.572,0.586,0.606,0.627,0.649,0.672,0.697,0.723,0.752,0.782,0.815,0.85,0.89,0.933,0.98,1.03,1.09,1.15,1.22,1.29,1.37,1.47,1.59,1.73,1.9,2.09])
+            k_data      = np.array([1.37,1.59,1.67,1.74,1.78,1.8,1.78,1.71,1.67,1.64,1.64,1.72,1.81,1.87,1.95,2.21,2.21,2.36,2.5,2.6,2.59,2.6,2.81,3.24,3.67,3.86,4.05,4.24,4.43,5.26,8.46,6.78,6.92,7.06,7.21,7.36,7.53,7.7,7.88,8.06,8.26,8.47,8.69,8.92,9.16,9.41,9.68,9.97,10.3,10.6,11,11.3,11.8,12.2,12.7,13.2,13.7,14.4,15,15.7,16.5,17.4,18.4,19.6])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='alu_palik':
+            lambda_data = np.array([])
+            lambda_data = np.array([1.984e-007,2.066e-007,2.156e-007,2.254e-007,2.362e-007,2.48e-007,2.61e-007,2.755e-007,2.917e-007,3e-007,3.1e-007,3.179e-007,3.263e-007,3.351e-007,3.444e-007,3.5e-007,3.542e-007,3.647e-007,3.757e-007,3.875e-007,4e-007,4.133e-007,4.275e-007,4.428e-007,4.5e-007,4.592e-007,4.769e-007,4.959e-007,5e-007,5.061e-007,5.166e-007,5.276e-007,5.391e-007,5.5e-007,5.51e-007,5.636e-007,5.767e-007,5.904e-007,6e-007,6.048e-007,6.199e-007,6.358e-007,6.5e-007,6.526e-007,6.702e-007,6.888e-007,7e-007,7.085e-007,7.293e-007,7.5e-007,7.514e-007,7.749e-007,7.999e-007,8.25e-007,8.266e-007,8.5e-007,8.551e-007,8.75e-007,8.856e-007,9e-007,9.184e-007,9.25e-007,9.5e-007,9.537e-007,9.919e-007,1e-006,1.033e-006,1.078e-006,1.127e-006,1.181e-006,1.2e-006,1.24e-006,1.305e-006,1.378e-006,1.459e-006,1.5e-006,1.55e-006,1.653e-006,1.771e-006,1.907e-006,2e-006])
+            n_data      = np.array([0.119,0.13,0.141,0.155,0.172,0.19,0.209,0.233,0.261,0.276,0.294,0.31,0.326,0.344,0.364,0.375,0.385,0.407,0.432,0.46,0.49,0.523,0.558,0.598,0.618,0.644,0.695,0.755,0.769,0.789,0.826,0.867,0.912,0.958,0.963,1.02,1.08,1.15,1.2,1.22,1.3,1.39,1.47,1.49,1.6,1.74,1.83,1.91,2.14,2.4,2.41,2.63,2.8,2.75,2.74,2.61,2.58,2.38,2.24,2.06,1.86,1.77,1.49,1.58,1.37,1.35,1.26,1.21,1.2,1.21,1.21,1.21,1.23,1.26,1.33,1.38,1.44,1.59,1.77,1.99,2.15])
+            k_data      = np.array([2.28,2.39,2.51,2.64,2.79,2.94,3.11,3.3,3.51,3.61,3.74,3.84,3.95,4.06,4.17,4.24,4.3,4.43,4.56,4.71,4.86,5.02,5.2,5.38,5.47,5.58,5.8,6.03,6.08,6.15,6.28,6.42,6.55,6.69,6.7,6.85,7,7.15,7.26,7.31,7.48,7.65,7.79,7.82,8.01,8.21,8.31,8.39,8.57,8.62,8.62,8.6,8.45,8.31,8.31,8.22,8.21,8.18,8.21,8.3,8.44,8.49,8.88,8.95,9.49,9.58,10,10.6,11.2,11.8,12,12.5,13.2,14,14.9,15.4,16,17.1,18.3,19.8,20.7])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='gold_johnson':        #P. B. Johnson, and R. W. Christy, "Optical Constants of the Noble Metals," Physical Review B 6, 4370 (1972).
+            lambda_data = np.array([])
+            lambda_data = np.array([188.240595,192.022864,195.651643,199.740825,203.670152,207.757179,212.374005,216.821628,221.854987,226.713126,231.788793,237.550273,243.128753,249.475488,255.635377,262.107158,269.498466,276.701098,284.95136,293.016021,301.550468,311.375421,321.030473,332.189286,343.201086,354.96798,368.661107,382.273209,398.20126,414.12931,431.384698,451.777429,472.390848,496.955172,522.011735,549.729173,583.280718,618.103448,660.844644,705.902233,757.553616,822.773464,893.804266,986.022167,1089.81397,1218.02738,1395.94149,1613.49082,1941.23114])*1e-9
+            n_data      = np.array([1.28,1.32,1.34,1.33,1.33,1.3,1.3,1.3,1.3,1.31,1.3,1.32,1.32,1.33,1.33,1.35,1.38,1.43,1.47,1.49,1.53,1.53,1.54,1.48,1.48,1.5,1.48,1.46,1.47,1.46,1.45,1.39,1.31,1.04,0.62,0.43,0.29,0.21,0.14,0.13,0.14,0.16,0.17,0.22,0.27,0.35,0.43,0.56,0.92])
+            k_data      = np.array([1.188,1.203,1.226,1.251,1.277,1.304,1.35,1.387,1.427,1.46,1.497,1.536,1.577,1.631,1.688,1.749,1.803,1.847,1.869,1.878,1.889,1.893,1.898,1.883,1.871,1.866,1.895,1.933,1.952,1.958,1.948,1.914,1.849,1.833,2.081,2.455,2.863,3.272,3.697,4.103,4.542,5.083,5.663,6.35,7.15,8.145,9.519,11.21,13.78])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='gold_olmon_evap':        #P. B. Johnson, and R. W. Christy, "Optical Constants of the Noble Metals," Physical Review B 6, 4370 (1972).
+            lambda_data = np.array([])
+            lambda_data = 1e-6*np.array([3.000E-01,3.100E-01,3.200E-01,3.300E-01,3.400E-01,3.500E-01,3.600E-01,3.700E-01,3.800E-01,3.900E-01,4.000E-01,4.100E-01,4.200E-01,4.300E-01,4.400E-01,4.50E-01,4.600E-01,4.700E-01,4.800E-01,4.900E-01,5.000E-01,5.100E-01,5.200E-01,5.300E-01,5.400E-01,5.500E-01,5.600E-01,5.700E-01,5.800E-01,5.900E-01,6.000E-01,6.00E-01,6.200E-01,6.300E-01,6.400E-01,6.500E-01,6.600E-01,6.700E-01,6.800E-01,6.900E-01,7.000E-01,7.100E-01,7.200E-01,7.300E-01,7.400E-01,7.500E-01,7.600E-01,.700E-01,7.800E-01,7.900E-01,8.000E-01,8.100E-01,8.200E-01,8.300E-01,8.400E-01,8.500E-01,8.600E-01,8.700E-01,8.800E-01,8.900E-01,9.000E-01,9.100E-01,9.200E-0,9.300E-01,9.400E-01,9.500E-01,9.600E-01,9.700E-01,9.800E-01,9.900E-01,1.000E+00,1.010E+00,1.020E+00,1.030E+00,1.040E+00,1.050E+00,1.060E+00,1.070E+00,1.080E00,1.090E+00,1.100E+00,1.110E+00,1.120E+00,1.130E+00,1.140E+00,1.150E+00,1.160E+00,1.170E+00,1.180E+00,1.190E+00,1.200E+00,1.210E+00,1.220E+00,1.230E+00,1.24E+00,1.250E+00,1.260E+00,1.270E+00,1.280E+00,1.290E+00,1.300E+00,1.310E+00,1.320E+00,1.330E+00,1.340E+00,1.350E+00,1.430E+00,1.440E+00,1.450E+00,1.460E+00,1.70E+00,1.480E+00,1.490E+00,1.500E+00,1.510E+00,1.520E+00,1.530E+00,1.540E+00,1.550E+00,1.560E+00,1.570E+00,1.580E+00,1.590E+00,1.600E+00,1.610E+00,1.620E+00,.630E+00,1.640E+00,1.650E+00,1.660E+00,1.670E+00,1.680E+00,1.690E+00,1.700E+00,1.710E+00,1.720E+00,1.730E+00,1.740E+00,1.750E+00,1.760E+00,1.770E+00,1.780E+0,1.790E+00,1.800E+00,1.810E+00,1.820E+00,1.830E+00,1.840E+00,1.850E+00,1.860E+00,1.870E+00,1.880E+00,1.890E+00,1.900E+00,1.910E+00,1.920E+00,1.930E+00,1.940E00,1.950E+00,1.960E+00,1.970E+00,1.980E+00,1.990E+00,2.000E+00,2.007E+00,2.019E+00,2.025E+00,2.038E+00,2.045E+00,2.058E+00,2.064E+00,2.077E+00,2.084E+00,2.09E+00,2.104E+00,2.118E+00,2.125E+00,2.139E+00,2.146E+00,2.153E+00,2.168E+00,2.175E+00,2.190E+00,2.197E+00,2.205E+00,2.220E+00,2.227E+00,2.235E+00,2.243E+00,2.58E+00,2.266E+00,2.274E+00,2.282E+00,2.298E+00,2.307E+00,2.315E+00,2.323E+00,2.340E+00,2.348E+00,2.357E+00,2.365E+00,2.374E+00,2.383E+00,2.392E+00,2.409E+00,.418E+00,2.427E+00,2.437E+00,2.446E+00,2.455E+00,2.464E+00,2.474E+00,2.483E+00,2.493E+00,2.502E+00,2.512E+00,2.522E+00,2.532E+00,2.542E+00,2.552E+00,2.562E+0,2.572E+00,2.582E+00,2.593E+00,2.603E+00,2.613E+00,2.624E+00,2.635E+00,2.645E+00,2.656E+00,2.667E+00,2.678E+00,2.689E+00,2.701E+00,2.712E+00,2.723E+00,2.735E00,2.746E+00,2.758E+00,2.770E+00,2.782E+00,2.794E+00,2.806E+00,2.818E+00,2.830E+00,2.843E+00,2.855E+00,2.868E+00,2.881E+00,2.893E+00,2.906E+00,2.919E+00,2.93E+00,2.946E+00,2.959E+00,2.973E+00,2.987E+00,3.001E+00,3.015E+00,3.029E+00,3.043E+00,3.057E+00,3.072E+00,3.086E+00,3.101E+00,3.116E+00,3.131E+00,3.146E+00,3.62E+00,3.177E+00,3.193E+00,3.209E+00,3.224E+00,3.241E+00,3.257E+00,3.273E+00,3.290E+00,3.307E+00,3.324E+00,3.341E+00,3.358E+00,3.376E+00,3.393E+00,3.411E+00,.429E+00,3.447E+00,3.466E+00,3.485E+00,3.503E+00,3.522E+00,3.542E+00,3.561E+00,3.581E+00,3.601E+00,3.621E+00,3.641E+00,3.662E+00,3.683E+00,3.704E+00,3.725E+0,3.746E+00,3.768E+00,3.790E+00,3.812E+00,3.835E+00,3.858E+00,3.881E+00,3.904E+00,3.928E+00,3.952E+00,3.976E+00,4.001E+00,4.026E+00,4.051E+00,4.076E+00,4.102E00,4.128E+00,4.155E+00,4.181E+00,4.209E+00,4.236E+00,4.264E+00,4.292E+00,4.321E+00,4.350E+00,4.379E+00,4.409E+00,4.439E+00,4.470E+00,4.501E+00,4.532E+00,4.56E+00,4.597E+00,4.629E+00,4.663E+00,4.697E+00,4.731E+00,4.766E+00,4.801E+00,4.837E+00,4.873E+00,4.910E+00,4.947E+00,4.986E+00,5.024E+00,5.063E+00,5.103E+00,5.44E+00,5.185E+00,5.227E+00,5.269E+00,5.312E+00,5.356E+00,5.401E+00,5.446E+00,5.493E+00,5.539E+00,5.587E+00,5.636E+00,5.685E+00,5.736E+00,5.787E+00,5.839E+00,.892E+00,5.946E+00,6.001E+00,6.057E+00,6.114E+00,6.173E+00,6.232E+00,6.292E+00,6.354E+00,6.417E+00,6.481E+00,6.547E+00,6.613E+00,6.682E+00,6.751E+00,6.822E+0,6.895E+00,6.969E+00,7.045E+00,7.122E+00,7.201E+00,7.282E+00,7.365E+00,7.450E+00,7.536E+00,7.625E+00,7.716E+00,7.809E+00,7.904E+00,8.001E+00,8.101E+00,8.204E00,8.309E+00,8.417E+00,8.528E+00,8.642E+00,8.758E+00,8.878E+00,9.002E+00,9.128E+00,9.259E+00,9.393E+00,9.531E+00,9.673E+00,9.820E+00,9.971E+00,1.013E+01,1.02E+01,1.045E+01,1.063E+01,1.080E+01,1.099E+01,1.117E+01,1.137E+01,1.157E+01,1.178E+01,1.200E+01,1.223E+01,1.246E+01,1.271E+01,1.296E+01,1.323E+01,1.350E+01,1.79E+01,1.409E+01,1.440E+01,1.473E+01,1.507E+01,1.543E+01,1.581E+01,1.620E+01,1.662E+01,1.706E+01,1.752E+01,1.800E+01,1.852E+01,1.906E+01,1.964E+01,2.025E+01,.091E+01,2.160E+01,2.235E+01,2.315E+01,2.400E+01,2.493E+01])
+            n_data =np.array([1.596E+00, 1.649E+00, 1.685E+00, 1.701E+00, 1.695E+00, 1.671E+00, 1.637E+00, 1.606E+00, 1.588E+00, 1.585E+00, 1.588E+00, 1.585E+00, 1.567E+00, 1.537E+00, 1.505E+00, 1.472E+00, 1.422E+00, 1.333E+00, 1.193E+00, 1.011E+00, 8.197E-01, 6.527E-01, 5.263E-01, 4.363E-01, 3.724E-01, 3.256E-01, 2.899E-01, 2.617E-01, 2.388E-01, 2.199E-01, 2.041E-01, 1.908E-01, 1.794E-01, 1.698E-01, 1.616E-01, 1.546E-01, 1.487E-01, 1.436E-01, 1.394E-01, 1.358E-01, 1.328E-01, 1.304E-01, 1.284E-01, 1.268E-01, 1.257E-01, 1.248E-01, 1.242E-01, 1.239E-01, 1.239E-01, 1.240E-01, 1.244E-01, 1.249E-01, 1.256E-01, 1.265E-01, 1.275E-01, 1.286E-01, 1.298E-01, 1.312E-01, 1.326E-01, 1.342E-01, 1.358E-01, 1.375E-01, 1.393E-01, 1.412E-01, 1.431E-01, 1.451E-01, 1.471E-01, 1.493E-01, 1.514E-01, 1.536E-01, 1.559E-01, 1.582E-01, 1.606E-01, 1.630E-01, 1.655E-01, 1.680E-01, 1.705E-01, 1.731E-01, 1.757E-01, 1.783E-01, 1.810E-01, 1.837E-01, 1.865E-01, 1.893E-01, 1.921E-01, 1.949E-01, 1.978E-01, 2.007E-01, 2.036E-01, 2.066E-01, 2.096E-01, 2.126E-01, 2.157E-01, 2.187E-01, 2.218E-01, 2.250E-01, 2.281E-01, 2.313E-01, 2.342E-01, 2.371E-01, 2.400E-01, 2.430E-01, 2.460E-01, 2.490E-01, 2.520E-01, 2.551E-01, 2.824E-01, 2.857E-01, 2.889E-01, 2.922E-01, 2.955E-01, 2.988E-01, 3.021E-01, 3.055E-01, 3.089E-01, 3.123E-01, 3.157E-01, 3.191E-01, 3.226E-01, 3.260E-01, 3.295E-01, 3.331E-01, 3.366E-01, 3.402E-01, 3.437E-01, 3.474E-01, 3.510E-01, 3.546E-01, 3.583E-01, 3.620E-01, 3.657E-01, 3.695E-01, 3.732E-01, 3.770E-01, 3.808E-01, 3.847E-01, 3.885E-01, 3.924E-01, 3.963E-01, 4.003E-01, 4.042E-01, 4.082E-01, 4.123E-01, 4.163E-01, 4.204E-01, 4.245E-01, 4.286E-01, 4.328E-01, 4.369E-01, 4.412E-01, 4.454E-01, 4.497E-01, 4.540E-01, 4.583E-01, 4.627E-01, 4.671E-01, 4.715E-01, 4.760E-01, 4.805E-01, 4.851E-01, 4.896E-01, 4.942E-01, 4.989E-01, 5.031E-01, 5.068E-01, 5.129E-01, 5.160E-01, 5.224E-01, 5.256E-01, 5.321E-01, 5.354E-01, 5.421E-01, 5.455E-01, 5.524E-01, 5.559E-01, 5.630E-01, 5.666E-01, 5.739E-01, 5.776E-01, 5.814E-01, 5.890E-01, 5.929E-01, 6.007E-01, 6.047E-01, 6.087E-01, 6.168E-01, 6.210E-01, 6.252E-01, 6.294E-01, 6.380E-01, 6.423E-01, 6.468E-01, 6.512E-01, 6.603E-01, 6.649E-01, 6.695E-01, 6.742E-01, 6.837E-01, 6.886E-01, 6.935E-01, 6.984E-01, 7.034E-01, 7.085E-01, 7.136E-01, 7.240E-01, 7.293E-01, 7.347E-01, 7.401E-01, 7.455E-01, 7.511E-01, 7.566E-01, 7.623E-01, 7.680E-01, 7.738E-01, 7.797E-01, 7.856E-01, 7.916E-01, 7.976E-01, 8.037E-01, 8.099E-01, 8.162E-01, 8.226E-01, 8.290E-01, 8.355E-01, 8.421E-01, 8.487E-01, 8.554E-01, 8.623E-01, 8.692E-01, 8.761E-01, 8.832E-01, 8.904E-01, 8.976E-01, 9.049E-01, 9.123E-01, 9.199E-01, 9.275E-01, 9.352E-01, 9.430E-01, 9.509E-01, 9.589E-01, 9.670E-01, 9.752E-01, 9.835E-01, 9.919E-01, 1.000E+00, 1.009E+00, 1.018E+00, 1.027E+00, 1.036E+00, 1.045E+00, 1.054E+00, 1.063E+00, 1.073E+00, 1.082E+00, 1.092E+00, 1.102E+00, 1.112E+00, 1.122E+00, 1.132E+00, 1.143E+00, 1.153E+00, 1.164E+00, 1.175E+00, 1.186E+00, 1.197E+00, 1.209E+00, 1.220E+00, 1.232E+00, 1.244E+00, 1.256E+00, 1.268E+00, 1.280E+00, 1.293E+00, 1.305E+00, 1.318E+00, 1.331E+00, 1.345E+00, 1.358E+00, 1.372E+00, 1.386E+00, 1.400E+00, 1.414E+00, 1.429E+00, 1.444E+00, 1.459E+00, 1.474E+00, 1.490E+00, 1.505E+00, 1.521E+00, 1.538E+00, 1.554E+00, 1.571E+00, 1.588E+00, 1.605E+00, 1.623E+00, 1.641E+00, 1.659E+00, 1.678E+00, 1.697E+00, 1.716E+00, 1.735E+00, 1.755E+00, 1.775E+00, 1.796E+00, 1.817E+00, 1.838E+00, 1.859E+00, 1.881E+00, 1.904E+00, 1.927E+00, 1.950E+00, 1.974E+00, 1.998E+00, 2.022E+00, 2.047E+00, 2.072E+00, 2.098E+00, 2.125E+00, 2.152E+00, 2.179E+00, 2.207E+00, 2.235E+00, 2.264E+00, 2.294E+00, 2.324E+00, 2.355E+00, 2.386E+00, 2.418E+00, 2.451E+00, 2.484E+00, 2.518E+00, 2.553E+00, 2.588E+00, 2.624E+00, 2.661E+00, 2.699E+00, 2.737E+00, 2.776E+00, 2.817E+00, 2.858E+00, 2.899E+00, 2.942E+00, 2.986E+00, 3.031E+00, 3.077E+00, 3.123E+00, 3.171E+00, 3.220E+00, 3.270E+00, 3.321E+00, 3.374E+00, 3.427E+00, 3.482E+00, 3.539E+00, 3.596E+00, 3.655E+00, 3.716E+00, 3.778E+00, 3.841E+00, 3.906E+00, 3.973E+00, 4.042E+00, 4.112E+00, 4.184E+00, 4.258E+00, 4.334E+00, 4.412E+00, 4.492E+00, 4.574E+00, 4.658E+00, 4.745E+00, 4.834E+00, 4.926E+00, 5.020E+00, 5.117E+00, 5.216E+00, 5.319E+00, 5.424E+00, 5.533E+00, 5.645E+00, 5.760E+00, 5.879E+00, 6.001E+00, 6.127E+00, 6.258E+00, 6.392E+00, 6.530E+00, 6.673E+00, 6.820E+00, 6.973E+00, 7.130E+00, 7.293E+00, 7.461E+00, 7.634E+00, 7.814E+00, 8.000E+00, 8.193E+00, 8.392E+00, 8.598E+00, 8.812E+00, 9.034E+00, 9.263E+00, 9.502E+00, 9.749E+00, 1.001E+01, 1.027E+01, 1.055E+01, 1.084E+01, 1.114E+01, 1.145E+01, 1.177E+01, 1.211E+01, 1.246E+01, 1.283E+01, 1.321E+01, 1.361E+01, 1.402E+01, 1.446E+01, 1.491E+01, 1.538E+01, 1.588E+01, 1.640E+01, 1.694E+01, 1.751E+01, 1.810E+01, 1.872E+01, 1.938E+01, 2.006E+01, 2.078E+01, 2.154E+01, 2.233E+01, 2.317E+01, 2.404E+01, 2.497E+01, 2.594E+01, 2.697E+01, 2.805E+01, 2.919E+01, 3.039E+01, 3.166E+01, 3.300E+01, 3.441E+01, 3.591E+01, 3.749E+01, 3.916E+01, 4.092E+01, 4.279E+01 ])
+            k_data =np.array([1.888E+00, 1.895E+00, 1.881E+00, 1.858E+00, 1.835E+00, 1.821E+00, 1.825E+00, 1.846E+00, 1.877E+00, 1.904E+00, 1.915E+00, 1.911E+00, 1.898E+00, 1.887E+00, 1.877E+00, 1.855E+00, 1.812E+00, 1.758E+00, 1.716E+00, 1.720E+00, 1.787E+00, 1.908E+00, 2.058E+00, 2.213E+00, 2.364E+00, 2.507E+00, 2.641E+00, 2.769E+00, 2.891E+00, 3.009E+00, 3.122E+00, 3.232E+00, 3.340E+00, 3.444E+00, 3.547E+00, 3.647E+00, 3.746E+00, 3.843E+00, 3.938E+00, 4.033E+00, 4.126E+00, 4.217E+00, 4.308E+00, 4.398E+00, 4.487E+00, 4.575E+00, 4.662E+00, 4.749E+00, 4.834E+00, 4.920E+00, 5.004E+00, 5.088E+00, 5.172E+00, 5.255E+00, 5.338E+00, 5.420E+00, 5.501E+00, 5.583E+00, 5.664E+00, 5.745E+00, 5.825E+00, 5.905E+00, 5.985E+00, 6.064E+00, 6.143E+00, 6.222E+00, 6.301E+00, 6.379E+00, 6.457E+00, 6.535E+00, 6.613E+00, 6.690E+00, 6.768E+00, 6.845E+00, 6.922E+00, 6.999E+00, 7.075E+00, 7.152E+00, 7.228E+00, 7.304E+00, 7.380E+00, 7.456E+00, 7.532E+00, 7.608E+00, 7.683E+00, 7.759E+00, 7.834E+00, 7.909E+00, 7.984E+00, 8.059E+00, 8.134E+00, 8.208E+00, 8.283E+00, 8.358E+00, 8.432E+00, 8.506E+00, 8.581E+00, 8.655E+00, 8.725E+00, 8.795E+00, 8.865E+00, 8.935E+00, 9.005E+00, 9.075E+00, 9.145E+00, 9.214E+00, 9.796E+00, 9.865E+00, 9.934E+00, 1.000E+01, 1.007E+01, 1.014E+01, 1.021E+01, 1.028E+01, 1.035E+01, 1.041E+01, 1.048E+01, 1.055E+01, 1.062E+01, 1.069E+01, 1.076E+01, 1.082E+01, 1.089E+01, 1.096E+01, 1.103E+01, 1.110E+01, 1.116E+01, 1.123E+01, 1.130E+01, 1.137E+01, 1.144E+01, 1.150E+01, 1.157E+01, 1.164E+01, 1.171E+01, 1.177E+01, 1.184E+01, 1.191E+01, 1.198E+01, 1.204E+01, 1.211E+01, 1.218E+01, 1.225E+01, 1.231E+01, 1.238E+01, 1.245E+01, 1.252E+01, 1.258E+01, 1.265E+01, 1.272E+01, 1.278E+01, 1.285E+01, 1.292E+01, 1.299E+01, 1.305E+01, 1.312E+01, 1.319E+01, 1.325E+01, 1.332E+01, 1.339E+01, 1.346E+01, 1.352E+01, 1.359E+01, 1.365E+01, 1.370E+01, 1.379E+01, 1.384E+01, 1.393E+01, 1.397E+01, 1.406E+01, 1.411E+01, 1.420E+01, 1.425E+01, 1.435E+01, 1.439E+01, 1.449E+01, 1.454E+01, 1.464E+01, 1.469E+01, 1.474E+01, 1.484E+01, 1.489E+01, 1.500E+01, 1.505E+01, 1.510E+01, 1.521E+01, 1.526E+01, 1.532E+01, 1.537E+01, 1.548E+01, 1.554E+01, 1.559E+01, 1.565E+01, 1.576E+01, 1.582E+01, 1.588E+01, 1.594E+01, 1.606E+01, 1.611E+01, 1.617E+01, 1.624E+01, 1.630E+01, 1.636E+01, 1.642E+01, 1.654E+01, 1.661E+01, 1.667E+01, 1.673E+01, 1.680E+01, 1.686E+01, 1.693E+01, 1.700E+01, 1.706E+01, 1.713E+01, 1.720E+01, 1.726E+01, 1.733E+01, 1.740E+01, 1.747E+01, 1.754E+01, 1.761E+01, 1.768E+01, 1.775E+01, 1.783E+01, 1.790E+01, 1.797E+01, 1.805E+01, 1.812E+01, 1.820E+01, 1.827E+01, 1.835E+01, 1.843E+01, 1.850E+01, 1.858E+01, 1.866E+01, 1.874E+01, 1.882E+01, 1.890E+01, 1.898E+01, 1.906E+01, 1.915E+01, 1.923E+01, 1.932E+01, 1.940E+01, 1.949E+01, 1.957E+01, 1.966E+01, 1.975E+01, 1.984E+01, 1.993E+01, 2.002E+01, 2.011E+01, 2.020E+01, 2.029E+01, 2.038E+01, 2.048E+01, 2.057E+01, 2.067E+01, 2.077E+01, 2.086E+01, 2.096E+01, 2.106E+01, 2.116E+01, 2.126E+01, 2.137E+01, 2.147E+01, 2.157E+01, 2.168E+01, 2.179E+01, 2.189E+01, 2.200E+01, 2.211E+01, 2.222E+01, 2.233E+01, 2.245E+01, 2.256E+01, 2.267E+01, 2.279E+01, 2.291E+01, 2.302E+01, 2.314E+01, 2.326E+01, 2.339E+01, 2.351E+01, 2.363E+01, 2.376E+01, 2.389E+01, 2.401E+01, 2.414E+01, 2.428E+01, 2.441E+01, 2.454E+01, 2.468E+01, 2.481E+01, 2.495E+01, 2.509E+01, 2.523E+01, 2.538E+01, 2.552E+01, 2.567E+01, 2.581E+01, 2.596E+01, 2.611E+01, 2.627E+01, 2.642E+01, 2.658E+01, 2.673E+01, 2.689E+01, 2.706E+01, 2.722E+01, 2.738E+01, 2.755E+01, 2.772E+01, 2.789E+01, 2.807E+01, 2.824E+01, 2.842E+01, 2.860E+01, 2.878E+01, 2.897E+01, 2.915E+01, 2.934E+01, 2.954E+01, 2.973E+01, 2.993E+01, 3.013E+01, 3.033E+01, 3.053E+01, 3.074E+01, 3.095E+01, 3.116E+01, 3.138E+01, 3.160E+01, 3.182E+01, 3.204E+01, 3.227E+01, 3.250E+01, 3.274E+01, 3.297E+01, 3.321E+01, 3.346E+01, 3.371E+01, 3.396E+01, 3.421E+01, 3.447E+01, 3.473E+01, 3.500E+01, 3.527E+01, 3.555E+01, 3.582E+01, 3.611E+01, 3.640E+01, 3.669E+01, 3.698E+01, 3.729E+01, 3.759E+01, 3.790E+01, 3.822E+01, 3.854E+01, 3.887E+01, 3.920E+01, 3.954E+01, 3.988E+01, 4.023E+01, 4.059E+01, 4.095E+01, 4.132E+01, 4.169E+01, 4.207E+01, 4.246E+01, 4.285E+01, 4.326E+01, 4.367E+01, 4.408E+01, 4.451E+01, 4.494E+01, 4.538E+01, 4.583E+01, 4.629E+01, 4.676E+01, 4.723E+01, 4.772E+01, 4.821E+01, 4.872E+01, 4.924E+01, 4.976E+01, 5.030E+01, 5.085E+01, 5.141E+01, 5.198E+01, 5.257E+01, 5.317E+01, 5.378E+01, 5.440E+01, 5.504E+01, 5.570E+01, 5.637E+01, 5.705E+01, 5.775E+01, 5.847E+01, 5.920E+01, 5.996E+01, 6.073E+01, 6.152E+01, 6.233E+01, 6.316E+01, 6.401E+01, 6.489E+01, 6.578E+01, 6.671E+01, 6.765E+01, 6.863E+01, 6.963E+01, 7.065E+01, 7.171E+01, 7.280E+01, 7.391E+01, 7.507E+01, 7.625E+01, 7.747E+01, 7.873E+01, 8.003E+01, 8.137E+01, 8.276E+01, 8.418E+01, 8.566E+01, 8.718E+01, 8.876E+01, 9.039E+01, 9.208E+01, 9.383E+01, 9.564E+01, 9.752E+01, 9.947E+01, 1.015E+02, 1.036E+02, 1.058E+02, 1.081E+02, 1.104E+02, 1.129E+02, 1.155E+02, 1.182E+02, 1.210E+02, 1.240E+02, 1.271E+02, 1.304E+02, 1.339E+02, 1.375E+02 ])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='chromium_BBM':  #Rakic et al. 1998: Brendel-Bormann model; n,k 0.248-62.0 micron
+            lambda_data = np.array([])
+            lambda_data = 1e-6*np.array([2.4797e-01 ,2.5494e-01 ,2.6212e-01 ,2.6949e-01 ,2.7707e-01 ,2.8487e-01 ,2.9288e-01 ,3.0112e-01 ,3.0960e-01 ,3.1831e-01 ,3.2726e-01 ,3.3647e-01 ,3.4594e-01 ,3.5567e-01 ,3.6568e-01 ,3.7596e-01 ,3.8654e-01 ,3.9742e-01 ,4.0860e-01 ,4.2009e-01 ,4.3191e-01 ,4.4406e-01 ,4.5656e-01 ,4.6940e-01 ,4.8261e-01 ,4.9619e-01 ,5.1015e-01 ,5.2450e-01 ,5.3926e-01 ,5.5443e-01 ,5.7003e-01 ,5.8606e-01 ,6.0255e-01 ,6.1950e-01 ,6.3693e-01 ,6.5485e-01 ,6.7328e-01 ,6.9222e-01 ,7.1170e-01 ,7.3172e-01 ,7.5231e-01 ,7.7347e-01 ,7.9523e-01 ,8.1761e-01 ,8.4061e-01 ,8.6426e-01 ,8.8857e-01 ,9.1357e-01 ,9.3928e-01 ,9.6570e-01 ,9.9287e-01 ,1.0208e+00 ,1.0495e+00 ,1.0791e+00 ,1.1094e+00 ,1.1406e+00 ,1.1727e+00 ,1.2057e+00 ,1.2396e+00 ,1.2745e+00 ,1.3104e+00 ,1.3472e+00 ,1.3851e+00 ,1.4241e+00 ,1.4642e+00 ,1.5054e+00 ,1.5477e+00 ,1.5913e+00 ,1.6360e+00 ,1.6821e+00 ,1.7294e+00 ,1.7780e+00 ,1.8281e+00 ,1.8795e+00 ,1.9324e+00 ,1.9867e+00 ,2.0426e+00 ,2.1001e+00 ,2.1592e+00 ,2.2199e+00 ,2.2824e+00 ,2.3466e+00 ,2.4126e+00 ,2.4805e+00 ,2.5503e+00 ,2.6221e+00 ,2.6958e+00 ,2.7717e+00 ,2.8497e+00 ,2.9298e+00 ,3.0123e+00 ,3.0970e+00 ,3.1841e+00 ,3.2737e+00 ,3.3658e+00 ,3.4605e+00 ,3.5579e+00 ,3.6580e+00 ,3.7609e+00 ,3.8667e+00 ,3.9755e+00 ,4.0873e+00 ,4.2023e+00 ,4.3206e+00 ,4.4421e+00 ,4.5671e+00 ,4.6956e+00 ,4.8277e+00 ,4.9635e+00 ,5.1032e+00 ,5.2468e+00 ,5.3944e+00 ,5.5461e+00 ,5.7022e+00 ,5.8626e+00 ,6.0275e+00 ,6.1971e+00 ,6.3715e+00 ,6.5507e+00 ,6.7350e+00 ,6.9245e+00 ,7.1193e+00 ,7.3196e+00 ,7.5256e+00 ,7.7373e+00 ,7.9550e+00 ,8.1788e+00 ,8.4089e+00 ,8.6455e+00 ,8.8887e+00 ,9.1388e+00 ,9.3959e+00 ,9.6603e+00 ,9.9321e+00 ,1.0212e+01 ,1.0499e+01 ,1.0794e+01 ,1.1098e+01 ,1.1410e+01 ,1.1731e+01 ,1.2061e+01 ,1.2401e+01 ,1.2749e+01 ,1.3108e+01 ,1.3477e+01 ,1.3856e+01 ,1.4246e+01 ,1.4647e+01 ,1.5059e+01 ,1.5482e+01 ,1.5918e+01 ,1.6366e+01 ,1.6826e+01 ,1.7300e+01 ,1.7786e+01 ,1.8287e+01 ,1.8801e+01 ,1.9330e+01 ,1.9874e+01 ,2.0433e+01 ,2.1008e+01 ,2.1599e+01 ,2.2207e+01 ,2.2832e+01 ,2.3474e+01 ,2.4134e+01 ,2.4813e+01 ,2.5512e+01 ,2.6229e+01 ,2.6967e+01 ,2.7726e+01 ,2.8506e+01 ,2.9308e+01 ,3.0133e+01 ,3.0980e+01 ,3.1852e+01 ,3.2748e+01 ,3.3670e+01 ,3.4617e+01 ,3.5591e+01 ,3.6592e+01 ,3.7622e+01 ,3.8680e+01 ,3.9768e+01 ,4.0887e+01 ,4.2038e+01 ,4.3220e+01 ,4.4436e+01 ,4.5686e+01 ,4.6972e+01 ,4.8293e+01 ,4.9652e+01 ,5.1049e+01 ,5.2485e+01 ,5.3962e+01 ,5.5480e+01 ,5.7041e+01 ,5.8646e+01 ,6.0296e+01 ,6.1992e+01 ])
+            n_data =np.array([7.3226e-01, 7.6518e-01, 7.9993e-01, 8.3662e-01, 8.7537e-01, 9.1629e-01, 9.5952e-01, 1.0052e+00, 1.0534e+00, 1.1044e+00, 1.1583e+00, 1.2152e+00, 1.2752e+00, 1.3387e+00, 1.4055e+00, 1.4760e+00, 1.5502e+00, 1.6283e+00, 1.7101e+00, 1.7958e+00, 1.8853e+00, 1.9786e+00, 2.0753e+00, 2.1754e+00, 2.2784e+00, 2.3839e+00, 2.4916e+00, 2.6008e+00, 2.7109e+00, 2.8213e+00, 2.9314e+00, 3.0404e+00, 3.1476e+00, 3.2524e+00, 3.3541e+00, 3.4522e+00, 3.5462e+00, 3.6356e+00, 3.7199e+00, 3.7989e+00, 3.8724e+00, 3.9401e+00, 4.0020e+00, 4.0579e+00, 4.1079e+00, 4.1520e+00, 4.1902e+00, 4.2228e+00, 4.2497e+00, 4.2712e+00, 4.2874e+00, 4.2985e+00, 4.3047e+00, 4.3061e+00, 4.3029e+00, 4.2954e+00, 4.2838e+00, 4.2682e+00, 4.2488e+00, 4.2259e+00, 4.1997e+00, 4.1705e+00, 4.1384e+00, 4.1037e+00, 4.0667e+00, 4.0277e+00, 3.9869e+00, 3.9447e+00, 3.9014e+00, 3.8573e+00, 3.8128e+00, 3.7682e+00, 3.7237e+00, 3.6799e+00, 3.6369e+00, 3.5950e+00, 3.5546e+00, 3.5159e+00, 3.4792e+00, 3.4445e+00, 3.4122e+00, 3.3824e+00, 3.3552e+00, 3.3307e+00, 3.3091e+00, 3.2904e+00, 3.2747e+00, 3.2621e+00, 3.2525e+00, 3.2461e+00, 3.2429e+00, 3.2430e+00, 3.2463e+00, 3.2530e+00, 3.2630e+00, 3.2765e+00, 3.2935e+00, 3.3141e+00, 3.3383e+00, 3.3662e+00, 3.3980e+00, 3.4337e+00, 3.4734e+00, 3.5172e+00, 3.5654e+00, 3.6180e+00, 3.6751e+00, 3.7371e+00, 3.8039e+00, 3.8759e+00, 3.9532e+00, 4.0361e+00, 4.1247e+00, 4.2194e+00, 4.3203e+00, 4.4277e+00, 4.5420e+00, 4.6634e+00, 4.7923e+00, 4.9289e+00, 5.0736e+00, 5.2269e+00, 5.3889e+00, 5.5602e+00, 5.7410e+00, 5.9320e+00, 6.1334e+00, 6.3457e+00, 6.5694e+00, 6.8050e+00, 7.0528e+00, 7.3135e+00, 7.5876e+00, 7.8755e+00, 8.1777e+00, 8.4949e+00, 8.8276e+00, 9.1762e+00, 9.5415e+00, 9.9238e+00, 1.0324e+01, 1.0742e+01, 1.1179e+01, 1.1636e+01, 1.2112e+01, 1.2609e+01, 1.3127e+01, 1.3666e+01, 1.4227e+01, 1.4811e+01, 1.5417e+01, 1.6047e+01, 1.6701e+01, 1.7378e+01, 1.8080e+01, 1.8807e+01, 1.9559e+01, 2.0337e+01, 2.1139e+01, 2.1968e+01, 2.2822e+01, 2.3702e+01, 2.4609e+01, 2.5541e+01, 2.6499e+01, 2.7482e+01, 2.8492e+01, 2.9527e+01, 3.0588e+01, 3.1673e+01, 3.2784e+01, 3.3919e+01, 3.5078e+01, 3.6262e+01, 3.7469e+01, 3.8699e+01, 3.9952e+01, 4.1228e+01, 4.2526e+01, 4.3845e+01, 4.5186e+01, 4.6547e+01, 4.7929e+01, 4.9331e+01, 5.0752e+01, 5.2193e+01, 5.3652e+01, 5.5130e+01, 5.6626e+01, 5.8140e+01, 5.9672e+01, 6.1221e+01, 6.2787e+01, 6.4370e+01, 6.5970e+01, 6.7586e+01, 6.9219e+01, 7.0868e+01, 7.2533e+01, 7.4214e+01 ])
+            k_data =np.array([2.3139e+00, 2.3811e+00, 2.4494e+00, 2.5186e+00, 2.5888e+00, 2.6600e+00, 2.7320e+00, 2.8049e+00, 2.8786e+00, 2.9529e+00, 3.0279e+00, 3.1032e+00, 3.1788e+00, 3.2545e+00, 3.3301e+00, 3.4052e+00, 3.4797e+00, 3.5531e+00, 3.6251e+00, 3.6954e+00, 3.7635e+00, 3.8289e+00, 3.8913e+00, 3.9501e+00, 4.0048e+00, 4.0552e+00, 4.1009e+00, 4.1414e+00, 4.1766e+00, 4.2063e+00, 4.2305e+00, 4.2492e+00, 4.2625e+00, 4.2706e+00, 4.2739e+00, 4.2727e+00, 4.2674e+00, 4.2586e+00, 4.2468e+00, 4.2326e+00, 4.2165e+00, 4.1991e+00, 4.1810e+00, 4.1628e+00, 4.1450e+00, 4.1281e+00, 4.1127e+00, 4.0992e+00, 4.0880e+00, 4.0797e+00, 4.0745e+00, 4.0728e+00, 4.0750e+00, 4.0815e+00, 4.0925e+00, 4.1083e+00, 4.1293e+00, 4.1557e+00, 4.1878e+00, 4.2259e+00, 4.2702e+00, 4.3210e+00, 4.3785e+00, 4.4430e+00, 4.5147e+00, 4.5939e+00, 4.6807e+00, 4.7754e+00, 4.8781e+00, 4.9890e+00, 5.1081e+00, 5.2357e+00, 5.3717e+00, 5.5161e+00, 5.6691e+00, 5.8307e+00, 6.0007e+00, 6.1791e+00, 6.3659e+00, 6.5611e+00, 6.7645e+00, 6.9761e+00, 7.1959e+00, 7.4238e+00, 7.6597e+00, 7.9037e+00, 8.1557e+00, 8.4158e+00, 8.6839e+00, 8.9601e+00, 9.2444e+00, 9.5370e+00, 9.8379e+00, 1.0147e+01, 1.0465e+01, 1.0791e+01, 1.1127e+01, 1.1471e+01, 1.1824e+01, 1.2187e+01, 1.2559e+01, 1.2940e+01, 1.3332e+01, 1.3733e+01, 1.4145e+01, 1.4567e+01, 1.5000e+01, 1.5444e+01, 1.5899e+01, 1.6365e+01, 1.6843e+01, 1.7333e+01, 1.7835e+01, 1.8349e+01, 1.8876e+01, 1.9415e+01, 1.9968e+01, 2.0534e+01, 2.1113e+01, 2.1707e+01, 2.2314e+01, 2.2935e+01, 2.3571e+01, 2.4221e+01, 2.4886e+01, 2.5567e+01, 2.6262e+01, 2.6973e+01, 2.7699e+01, 2.8440e+01, 2.9198e+01, 2.9971e+01, 3.0761e+01, 3.1566e+01, 3.2388e+01, 3.3225e+01, 3.4079e+01, 3.4949e+01, 3.5835e+01, 3.6737e+01, 3.7654e+01, 3.8588e+01, 3.9537e+01, 4.0502e+01, 4.1482e+01, 4.2477e+01, 4.3487e+01, 4.4512e+01, 4.5550e+01, 4.6603e+01, 4.7669e+01, 4.8748e+01, 4.9840e+01, 5.0944e+01, 5.2060e+01, 5.3187e+01, 5.4325e+01, 5.5474e+01, 5.6632e+01, 5.7800e+01, 5.8976e+01, 6.0161e+01, 6.1354e+01, 6.2554e+01, 6.3761e+01, 6.4974e+01, 6.6193e+01, 6.7418e+01, 6.8647e+01, 6.9881e+01, 7.1119e+01, 7.2362e+01, 7.3607e+01, 7.4857e+01, 7.6109e+01, 7.7364e+01, 7.8622e+01, 7.9883e+01, 8.1146e+01, 8.2412e+01, 8.3681e+01, 8.4952e+01, 8.6226e+01, 8.7503e+01, 8.8783e+01, 9.0067e+01, 9.1354e+01, 9.2645e+01, 9.3940e+01, 9.5240e+01, 9.6544e+01, 9.7854e+01, 9.9170e+01, 1.0049e+02, 1.0182e+02, 1.0316e+02, 1.0450e+02, 1.0585e+02, 1.0721e+02, 1.0858e+02 ])
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='solar_etr':               # Wvlgth nm,Etr W*m-2*nm-1,Global tilt  W*m-2*nm-1,Direct+circumsolar W*m-2*nm-1
+            lambda_data = np.array([])
+            lambda_data = 1e-9*np.array([280,280.5,281,281.5,282,282.5,283,283.5,284,284.5,285,285.5,286,286.5,287,287.5,288,288.5,289,289.5,290,290.5,291,291.5,292,292.5,293,293.5,294,294.5,295,295.5,296,296.5,297,297.5,298,298.5,299,299.5,300,300.5,301,301.5,302,302.5,303,303.5,304,304.5,305,305.5,306,306.5,307,307.5,308,308.5,309,309.5,310,310.5,311,311.5,312,312.5,313,313.5,314,314.5,315,315.5,316,316.5,317,317.5,318,318.5,319,319.5,320,320.5,321,321.5,322,322.5,323,323.5,324,324.5,325,325.5,326,326.5,327,327.5,328,328.5,329,329.5,330,330.5,331,331.5,332,332.5,333,333.5,334,334.5,335,335.5,336,336.5,337,337.5,338,338.5,339,339.5,340,340.5,341,341.5,342,342.5,343,343.5,344,344.5,345,345.5,346,346.5,347,347.5,348,348.5,349,349.5,350,350.5,351,351.5,352,352.5,353,353.5,354,354.5,355,355.5,356,356.5,357,357.5,358,358.5,359,359.5,360,360.5,361,361.5,362,362.5,363,363.5,364,364.5,365,365.5,366,366.5,367,367.5,368,368.5,369,369.5,370,370.5,371,371.5,372,372.5,373,373.5,374,374.5,375,375.5,376,376.5,377,377.5,378,378.5,379,379.5,380,380.5,381,381.5,382,382.5,383,383.5,384,384.5,385,385.5,386,386.5,387,387.5,388,388.5,389,389.5,390,390.5,391,391.5,392,392.5,393,393.5,394,394.5,395,395.5,396,396.5,397,397.5,398,398.5,399,399.5,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200])
+            eps_data    = np.array([0.082,0.099,0.15,0.212,0.267,0.303,0.325,0.323,0.299,0.25024,0.17589,0.155,0.242,0.333,0.362,0.339,0.311,0.325,0.392,0.479,0.563,0.606,0.618,0.598,0.567,0.529,0.538,0.549,0.533,0.52,0.527,0.559,0.573,0.521,0.478,0.529,0.528,0.468,0.472,0.501,0.45794,0.433,0.463,0.47756,0.449,0.508,0.612,0.646,0.621,0.626,0.642,0.611,0.565,0.575,0.605,0.631,0.645,0.6405,0.58,0.5,0.533,0.652,0.762,0.744,0.70615,0.676,0.694,0.724,0.717,0.676,0.6845,0.632,0.587,0.649,0.739,0.80189,0.72361,0.68,0.7058,0.73318,0.775,0.826,0.76546,0.719,0.73513,0.71152,0.649,0.68138,0.7405,0.788,0.82918,0.91377,0.99835,1.0166,1.0047,0.98679,0.95681,0.934,1.0046,1.0958,1.1098,1.0429,0.991,0.99396,0.99277,0.98003,0.96394,0.937,0.95557,0.98862,1.0097,0.97453,0.88979,0.829,0.818,0.87732,0.92529,0.95783,0.96863,0.989,1.0544,1.0463,0.971,0.959,0.9957,1.0277,1.0417,0.98301,0.85416,0.813,0.91583,0.97021,0.94269,0.95594,0.96954,0.93318,0.92472,0.93721,0.899,0.91969,1.0122,1.0849,1.0534,1.0129,0.98383,0.926,0.98012,1.0752,1.1346,1.144,1.1406,1.0964,1.025,0.95914,0.842,0.85015,0.78916,0.731,0.85805,1.0321,1.089,1.0265,0.9415,0.918,0.958,1.045,1.071,1.038,1.0716,1.059,1.097,1.2041,1.286,1.2843,1.2577,1.2317,1.157,1.1459,1.1944,1.2795,1.2934,1.166,1.1811,1.2249,1.1444,1.0876,1.0445,0.939,0.93442,0.925,0.985,1.0874,1.124,1.104,1.1813,1.3149,1.4144,1.3765,1.226,1.098,1.152,1.231,1.249,1.1224,0.95426,0.82313,0.73603,0.71095,0.821,0.9862,1.0802,1.0296,0.99113,1.0279,1.0354,1.0186,1.0067,0.99743,1.081,1.1958,1.2519,1.2601,1.3322,1.349,1.24,1.0312,0.745,0.5912,0.76675,1.0557,1.245,1.3245,1.1626,0.8433,0.652,0.96142,1.301,1.5342,1.6245,1.6717,1.6885,1.752,1.814,1.74,1.763,1.715,1.666,1.63,1.699,1.809,1.537,1.715,1.816,1.7392,1.7144,1.7688,1.815,1.766,1.685,1.749,1.599,1.811,1.782,1.721,1.708,1.755,1.699,1.638,1.651,1.523,1.212,1.099,1.822,1.6913,1.56,1.709,1.868,1.9,1.663,1.601,1.83,1.799,1.922,1.949,1.8941,1.965,1.7557,1.99,2.014,2.001,2.069,2.142,2.047,1.8864,2.018,2.001,2.063,2.077,2.032,2.012,1.9973,2.0639,2.078,2.084,2.015,1.984,2.021,1.931,2.012,2.018,1.939,1.969,2.07,1.9882,2.012,2.08,2.012,2.025,2.086,2.04,2.068,2.061,2.0623,2.031,1.989,1.979,1.601,1.789,1.935,1.8224,2.032,1.949,1.856,1.983,1.9339,2.051,1.949,1.98,1.924,1.923,1.916,1.858,1.86,1.949,1.833,1.9472,2.025,1.9354,1.88,1.965,1.91,1.941,1.989,1.866,1.824,1.875,1.891,1.539,1.759,1.704,1.86,1.873,1.915,1.804,1.941,1.928,1.874,1.641,1.88,1.969,1.892,1.995,1.958,1.747,1.869,1.895,1.974,1.824,1.913,1.864,1.8,1.734,1.888,1.851,1.919,1.874,1.8609,1.882,1.826,1.88,1.863,1.859,1.896,1.842,1.878,1.889,1.857,1.812,1.853,1.755,1.786,1.89,1.801,1.871,1.836,1.849,1.75,1.868,1.859,1.831,1.828,1.762,1.872,1.881,1.873,1.834,1.818,1.862,1.799,1.816,1.834,1.833,1.852,1.863,1.854,1.836,1.792,1.838,1.821,1.624,1.7218,1.809,1.788,1.792,1.789,1.778,1.796,1.806,1.772,1.764,1.77,1.742,1.715,1.749,1.779,1.773,1.758,1.762,1.751,1.734,1.724,1.712,1.736,1.71,1.655,1.712,1.664,1.641,1.702,1.709,1.711,1.724,1.6784,1.682,1.667,1.644,1.64,1.693,1.693,1.687,1.665,1.659,1.5901,1.674,1.637,1.652,1.6093,1.661,1.665,1.653,1.613,1.61,1.609,1.625,1.614,1.627,1.591,1.606,1.602,1.551,1.526,1.613,1.591,1.598,1.575,1.523,1.3233,1.384,1.539,1.542,1.558,1.566,1.571,1.563,1.554,1.567,1.555,1.5354,1.5348,1.558,1.534,1.529,1.506,1.517,1.513,1.499,1.515,1.5,1.507,1.493,1.494,1.487,1.493,1.476,1.466,1.465,1.433,1.472,1.476,1.478,1.479,1.468,1.454,1.458,1.457,1.435,1.442,1.438,1.417,1.434,1.422,1.4131,1.3987,1.4095,1.4187,1.433,1.4138,1.404,1.399,1.39,1.404,1.397,1.3818,1.3702,1.3819,1.3502,1.3694,1.365,1.357,1.301,1.3487,1.348,1.36,1.351,1.3607,1.3465,1.3429,1.3444,1.337,1.2796,1.3357,1.3104,1.3333,1.3108,1.339,1.3271,1.31,1.312,1.3,1.2646,1.283,1.2707,1.2649,1.2892,1.2955,1.292,1.2892,1.289,1.2808,1.276,1.274,1.268,1.272,1.265,1.2809,1.2771,1.261,1.2598,1.268,1.25,1.259,1.2487,1.246,1.2543,1.2566,1.2452,1.2,1.212,1.231,1.2142,1.2146,1.2073,1.212,1.21,1.209,1.208,1.2102,1.2028,1.2014,1.2067,1.193,1.1898,1.195,1.1896,1.181,1.1874,1.189,1.1877,1.18,1.1812,1.1704,1.1632,1.15,1.1449,1.126,1.128,1.1427,1.158,1.1501,1.135,1.1248,1.1427,1.1422,1.1241,1.1342,1.1001,1.1309,1.123,1.1162,1.098,1.11,1.1143,1.116,1.118,1.1174,1.1091,1.105,1.1083,1.0861,1.0738,1.074,1.076,1.056,1.076,1.0715,1.0699,1.0759,1.0762,1.0749,1.062,1.0563,1.056,1.055,1.0327,1.0459,1.0476,1.0597,1.0511,1.0549,1.04,1.05,1.052,1.0287,1.0271,1.014,1.036,1.037,1.006,1.011,1.005,0.91,0.998,0.99,0.981,0.869,0.927,0.99017,1.0056,1.007,1.005,1,0.999,1.006,1.012,0.99006,0.97354,0.858,0.925,0.969,0.959,0.977,0.96317,0.976,0.96614,0.94913,0.93562,0.962,0.965,0.962,0.94571,0.94856,0.91963,0.94408,0.9393,0.94352,0.95469,0.92558,0.923,0.94066,0.94367,0.94236,0.93928,0.93259,0.918,0.924,0.926,0.93425,0.92686,0.92378,0.91396,0.91378,0.89834,0.8772,0.92233,0.921,0.918,0.9078,0.9145,0.90143,0.88552,0.89496,0.8973,0.89016,0.9002,0.8982,0.8883,0.8947,0.8886,0.8881,0.8921,0.8854,0.8703,0.8628,0.83335,0.86957,0.87642,0.84561,0.87809,0.8711,0.86954,0.86866,0.87078,0.86514,0.86958,0.86709,0.85601,0.85222,0.85368,0.85936,0.85676,0.84,0.83153,0.80616,0.83814,0.81854,0.82441,0.83138,0.82809,0.83137,0.83303,0.82867,0.82019,0.82402,0.8205,0.812,0.769,0.802,0.80583,0.81147,0.81483,0.80627,0.79982,0.80173,0.79761,0.78808,0.79579,0.78598,0.79503,0.78526,0.78789,0.7914,0.78186,0.78785,0.78149,0.76882,0.77348,0.78054,0.77208,0.778,0.7665,0.77512,0.773,0.77879,0.77541,0.76881,0.77081,0.7662,0.76606,0.76368,0.755,0.75694,0.76161,0.75714,0.75639,0.75851,0.75392,0.75347,0.743,0.743,0.742,0.74255,0.74741,0.74677,0.73836,0.73133,0.68365,0.7177,0.73093,0.73339,0.72934,0.73055,0.72562,0.72496,0.7196,0.72265,0.71062,0.71419,0.70659,0.71566,0.69606,0.70127,0.703,0.693,0.699,0.70057,0.69918,0.69943,0.69594,0.69722,0.69,0.69208,0.68985,0.6896,0.678,0.68181,0.684,0.68431,0.67731,0.674,0.679,0.6744,0.6749,0.67516,0.6686,0.67199,0.66846,0.65131,0.66155,0.66781,0.66491,0.66117,0.66182,0.65848,0.65698,0.65474,0.65753,0.65629,0.6554,0.64937,0.63046,0.64831,0.63387,0.64651,0.63669,0.64621,0.64533,0.63139,0.63517,0.63591,0.60084,0.62165,0.62821,0.63131,0.61796,0.63063,0.61768,0.62468,0.62426,0.62531,0.61203,0.6225,0.60726,0.60249,0.609,0.61392,0.61181,0.6157,0.59145,0.60728,0.60908,0.60442,0.60799,0.59692,0.59221,0.56065,0.58252,0.586,0.591,0.587,0.58216,0.6,0.599,0.58202,0.595,0.593,0.591,0.59,0.586,0.5865,0.5855,0.587,0.5825,0.58342,0.578,0.584,0.582,0.575,0.583,0.57222,0.57151,0.5685,0.572,0.575,0.574,0.5725,0.57012,0.553,0.56179,0.56829,0.56837,0.56401,0.568,0.57,0.56186,0.56346,0.5625,0.56481,0.55197,0.544,0.553,0.55573,0.54303,0.55531,0.5496,0.54501,0.55001,0.55407,0.55408,0.55032,0.54788,0.54623,0.54531,0.5417,0.54308,0.54651,0.54731,0.54022,0.5437,0.54334,0.53548,0.52928,0.51899,0.53336,0.53708,0.52684,0.53482,0.52227,0.52984,0.53415,0.5164,0.52875,0.53074,0.53063,0.52686,0.5276,0.51852,0.51036,0.52296,0.51703,0.51504,0.52199,0.51843,0.51743,0.48821,0.51098,0.51605,0.51519,0.51455,0.51012,0.48402,0.50583,0.51354,0.51175,0.51064,0.51127,0.50592,0.50561,0.50286,0.49217,0.47434,0.50005])
+        elif material=='solar_global_tilt':               # Wvlgth nm,Etr W*m-2*nm-1,Global tilt  W*m-2*nm-1,Direct+circumsolar W*m-2*nm-1
+            lambda_data = np.array([])
+            lambda_data = 1e-9*np.array([280,280.5,281,281.5,282,282.5,283,283.5,284,284.5,285,285.5,286,286.5,287,287.5,288,288.5,289,289.5,290,290.5,291,291.5,292,292.5,293,293.5,294,294.5,295,295.5,296,296.5,297,297.5,298,298.5,299,299.5,300,300.5,301,301.5,302,302.5,303,303.5,304,304.5,305,305.5,306,306.5,307,307.5,308,308.5,309,309.5,310,310.5,311,311.5,312,312.5,313,313.5,314,314.5,315,315.5,316,316.5,317,317.5,318,318.5,319,319.5,320,320.5,321,321.5,322,322.5,323,323.5,324,324.5,325,325.5,326,326.5,327,327.5,328,328.5,329,329.5,330,330.5,331,331.5,332,332.5,333,333.5,334,334.5,335,335.5,336,336.5,337,337.5,338,338.5,339,339.5,340,340.5,341,341.5,342,342.5,343,343.5,344,344.5,345,345.5,346,346.5,347,347.5,348,348.5,349,349.5,350,350.5,351,351.5,352,352.5,353,353.5,354,354.5,355,355.5,356,356.5,357,357.5,358,358.5,359,359.5,360,360.5,361,361.5,362,362.5,363,363.5,364,364.5,365,365.5,366,366.5,367,367.5,368,368.5,369,369.5,370,370.5,371,371.5,372,372.5,373,373.5,374,374.5,375,375.5,376,376.5,377,377.5,378,378.5,379,379.5,380,380.5,381,381.5,382,382.5,383,383.5,384,384.5,385,385.5,386,386.5,387,387.5,388,388.5,389,389.5,390,390.5,391,391.5,392,392.5,393,393.5,394,394.5,395,395.5,396,396.5,397,397.5,398,398.5,399,399.5,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200])
+            eps_data    = np.array([4.7309e-023,1.2307e-021,5.6895e-021,1.5662e-019,1.1946e-018,4.5436e-018,1.8452e-017,3.536e-017,7.267e-016,2.4856e-015,8.0142e-015,4.2613e-014,1.3684e-013,8.3823e-013,2.7367e-012,1.0903e-011,6.2337e-011,1.7162e-010,5.6265e-010,2.0749e-009,6.0168e-009,1.3783e-008,3.5052e-008,1.0913e-007,2.683e-007,4.2685e-007,8.6466e-007,2.2707e-006,4.1744e-006,6.5911e-006,1.229e-005,2.7826e-005,4.7904e-005,7.1345e-005,9.68e-005,0.00018608,0.00028988,0.00035789,0.00049211,0.00086068,0.0010205,0.001245,0.00193,0.0026914,0.0029209,0.004284,0.0070945,0.0089795,0.0094701,0.011953,0.016463,0.018719,0.018577,0.021108,0.027849,0.035635,0.037837,0.04143,0.040534,0.043306,0.050939,0.06554,0.082922,0.08408,0.093376,0.098984,0.10733,0.10757,0.11969,0.1306,0.13625,0.11838,0.12348,0.15036,0.17158,0.18245,0.17594,0.18591,0.2047,0.19589,0.20527,0.24525,0.25024,0.23843,0.22203,0.21709,0.21226,0.24861,0.27537,0.28321,0.27894,0.32436,0.3812,0.40722,0.39806,0.38465,0.35116,0.37164,0.42235,0.46878,0.47139,0.428,0.40262,0.41806,0.43623,0.43919,0.42944,0.40724,0.41497,0.44509,0.46388,0.45313,0.41519,0.38214,0.3738,0.40051,0.43411,0.45527,0.46355,0.47446,0.5018,0.50071,0.47139,0.46935,0.48934,0.50767,0.51489,0.48609,0.41843,0.40307,0.45898,0.48932,0.47778,0.48657,0.49404,0.47674,0.47511,0.48336,0.46564,0.47805,0.52798,0.56741,0.55172,0.53022,0.51791,0.48962,0.5204,0.57228,0.60498,0.61156,0.6114,0.59028,0.55387,0.51942,0.45673,0.46215,0.43006,0.39926,0.46953,0.56549,0.59817,0.56531,0.52024,0.50956,0.5342,0.5851,0.60191,0.58541,0.60628,0.60058,0.62359,0.68628,0.73532,0.73658,0.72285,0.70914,0.66759,0.6631,0.69315,0.74469,0.75507,0.68261,0.69338,0.72051,0.67444,0.64253,0.61886,0.55786,0.5564,0.55227,0.5893,0.65162,0.6748,0.6639,0.71225,0.79455,0.85595,0.83418,0.74389,0.66683,0.70077,0.75075,0.76383,0.68837,0.58678,0.50762,0.45499,0.44049,0.50968,0.61359,0.67355,0.64363,0.621,0.6457,0.65147,0.64204,0.63582,0.63136,0.68543,0.7597,0.79699,0.80371,0.85138,0.86344,0.79493,0.66257,0.47975,0.38152,0.49567,0.68385,0.80772,0.86038,0.75655,0.55017,0.42619,0.62945,0.85249,1.0069,1.0693,1.1021,1.1141,1.1603,1.2061,1.1613,1.1801,1.1511,1.1227,1.1026,1.1514,1.2299,1.0485,1.1738,1.2478,1.1971,1.1842,1.2258,1.2624,1.2312,1.1777,1.2258,1.1232,1.2757,1.2583,1.2184,1.2117,1.2488,1.2135,1.1724,1.1839,1.0963,0.87462,0.79394,1.3207,1.2288,1.1352,1.2452,1.3659,1.3943,1.2238,1.1775,1.3499,1.3313,1.425,1.4453,1.4084,1.4619,1.3108,1.4903,1.5081,1.5045,1.5595,1.6173,1.5482,1.4297,1.5335,1.5224,1.5724,1.5854,1.5514,1.5391,1.5291,1.5827,1.5975,1.6031,1.5544,1.535,1.5673,1.4973,1.5619,1.5682,1.5077,1.5331,1.6126,1.5499,1.5671,1.6185,1.5631,1.5724,1.623,1.5916,1.6181,1.6177,1.6236,1.6038,1.5734,1.5683,1.2716,1.4241,1.5413,1.4519,1.6224,1.5595,1.4869,1.5903,1.5525,1.6485,1.5676,1.5944,1.5509,1.5507,1.5451,1.4978,1.4966,1.5653,1.4587,1.5635,1.6264,1.556,1.5165,1.5893,1.5481,1.5769,1.6186,1.5206,1.4885,1.5314,1.5455,1.2594,1.4403,1.3957,1.5236,1.5346,1.569,1.4789,1.5905,1.5781,1.5341,1.3417,1.5357,1.6071,1.5446,1.6292,1.5998,1.4286,1.5302,1.5535,1.6199,1.4989,1.5738,1.5352,1.4825,1.4251,1.5511,1.5256,1.5792,1.5435,1.5291,1.549,1.5049,1.552,1.5399,1.5382,1.5697,1.525,1.5549,1.5634,1.5366,1.4988,1.531,1.4483,1.474,1.5595,1.4847,1.5408,1.5106,1.5201,1.4374,1.532,1.518,1.4807,1.4816,1.4331,1.5134,1.5198,1.5119,1.4777,1.4654,1.5023,1.456,1.477,1.502,1.5089,1.532,1.5479,1.5448,1.5324,1.4953,1.5281,1.4934,1.2894,1.3709,1.4662,1.4354,1.4561,1.4491,1.4308,1.4745,1.4788,1.4607,1.4606,1.4753,1.4579,1.436,1.4664,1.4921,1.4895,1.4822,1.4911,1.4862,1.4749,1.4686,1.4611,1.4831,1.4621,1.4176,1.4697,1.431,1.4128,1.4664,1.4733,1.4739,1.4802,1.4269,1.4165,1.4118,1.4026,1.4012,1.4417,1.3631,1.4114,1.3924,1.4161,1.3638,1.4508,1.4284,1.4458,1.4128,1.461,1.4707,1.4646,1.434,1.4348,1.4376,1.4525,1.4462,1.4567,1.415,1.4086,1.3952,1.3519,1.3594,1.4447,1.3871,1.4311,1.4153,1.3499,1.1851,1.2393,1.3855,1.3905,1.3992,1.3933,1.3819,1.3844,1.3967,1.4214,1.4203,1.4102,1.415,1.4394,1.4196,1.4169,1.3972,1.4094,1.4074,1.3958,1.412,1.3991,1.4066,1.3947,1.3969,1.3915,1.3981,1.383,1.3739,1.3748,1.3438,0.96824,1.1206,1.1278,1.1821,1.2333,1.2689,1.2609,1.2464,1.2714,1.2684,1.3403,1.3192,1.2918,1.2823,1.2659,1.2674,1.2747,1.3078,1.3214,1.3144,1.309,1.3048,1.3095,1.3175,1.3155,1.3071,1.2918,1.3029,1.2587,1.2716,1.1071,1.0296,0.92318,0.9855,1.0861,1.2407,1.1444,1.0555,1.038,1.0813,1.085,1.04,1.0466,1.1285,1.0703,1.1534,1.1962,1.2357,1.2178,1.2059,1.2039,1.2269,1.1905,1.2195,1.2148,1.2153,1.2405,1.2503,1.2497,1.247,1.2477,1.2401,1.2357,1.2341,1.2286,1.233,1.2266,1.242,1.2383,1.2232,1.2221,1.2295,1.1945,0.26604,0.15396,0.68766,0.37952,0.53878,0.68601,0.81461,0.97417,1.1138,1.1278,1.1608,1.1686,1.1778,1.1771,1.1771,1.1771,1.1798,1.1727,1.1713,1.1765,1.1636,1.1607,1.1662,1.1614,1.1536,1.1586,1.1592,1.145,1.1305,1.1257,1.091,1.1058,1.0953,1.0875,1.0972,1.0932,1.0742,1.0913,1.1121,1.0905,1.0725,1.0843,1.0856,1.0657,1.0782,1.0545,1.0974,1.0859,1.0821,1.0548,1.0559,1.0533,1.0268,1.0086,0.90356,0.89523,0.83216,0.85183,0.82259,0.90519,0.86188,0.99764,0.95157,0.67271,0.93506,0.96935,0.93381,0.98465,0.84979,0.9293,0.91601,0.92392,0.89426,0.9565,0.93412,1.0032,0.97234,1.0092,0.99901,1.0013,1.0157,1.0101,0.99703,1.0053,0.98631,1.0165,1.0187,0.9917,0.99217,0.98596,0.89372,0.97493,0.96927,0.96486,0.85112,0.913,0.97317,0.99166,0.99196,0.99171,0.98816,0.98679,0.99449,1.0005,0.97916,0.96324,0.849,0.91546,0.9592,0.94956,0.96755,0.95387,0.96686,0.95721,0.94042,0.92687,0.95277,0.95615,0.95237,0.93656,0.93957,0.90861,0.93245,0.92927,0.93305,0.94423,0.90752,0.91062,0.92228,0.93455,0.92393,0.92584,0.90881,0.87327,0.8513,0.81357,0.76253,0.66566,0.7178,0.54871,0.7426,0.59933,0.66791,0.68889,0.84457,0.81709,0.77558,0.63854,0.65217,0.70431,0.62467,0.66808,0.68893,0.62834,0.62649,0.67836,0.57646,0.73017,0.59271,0.73877,0.74414,0.78049,0.70026,0.74504,0.7215,0.7111,0.70331,0.78742,0.58968,0.55127,0.4321,0.40921,0.30086,0.24841,0.1438,0.25084,0.16142,0.16338,0.20058,0.39887,0.47181,0.37195,0.40532,0.27834,0.28579,0.36821,0.19461,0.37112,0.27423,0.49396,0.14726,0.48378,0.26891,0.34362,0.42411,0.34117,0.32821,0.27067,0.46101,0.37385,0.42066,0.4612,0.44174,0.50503,0.4586,0.50374,0.50275,0.5024,0.6521,0.68622,0.63461,0.71397,0.68765,0.60648,0.57529,0.58987,0.57191,0.63864,0.61509,0.63815,0.60468,0.71338,0.69218,0.66865,0.73732,0.68817,0.75083,0.73928,0.73462,0.74906,0.73227,0.75358,0.75102,0.73728,0.7541,0.75176,0.74884,0.73971,0.73887,0.73857,0.73532,0.74442,0.72805,0.73442,0.72336,0.68174,0.71252,0.72753,0.72685,0.71972,0.71914,0.72278,0.71877,0.71761,0.72068,0.70817,0.71129,0.70337,0.71422,0.68878,0.69896,0.70175,0.6897,0.69508,0.69058,0.69753,0.69636,0.69305,0.69385,0.68628,0.69055,0.68736,0.68787,0.67613,0.68015,0.68234,0.68202,0.67497,0.67172,0.67636,0.6717,0.67176,0.672,0.66525,0.66833,0.66452,0.64714,0.65694,0.66274,0.65896,0.65463,0.65521,0.65118,0.64919,0.64646,0.64847,0.64641,0.64482,0.63818,0.61875,0.63585,0.62121,0.63266,0.62239,0.63196,0.62913,0.61713,0.62032,0.61944,0.58626,0.60469,0.61661,0.61536,0.60363,0.62158,0.59252,0.61471,0.60434,0.60321,0.60474,0.59722,0.58083,0.5894,0.59814,0.57852,0.5933,0.5541,0.56697,0.59317,0.57919,0.55573,0.58835,0.58124,0.51058,0.53965,0.52067,0.50323,0.57852,0.50291,0.50772,0.48577,0.49696,0.46883,0.46637,0.46765,0.50644,0.39792,0.48304,0.41565,0.41278,0.47899,0.33154,0.41357,0.2685,0.29985,0.24987,0.20136,0.079618,0.21753,0.11317,0.14189,0.18586,0.081686,0.12817,0.1087,0.14428,0.051589,0.15725,0.099224,0.10591,0.070574,0.2956,0.23411,0.15331,0.04174,0.015462,0.12876,0.28785,0.20329,0.2985,0.25599,0.19337,0.22479,0.31183,0.11326,0.14604,0.15764,0.059176,0.27113,0.21854,0.12164,0.2034,0.24762,0.23812,0.14248,0.31316,0.2809,0.31458,0.31171,0.33693,0.28648,0.34753,0.35002,0.46857,0.40188,0.3886,0.37494,0.40996,0.41954,0.4231,0.45873,0.44831,0.45483,0.45642,0.33692,0.4524,0.47679,0.47235,0.36,0.48371,0.44069,0.45514,0.32318,0.4387,0.41985,0.40741,0.47715,0.45575,0.33504,0.41569,0.46239,0.4466,0.47336,0.45434,0.4689,0.44696,0.43131,0.47715,0.43392,0.36489,0.44825])
+        elif material=='solar_direct_circumsolar':               # Wvlgth nm,Etr W*m-2*nm-1,Global tilt  W*m-2*nm-1,Direct+circumsolar W*m-2*nm-1
+            lambda_data = np.array([])
+            lambda_data = 1e-9*np.array([280,280.5,281,281.5,282,282.5,283,283.5,284,284.5,285,285.5,286,286.5,287,287.5,288,288.5,289,289.5,290,290.5,291,291.5,292,292.5,293,293.5,294,294.5,295,295.5,296,296.5,297,297.5,298,298.5,299,299.5,300,300.5,301,301.5,302,302.5,303,303.5,304,304.5,305,305.5,306,306.5,307,307.5,308,308.5,309,309.5,310,310.5,311,311.5,312,312.5,313,313.5,314,314.5,315,315.5,316,316.5,317,317.5,318,318.5,319,319.5,320,320.5,321,321.5,322,322.5,323,323.5,324,324.5,325,325.5,326,326.5,327,327.5,328,328.5,329,329.5,330,330.5,331,331.5,332,332.5,333,333.5,334,334.5,335,335.5,336,336.5,337,337.5,338,338.5,339,339.5,340,340.5,341,341.5,342,342.5,343,343.5,344,344.5,345,345.5,346,346.5,347,347.5,348,348.5,349,349.5,350,350.5,351,351.5,352,352.5,353,353.5,354,354.5,355,355.5,356,356.5,357,357.5,358,358.5,359,359.5,360,360.5,361,361.5,362,362.5,363,363.5,364,364.5,365,365.5,366,366.5,367,367.5,368,368.5,369,369.5,370,370.5,371,371.5,372,372.5,373,373.5,374,374.5,375,375.5,376,376.5,377,377.5,378,378.5,379,379.5,380,380.5,381,381.5,382,382.5,383,383.5,384,384.5,385,385.5,386,386.5,387,387.5,388,388.5,389,389.5,390,390.5,391,391.5,392,392.5,393,393.5,394,394.5,395,395.5,396,396.5,397,397.5,398,398.5,399,399.5,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,419,420,421,422,423,424,425,426,427,428,429,430,431,432,433,434,435,436,437,438,439,440,441,442,443,444,445,446,447,448,449,450,451,452,453,454,455,456,457,458,459,460,461,462,463,464,465,466,467,468,469,470,471,472,473,474,475,476,477,478,479,480,481,482,483,484,485,486,487,488,489,490,491,492,493,494,495,496,497,498,499,500,501,502,503,504,505,506,507,508,509,510,511,512,513,514,515,516,517,518,519,520,521,522,523,524,525,526,527,528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547,548,549,550,551,552,553,554,555,556,557,558,559,560,561,562,563,564,565,566,567,568,569,570,571,572,573,574,575,576,577,578,579,580,581,582,583,584,585,586,587,588,589,590,591,592,593,594,595,596,597,598,599,600,601,602,603,604,605,606,607,608,609,610,611,612,613,614,615,616,617,618,619,620,621,622,623,624,625,626,627,628,629,630,631,632,633,634,635,636,637,638,639,640,641,642,643,644,645,646,647,648,649,650,651,652,653,654,655,656,657,658,659,660,661,662,663,664,665,666,667,668,669,670,671,672,673,674,675,676,677,678,679,680,681,682,683,684,685,686,687,688,689,690,691,692,693,694,695,696,697,698,699,700,701,702,703,704,705,706,707,708,709,710,711,712,713,714,715,716,717,718,719,720,721,722,723,724,725,726,727,728,729,730,731,732,733,734,735,736,737,738,739,740,741,742,743,744,745,746,747,748,749,750,751,752,753,754,755,756,757,758,759,760,761,762,763,764,765,766,767,768,769,770,771,772,773,774,775,776,777,778,779,780,781,782,783,784,785,786,787,788,789,790,791,792,793,794,795,796,797,798,799,800,801,802,803,804,805,806,807,808,809,810,811,812,813,814,815,816,817,818,819,820,821,822,823,824,825,826,827,828,829,830,831,832,833,834,835,836,837,838,839,840,841,842,843,844,845,846,847,848,849,850,851,852,853,854,855,856,857,858,859,860,861,862,863,864,865,866,867,868,869,870,871,872,873,874,875,876,877,878,879,880,881,882,883,884,885,886,887,888,889,890,891,892,893,894,895,896,897,898,899,900,901,902,903,904,905,906,907,908,909,910,911,912,913,914,915,916,917,918,919,920,921,922,923,924,925,926,927,928,929,930,931,932,933,934,935,936,937,938,939,940,941,942,943,944,945,946,947,948,949,950,951,952,953,954,955,956,957,958,959,960,961,962,963,964,965,966,967,968,969,970,971,972,973,974,975,976,977,978,979,980,981,982,983,984,985,986,987,988,989,990,991,992,993,994,995,996,997,998,999,1000,1001,1002,1003,1004,1005,1006,1007,1008,1009,1010,1011,1012,1013,1014,1015,1016,1017,1018,1019,1020,1021,1022,1023,1024,1025,1026,1027,1028,1029,1030,1031,1032,1033,1034,1035,1036,1037,1038,1039,1040,1041,1042,1043,1044,1045,1046,1047,1048,1049,1050,1051,1052,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1064,1065,1066,1067,1068,1069,1070,1071,1072,1073,1074,1075,1076,1077,1078,1079,1080,1081,1082,1083,1084,1085,1086,1087,1088,1089,1090,1091,1092,1093,1094,1095,1096,1097,1098,1099,1100,1101,1102,1103,1104,1105,1106,1107,1108,1109,1110,1111,1112,1113,1114,1115,1116,1117,1118,1119,1120,1121,1122,1123,1124,1125,1126,1127,1128,1129,1130,1131,1132,1133,1134,1135,1136,1137,1138,1139,1140,1141,1142,1143,1144,1145,1146,1147,1148,1149,1150,1151,1152,1153,1154,1155,1156,1157,1158,1159,1160,1161,1162,1163,1164,1165,1166,1167,1168,1169,1170,1171,1172,1173,1174,1175,1176,1177,1178,1179,1180,1181,1182,1183,1184,1185,1186,1187,1188,1189,1190,1191,1192,1193,1194,1195,1196,1197,1198,1199,1200])
+            eps_data    = np.array([2.5361e-026,1.0917e-024,6.1253e-024,2.7479e-022,2.8346e-021,1.3271e-020,6.7646e-020,1.4614e-019,4.9838e-018,2.1624e-017,8.9998e-017,6.4424e-016,2.3503e-015,1.8458e-014,7.2547e-014,3.6618e-013,2.8061e-012,9.0651e-012,3.4978e-011,1.5368e-010,5.1454e-010,1.3303e-009,3.8965e-009,1.4425e-008,4.0789e-008,7.0414e-008,1.576e-007,4.7095e-007,9.4558e-007,1.5965e-006,3.2246e-006,8.0206e-006,1.4737e-005,2.3312e-005,3.3187e-005,6.7912e-005,0.00011127,0.0001427,0.00020323,0.00037386,0.00045631,0.00057207,0.00091926,0.0013201,0.001457,0.002191,0.0037332,0.0048044,0.0050973,0.0064675,0.0089336,0.010186,0.01015,0.011568,0.015246,0.019468,0.020753,0.02275,0.022298,0.023672,0.027826,0.035879,0.045392,0.046156,0.050898,0.053766,0.058323,0.058999,0.065266,0.070476,0.073686,0.064833,0.067088,0.081118,0.09302,0.099712,0.095815,0.10005,0.10971,0.10693,0.11277,0.13305,0.13414,0.12817,0.122,0.1197,0.11623,0.13393,0.14852,0.15467,0.15504,0.17936,0.20868,0.22162,0.21834,0.21285,0.19773,0.20675,0.23297,0.25864,0.26192,0.24103,0.22835,0.23635,0.24508,0.24655,0.24263,0.23265,0.23823,0.25434,0.26477,0.25894,0.23813,0.22099,0.21767,0.23434,0.25321,0.26549,0.27096,0.27847,0.29659,0.29674,0.27932,0.27853,0.29121,0.30296,0.30857,0.29246,0.25352,0.24439,0.27854,0.29761,0.29132,0.29747,0.30318,0.29351,0.29306,0.29884,0.28864,0.2972,0.32913,0.35471,0.34603,0.33388,0.32674,0.30954,0.32975,0.36351,0.38523,0.39043,0.3914,0.37878,0.35627,0.33495,0.29527,0.2995,0.27936,0.25998,0.3065,0.37013,0.3924,0.37167,0.34278,0.33647,0.3535,0.38804,0.40005,0.38994,0.40472,0.40179,0.4181,0.4611,0.49508,0.49694,0.48869,0.48041,0.45319,0.45106,0.47244,0.50856,0.51666,0.46798,0.47628,0.49587,0.46506,0.44389,0.42833,0.38682,0.38651,0.38435,0.41087,0.45514,0.47218,0.46538,0.50014,0.5589,0.60314,0.58892,0.52616,0.47255,0.49751,0.53396,0.54424,0.49135,0.41958,0.36361,0.32648,0.31658,0.36689,0.44239,0.48638,0.46549,0.44984,0.46848,0.47343,0.46731,0.4635,0.46096,0.50121,0.55637,0.58457,0.59038,0.62634,0.63617,0.58656,0.48961,0.35502,0.28272,0.3678,0.50811,0.60096,0.64101,0.56443,0.41101,0.31882,0.47151,0.63944,0.75622,0.80408,0.8298,0.83989,0.87691,0.91387,0.88211,0.89849,0.87849,0.85878,0.84545,0.88488,0.94717,0.8091,0.9077,0.96686,0.92951,0.92134,0.95569,0.98628,0.96392,0.92392,0.96354,0.88467,1.0067,0.99499,0.96531,0.96182,0.99312,0.96667,0.9355,0.94625,0.87766,0.70134,0.63779,1.0628,0.9905,0.91653,1.007,1.1061,1.1306,0.99368,0.95753,1.0993,1.0859,1.164,1.1823,1.1537,1.1992,1.0766,1.2257,1.2422,1.2409,1.2881,1.3376,1.2822,1.1854,1.273,1.2655,1.3088,1.3213,1.2946,1.2859,1.2791,1.3255,1.3392,1.3452,1.3055,1.2905,1.319,1.2616,1.3178,1.3247,1.2749,1.2975,1.3661,1.3144,1.3304,1.3755,1.3299,1.3392,1.3839,1.3586,1.3825,1.3836,1.3899,1.3742,1.3492,1.3457,1.0918,1.2235,1.3252,1.2492,1.3968,1.3435,1.2818,1.3719,1.3402,1.4238,1.3548,1.3788,1.3421,1.3429,1.3391,1.299,1.2991,1.3597,1.2682,1.3598,1.4153,1.3548,1.321,1.385,1.3497,1.3753,1.4125,1.3277,1.3003,1.3385,1.3514,1.1017,1.2605,1.2222,1.3349,1.3452,1.376,1.2976,1.3962,1.3859,1.3479,1.1795,1.3508,1.4142,1.3598,1.4348,1.4094,1.259,1.3491,1.3701,1.4292,1.3229,1.3896,1.3558,1.3096,1.2595,1.3714,1.3493,1.3971,1.3657,1.3536,1.3717,1.3331,1.3752,1.3648,1.3639,1.3923,1.3533,1.3802,1.3883,1.3651,1.3321,1.3613,1.2885,1.3118,1.3885,1.3225,1.3731,1.3466,1.3555,1.2823,1.3673,1.3554,1.3228,1.324,1.281,1.3534,1.3595,1.3527,1.3225,1.3118,1.3452,1.304,1.323,1.3455,1.3518,1.3729,1.3872,1.3845,1.3737,1.3409,1.3708,1.3403,1.1582,1.2316,1.3171,1.29,1.3086,1.3029,1.287,1.326,1.3303,1.3142,1.3145,1.3278,1.3123,1.2928,1.3205,1.3439,1.3418,1.3353,1.3434,1.3392,1.3292,1.3237,1.317,1.337,1.3182,1.2783,1.3254,1.2906,1.2744,1.3228,1.3292,1.3299,1.3359,1.2882,1.2793,1.2751,1.2667,1.2655,1.3022,1.2328,1.2758,1.2589,1.2799,1.2327,1.311,1.2907,1.3065,1.2768,1.3204,1.3292,1.3238,1.2962,1.297,1.2995,1.313,1.3074,1.317,1.2797,1.2744,1.2625,1.2234,1.2299,1.3071,1.2558,1.295,1.2807,1.222,1.0727,1.1218,1.254,1.2586,1.2668,1.2618,1.2518,1.2539,1.2647,1.2871,1.286,1.2767,1.281,1.3032,1.2853,1.2829,1.2651,1.276,1.2742,1.2639,1.2786,1.2669,1.2737,1.2629,1.265,1.2601,1.2662,1.2526,1.2445,1.2454,1.2174,0.88285,1.0195,1.026,1.0746,1.1201,1.1516,1.1446,1.1318,1.1538,1.1513,1.2151,1.1961,1.1721,1.1636,1.1489,1.15,1.1567,1.1864,1.1989,1.1925,1.1875,1.1839,1.188,1.1954,1.1934,1.1856,1.1719,1.1823,1.1428,1.1548,1.0081,0.93873,0.84274,0.8994,0.98967,1.1281,1.0423,0.96305,0.94741,0.98638,0.98988,0.94968,0.95503,1.0294,0.97702,1.052,1.0901,1.1261,1.1101,1.0994,1.0978,1.1184,1.0855,1.1119,1.1078,1.1084,1.1316,1.1408,1.1404,1.1381,1.1389,1.1323,1.1286,1.1273,1.1224,1.1265,1.121,1.1353,1.1321,1.1185,1.1176,1.1246,1.0932,0.24716,0.14328,0.63491,0.35217,0.49885,0.63377,0.7508,0.89574,1.0222,1.0347,1.0646,1.0716,1.0802,1.0797,1.08,1.0801,1.0827,1.0764,1.0754,1.0803,1.0687,1.0662,1.0714,1.0672,1.0602,1.0649,1.0656,1.053,1.0399,1.0359,1.0045,1.0179,1.0084,1.0015,1.0101,1.0066,0.98985,1.0057,1.0245,1.0048,0.98859,0.99978,1.0011,0.98288,0.99452,0.9727,1.0122,1.0018,0.99844,0.97353,0.97488,0.97273,0.94882,0.93236,0.83681,0.82927,0.77171,0.78984,0.76299,0.83844,0.79899,0.92292,0.88081,0.62576,0.86619,0.89752,0.8653,0.91178,0.7887,0.86135,0.8493,0.85666,0.82961,0.88622,0.86608,0.92917,0.90135,0.93493,0.92585,0.92783,0.94124,0.93626,0.92411,0.93171,0.91434,0.94226,0.94447,0.91947,0.9201,0.91447,0.829,0.90454,0.89942,0.8954,0.79,0.84746,0.90343,0.92059,0.92094,0.92081,0.91764,0.91648,0.92367,0.92934,0.90956,0.89487,0.78882,0.85066,0.8914,0.88252,0.89933,0.88671,0.89887,0.88999,0.87451,0.86204,0.88625,0.88948,0.88607,0.87144,0.87434,0.84563,0.86787,0.86494,0.86859,0.87913,0.84515,0.84799,0.85899,0.87041,0.86078,0.86255,0.84688,0.81412,0.79413,0.75956,0.71265,0.6231,0.67137,0.51461,0.69429,0.56162,0.625,0.64483,0.78862,0.76337,0.72502,0.59833,0.61091,0.65912,0.58553,0.6258,0.64508,0.58906,0.5874,0.6355,0.54099,0.6835,0.55612,0.69161,0.69657,0.73004,0.65584,0.69698,0.67571,0.66621,0.65875,0.73684,0.55363,0.51792,0.40679,0.3854,0.28386,0.23459,0.13604,0.2369,0.15267,0.15453,0.18962,0.37591,0.44411,0.35071,0.38192,0.26289,0.26987,0.34729,0.18409,0.3501,0.25911,0.46514,0.13944,0.45563,0.25418,0.32442,0.39988,0.32204,0.30996,0.25591,0.43453,0.35294,0.39685,0.43481,0.41664,0.47585,0.43242,0.47469,0.47377,0.47353,0.61301,0.6448,0.59689,0.67059,0.64629,0.57081,0.5417,0.55536,0.53872,0.60084,0.57903,0.60046,0.56941,0.67058,0.65102,0.62915,0.6929,0.64734,0.70553,0.69489,0.69059,0.70391,0.68843,0.70833,0.70597,0.69325,0.70891,0.70673,0.70409,0.69555,0.69481,0.69455,0.69159,0.70013,0.68498,0.69086,0.68056,0.6414,0.67047,0.68463,0.68407,0.67742,0.67695,0.68034,0.67667,0.67556,0.67848,0.66676,0.66976,0.66237,0.67263,0.6488,0.65839,0.66107,0.6498,0.6549,0.65077,0.65727,0.65625,0.65318,0.65398,0.64687,0.65092,0.64799,0.64852,0.63751,0.64136,0.64348,0.64323,0.63664,0.63361,0.63802,0.63366,0.63379,0.63406,0.62773,0.63067,0.62712,0.61078,0.62008,0.62559,0.62206,0.61802,0.61862,0.61487,0.61302,0.61048,0.61242,0.61055,0.6091,0.60286,0.58453,0.60073,0.58694,0.59782,0.58815,0.59722,0.59461,0.5833,0.58637,0.58561,0.55428,0.57178,0.58304,0.58194,0.57086,0.5878,0.56054,0.58141,0.57175,0.57076,0.5721,0.56519,0.54973,0.55773,0.56603,0.54775,0.56163,0.52496,0.53685,0.56159,0.54856,0.52656,0.55722,0.55048,0.48417,0.5112,0.49363,0.47731,0.54805,0.47709,0.48161,0.46113,0.47169,0.44513,0.44291,0.44412,0.48065,0.3784,0.45866,0.39517,0.39249,0.45496,0.31572,0.3933,0.25599,0.28576,0.23833,0.19223,0.076164,0.20763,0.10821,0.13562,0.17753,0.078159,0.12255,0.10397,0.13794,0.049394,0.15032,0.094946,0.10133,0.067568,0.28201,0.22359,0.14661,0.039988,0.014819,0.1232,0.27472,0.19428,0.28484,0.24447,0.18486,0.21481,0.29758,0.10843,0.13976,0.15085,0.056715,0.25898,0.20894,0.11648,0.19453,0.23666,0.22762,0.13643,0.29903,0.26837,0.3004,0.2977,0.32163,0.27371,0.33167,0.33412,0.44644,0.38332,0.3708,0.35781,0.39105,0.40018,0.40348,0.43731,0.4275,0.4337,0.43522,0.32193,0.43142,0.45447,0.4504,0.34391,0.46114,0.42052,0.43423,0.30903,0.41853,0.40083,0.38908,0.45518,0.43494,0.32039,0.39685,0.44124,0.42638,0.45171,0.4337,0.44751,0.42671,0.41188,0.45527,0.41426,0.34869,0.42789])
+        elif material=='air':
+            lambda_data = np.array([])
+            lambda_data = np.linspace(250e-9,7000e-9,3)
+            n_data      = np.ones_like(lambda_data)
+            k_data      = np.zeros_like(lambda_data)
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='silicon_salzberg':
+            ## C. D. Salzberg and J. J. Villa. , J. Opt. Soc. Am., 47, 244-246 (1957)
+            lambda_data = np.array([])
+            lambda_data = np.array([1.357,1.454,1.551,1.647,1.744,1.841,1.938,2.035,2.132,2.228,2.325,2.422,2.519,2.616,2.713,2.809,2.906,3.003,3.100,3.197,3.294,3.390,3.487,3.584,3.681,3.778,3.875,3.971,4.068,4.165,4.262,4.359,4.456,4.552,4.649,4.746,4.843,4.940,5.037,5.133,5.230,5.327,5.424,5.521,5.618,5.714,5.811,5.908,6.005,6.102,6.199,6.295,6.392,6.489,6.586,6.683,6.779,6.876,6.973,7.070,7.167,7.264,7.360,7.457,7.554,7.651,7.748,7.845,7.941,8.038,8.135,8.232,8.329,8.426,8.522,8.619,8.716,8.813,8.910,9.007,9.103,9.200,9.297,9.394,9.491,9.588,9.684,9.781,9.878,9.975,10.07,10.17,10.27,10.36,10.46,10.56,10.65,10.75,10.85,10.94,11.04])*1e-6
+            n_data = np.array([3.4975134228247,3.4864875403502,3.4776415369852,3.4704707359595,3.4644494863299,3.4593908013408,3.4550971853461,3.451420212052,3.4482462357671,3.4455134698984,3.4430958717431,3.4409682782263,3.4390858761579,3.4374122275297,3.4359174491583,3.4345899473621,3.4333816594248,3.4322899037219,3.4313001198042,3.430399958421,3.4295788893602,3.428835300402,3.42814599086,3.4275123235748,3.4269284540976,3.4263892870142,3.4258903634249,3.4254323634342,3.425002322785,3.4246021401328,3.4242291087166,3.4238808220676,3.4235551348489,3.4232531743792,3.4229669454396,3.4226981520975,3.422445403629,3.4222074453723,3.4219831430446,3.4217735901432,3.4215734959349,3.4213842578704,3.4212051027272,3.4210353249521,3.4208742796716,3.4207229131854,3.4205775351527,3.4204392658701,3.4203076479036,3.4201822600373,3.4200627138826,3.4199497999331,3.4198408370404,3.4197367220213,3.4196371703466,3.4195419180564,3.4194516402882,3.4193642301986,3.4192804363872,3.4192000610675,3.4191229197861,3.4190488403584,3.418978381418,3.4189099258497,3.4188440813591,3.4187807159132,3.4187197057128,3.4186609345837,3.4186048668357,3.4185502326901,3.418497530469,3.4184466693202,3.4183975636622,3.4183501328217,3.4183047652864,3.4182604446614,3.4182175837513,3.4181761183885,3.4181359878862,3.4180971348134,3.4180598866639,3.4180234163369,3.4179880691752,3.4179537988195,3.4179205612712,3.4178883147498,3.4178573374668,3.417826946642,3.4177974338879,3.4177687650383,3.4177414739641,3.4177135553073,3.4176864343827,3.4176626821244,3.4176369932492,3.4176120167551,3.4175901248421,3.4175664291375,3.4175433715308,3.4175231459277,3.4175012372164])
+            k_data = np.zeros_like(lambda_data)
+            eps_data    =  (n_data+1j*k_data)**2
+        elif material=='silicon_odp': # adapted from palik??
+            lambda_data = np.array([])
+            lambda_data = np.array([216.8,217.5,218.3,219.1,219.8,220.6,221.4,222.2,223,223.8,224.6,225.4,226.3,227.1,227.9,228.8,229.6,230.5,231.3,232.2,233.1,233.9,234.8,235.7,236.6,237.5,238.4,239.4,240.3,241.2,242.2,243.1,244.1,245,246,247,248,249,250,251,252,253,254.1,255.1,256.2,257.2,258.3,259.4,260.5,261.6,262.7,263.8,264.9,266.1,267.2,268.4,269.5,270.7,271.9,273.1,274.3,275.5,276.8,278,279.2,280.5,281.8,283.1,284.4,285.7,287,288.3,289.7,291,292.4,293.8,295.2,296.6,298,299.5,300.9,302.4,303.9,305.4,306.9,308.4,310,311.5,313.1,314.7,316.3,317.9,319.5,321.2,322.9,324.6,326.3,328,329.7,331.5,333.3,335.1,336.9,338.8,340.6,342.5,344.4,346.3,348.3,350.2,352.2,354.2,356.3,358.3,360.4,362.5,364.7,366.8,369,371.2,373.4,375.7,378,380.3,382.7,385,387.5,389.9,392.4,394.9,397.4,400,402.5,405.2,407.8,410.5,413.3,416.1,418.9,421.7,424.6,427.5,430.5,433.5,436.6,439.7,442.8,446,449.2,452.5,455.8,459.2,462.6,466.1,469.6,473.2,476.9,480.6,484.3,488.1,492,495.9,499.9,504,508.1,512.3,516.6,520.9,525.4,529.9,534.4,539.1,543.8,548.6,553.5,558.5,563.6,568.7,574,579.4,584.8,590.4,596.1,601.9,607.8,613.8,619.9,626.2,632.6,639.1,645.8,652.6,659.5,666.6,673.8,681.2,688.8,696.5,704.5,712.6,720.8,729.3,738,746.9,756,765.3,774.9,784.7,794.8,805.1,815.7,826.6,885.6,953.7,968.6,984,999.9,1016,1033,1051,1069,1088,1107,1120,1127,1144,1148,1170,1200])*1e-9
+            re_eps_data = np.array([-8.24178,-8.29214,-8.4002,-8.45598,-8.54928,-8.65087,-8.72343,-8.81976,-8.89162,-8.98589,-9.05146,-9.1076,-9.16072,-9.18623,-9.21744,-9.19486,-9.16612,-9.08742,-9.01475,-8.92019,-8.82381,-8.74937,-8.68349,-8.65424,-8.65105,-8.66794,-8.7244,-8.79437,-8.89465,-8.99208,-9.14014,-9.29,-9.4445,-9.62777,-9.81939,-10.0203,-10.2443,-10.465,-10.695,-10.9598,-11.2254,-11.5046,-11.7709,-12.0893,-12.4008,-12.7297,-13.0835,-13.45,-13.8489,-14.2798,-14.7154,-15.1896,-15.7041,-16.2369,-16.7922,-17.3548,-17.9315,-18.4562,-18.9332,-19.3437,-19.6392,-19.8193,-19.8867,-19.8124,-19.6102,-19.2877,-18.8239,-18.2164,-17.4503,-16.3333,-14.7679,-12.4106,-9.45548,-6.12934,-2.93152,-0.067319,2.37222,4.34308,5.9783,7.31638,8.42475,9.36796,10.1172,10.7756,11.3419,11.8277,12.2335,12.6362,13.0106,13.332,13.6551,13.9645,14.2543,14.5652,14.891,15.2122,15.5291,15.8485,16.1746,16.5346,16.8777,17.233,17.5865,17.9552,18.3213,18.7081,19.1254,19.5746,20.0724,20.6812,21.4212,22.3879,23.7106,25.6007,28.1836,31.4907,35.2195,38.7911,41.4811,43.1383,43.7395,43.2656,42.1301,40.7353,39.2276,37.7444,36.3509,35.064,33.8739,32.7856,31.7947,30.8751,30.047,29.2682,28.5138,27.836,27.1969,26.6019,26.0423,25.5314,25.0456,24.5703,24.1294,23.7022,23.3043,22.9248,22.5644,22.2373,21.8989,21.5862,21.2811,20.987,20.7126,20.4305,20.1906,19.9308,19.7233,19.4922,19.274,19.0644,18.8557,18.6571,18.4675,18.2884,18.0998,17.9316,17.7626,17.6033,17.4445,17.2954,17.1376,16.9968,16.8573,16.718,16.5883,16.4578,16.3367,16.2075,16.0952,15.9753,15.8634,15.7521,15.6492,15.5466,15.4521,15.3501,15.2564,15.155,15.0696,14.9766,14.8839,14.7992,14.7223,14.6381,14.554,14.4779,14.4094,14.3412,14.2731,14.1977,14.145,14.0774,14.0249,13.9576,13.8979,13.8458,13.7937,13.727,13.6678,13.6013,13.5497,13.4909,13.2001,12.9319,12.8809,12.8314,12.7835,12.7378,12.6928,12.648,12.6061,12.5656,12.5281,12.504,12.4913,12.4574,12.456,12.4228,12.3855])
+            im_eps_data = np.array([7.2897,7.34432,7.49265,7.6293,7.74504,7.8793,7.99576,8.16684,8.3072,8.48767,8.66583,8.84936,9.04096,9.26185,9.4872,9.70751,9.90277,10.1175,10.2791,10.4149,10.5173,10.5888,10.6068,10.6339,10.6406,10.6568,10.659,10.6674,10.6817,10.7025,10.7216,10.7739,10.8361,10.9108,10.9885,11.0866,11.1941,11.3337,11.4771,11.6266,11.802,11.9743,12.1854,12.4101,12.641,12.9074,13.1944,13.4877,13.8338,14.2145,14.629,15.0928,15.6078,16.208,16.8885,17.6899,18.5997,19.6182,20.7537,22.0406,23.4415,24.912,26.4813,28.1124,29.7862,31.5482,33.3466,35.2671,37.2916,39.5016,41.8694,44.0879,45.7794,46.6799,46.7569,46.2433,45.3509,44.2714,43.1506,42.0316,40.9581,39.9492,39.0132,38.1319,37.3339,36.6095,35.9417,35.3535,34.8395,34.3517,33.9413,33.5671,33.239,32.9399,32.6794,32.4439,32.2337,32.0383,31.8743,31.7437,31.6152,31.5341,31.478,31.4426,31.4592,31.5134,31.6383,31.8346,32.1257,32.5323,33.079,33.8171,34.6961,35.6351,36.3148,36.3467,35.284,32.8858,29.481,25.5405,21.444,17.7252,14.6187,12.1943,10.2951,8.83218,7.63812,6.67366,5.90042,5.23853,4.70413,4.31118,3.90003,3.56636,3.34847,3.07529,2.80944,2.63364,2.49319,2.30645,2.1138,2.01417,1.90741,1.80264,1.78747,1.62894,1.54948,1.40596,1.39524,1.23637,1.20913,1.19158,1.19289,1.2119,1.0788,1.07184,0.79956,0.830208,0.728906,0.689986,0.668822,0.63072,0.627508,0.564564,0.61272,0.5082,0.5058,0.469952,0.442762,0.357674,0.3726,0.395808,0.361328,0.359832,0.260672,0.308332,0.258688,0.273768,0.24072,0.215838,0.23898,0.23814,0.213624,0.19715,0.19655,0.188064,0.171864,0.171292,0.147516,0.13932,0.131172,0.123104,0.122784,0.11478,0.10682,0.09893,0.098696,0.098462,0.090672,0.082896,0.082742,0.07504,0.0749,0.067248,0.067104,0.059536,0.059424,0.05187,0.051758,0.044256,0.044172,0.03673,0.0563146,0.0162544,0.00459392,0.00365374,0.00286032,0.00199864,0.00128257,0.000853536,0.000475767,0.000297763,0.000176975,0.000113155,9.18918e-005,4.80012e-005,4.09399e-005,1.05738e-005,0])
+            eps_data    =  re_eps_data+1j*im_eps_data      
+        elif material=='silicon':
+            n_data= np.array([1.57735253931137,1.58186036411427,1.58745384766563,1.59349862265938,1.60177711840596,1.61209774965256,1.62131567400238,1.63305398586985,1.64647172195016,1.66006488446926,1.67468476525998,1.69196968949735,1.71106651991364,1.73225447821187,1.75575541297128,1.78099647847918,1.8106873404692,1.84544963084712,1.88502709147122,1.93172577144186,1.98339893122054,2.0426515385758,2.10874951110095,2.18234571749481,2.26354188192264,2.35136201200872,2.44383082325043,2.54053333565119,2.64159419379869,2.74633280294472,2.85425629931862,2.96544600120646,3.07899042307051,3.19744145317372,3.32131395568159,3.45182081250905,3.59483282703159,3.75195418610222,3.92201781481774,4.10021643157141,4.27422583290409,4.43404484928686,4.57252704332848,4.68508773369052,4.77440816461226,4.84446328535206,4.89725067096287,4.93426556354865,4.96267106681655,4.98364199293911,4.99832701435173,5.00837389046477,5.01522353584253,5.01954374041002,5.02093145363772,5.02096214438325,5.02014616591806,5.01856888943838,5.01672085461021,5.01469918673457,5.01199800014191,5.00983591660443,5.00871924773266,5.00922423551753,5.00974180103974,5.00897555992803,5.0099423582183,5.01211414487298,5.01446443970759,5.01733271231316,5.0207789805716,5.02502684902802,5.03010546923491,5.03609786927842,5.04294101153968,5.05054315229467,5.05791493021523,5.06541265656671,5.07336504889137,5.08195367190238,5.09127086365995,5.1015050801543,5.11252113898944,5.12357082435303,5.13482469091338,5.14626461948796,5.15828506741747,5.17117869787142,5.1844015670206,5.19785915097528,5.211793667972,5.22625577773948,5.24171239360635,5.25810944247739,5.27533515532444,5.29364226482097,5.31344822013014,5.33491284490754,5.35827964020557,5.38390373288337,5.4120218857275,5.44327472287244,5.47793649199222,5.5171014949012,5.56144276220218,5.611810633624,5.66877492224896,5.7332840711904,5.80680570352458,5.88823555344612,5.9773394426885,6.07302345198727,6.17454544714107,6.27968020086022,6.38285111354203,6.48367983928077,6.57438747852778,6.65572628434903,6.72079789249519,6.7693455197855,6.80338309776809,6.82279927759773,6.82890630619832,6.82224968590413,6.80325814834376,6.7719121387827,6.72944321605452,6.68195935931015,6.62853447561408,6.57303273831204,6.51590330344721,6.45784053355665,6.39963747339597,6.34143454755029,6.28487718473381,6.22969325127384,6.17614923541751,6.12433483770149,6.07419823727087,6.02580281649345,5.97911118054012,5.93392849951262,5.89023210507264,5.84808935853906,5.80755658028763,5.76859266288816,5.73109703324238,5.69516814819639,5.66049036995096,5.62678716790887,5.59417632213,5.56266170404274,5.53230280636794,5.50295773862837,5.47454486190115,5.44714379352078,5.4201632848602,5.39318181395281,5.3666010475804,5.34091459840424,5.31569005427419,5.29197358141414,5.2714707239041,5.25411191897057,5.23639654565805,5.21590330054441,5.19417125206286,5.17298114318199,5.15277540488603,5.13307053463837,5.11381095268526,5.09501410196782,5.07665381529792,5.0586850843267,5.04112869617298,5.02395419855173,5.0071270378099,4.99066633170129,4.97454369676992,4.95873378924055,4.94325240325397,4.92807555263769,4.9131844315987,4.89859202248525,4.884277867975,4.87022629989065,4.85644899194063,4.84292759674096,4.82964661363355,4.81661751284624,4.80382421489241,4.79125027024947,4.77890702125886,4.76678079992139,4.75485305374137,4.74313278647186,4.73161214084929,4.72027361909586,4.70912090951212,4.69815273542604,4.68735397960263,4.67672069834691,4.66625836701682,4.65595578594232,4.64580531927448,4.63581361560939,4.62597379279612,4.61627754799721,4.60672876140131,4.59732534310401,4.58806027005799,4.57893226630428,4.56994422169103,4.56108979535547,4.5523638955536,4.54377131873552,4.53530777154156,4.52696643179805,4.51874791311966,4.51065411985111,4.50267733877786,4.49481139651981,4.48706256007677,4.47942574145463,4.47189237254421,4.46446070785687,4.4571356915043,4.4499090570608,4.44277243405831,4.43573012237678,4.42878137411306,4.42191857952531,4.41513597283802,4.40843949636252,4.40182535460377,4.39528726111078,4.38882235896026,4.38243521566404,4.37612187698815,4.36987776835775,4.36370231756612,4.3575980687092,4.35156183609664,4.34559035718206,4.33968438403118,4.33384502461807,4.32806940827535,4.32235467289551,4.31670184919928,4.31111162498298,4.30558162068962,4.30010946250176,4.29469623311894,4.28934249299632,4.28404586676017,4.27880397903679,4.27361746132203,4.2684873903118,4.26341149259178,4.25838749178957,4.25341534621995,4.248496863178,4.24362972325902,4.23881151253892,4.23404113575298,4.22932119524938,4.22464977199308,4.22002445971311,4.21544325093413,4.21090867546697,4.20641989917537,4.20197464363792,4.19757063043322,4.19320870557925,4.1888899886462,4.18461249441999,4.1803742375628,4.1761741218946,4.17201437649484,4.16789384065373,4.16381085741701,4.15976378040573,4.1557534549413,4.15178049424578,4.14784374674483,4.14394206086414,4.14007469622859,4.13624307840028,4.13244660474209,4.12868424476437,4.12495496797744,4.12125883688905,4.11759685321277,4.11396810944003,4.11037165694676,4.10680656205122,4.10327367759715,4.09977327636782,4.09630438076333,4.09286601318379,4.08945732714787,4.08607970010605,4.08273289919222,4.07941577965529,4.07612719674413,4.07286625412786,4.0696345142069,4.06643163370744,4.06325654360305,4.06010817486725,4.05698569883477,4.053890622235,4.05082263014628,4.04778072512343,4.04476390972126,4.04177131704635,4.03880425534062,4.03586265644449,4.03294563250368,4.03005229566392,4.02718177309857,4.0243348809884,4.02151200337629,4.01871241102817,4.01593537470995,4.01318016518753,4.01044694309011,4.00773664997349,4.00504858490346,4.00238200761603,3.99973617784721,3.99711062225678,3.99450657428066,3.99192371915386,3.9893613479473,3.98681875173186,3.98429522157846,3.98179133852486,3.97930777709779,3.9768437602268,3.9743985099186,3.97197124817992,3.96956142319198,3.96717041998154,3.96479799632758,3.96244336951719,3.96010575683745,3.95778437557546,3.95547916655294,3.95319143588277,3.95092057484685,3.94866584790736,3.94642651952651,3.94420185416647,3.94199220393785,3.93979846657146,3.93762004853101,3.93545634458438,3.93330674949938,3.93117065804388,3.92904851347836,3.9269409010011,3.92484738288562,3.92276752134943,3.92070087861004,3.91864701688495,3.9166168492237,3.91461462318682,3.91262678810304,3.91063977340611,3.90864000852982,3.90661392290792,3.90454111894027,3.90241765540969,3.90027158038555,3.89813155294639,3.89602623217077,3.89398427713723,3.89202903927186,3.89014469091176,3.88831432959051,3.88652343375657,3.88475748185841,3.8830019523445,3.88124284084748,3.87950114207508,3.8777859716148,3.87608563905112,3.87438845396849,3.87268272595138,3.87095676458424,3.86919979939118,3.86741369622353,3.86560947259149,3.8637983482607,3.86199154299679,3.86020027656539,3.85843576873214,3.85668804494593,3.85494016111859,3.85320251290109,3.85148561659483,3.84979998850127,3.84815614492181,3.84656480171259,3.84504665883871,3.84359399143694,3.84218365532141,3.84079250630624,3.83939740020556,3.8379751928335,3.83650310187045,3.83498334673749,3.83343333057529,3.83186489997592,3.83028990153142,3.82872018183383,3.82716758747522,3.82564390627747,3.82413904102736,3.82264138143919,3.8211545093644,3.81968200665443,3.8182274551607,3.81679443673466,3.81538653322774,3.8140050185449,3.81264615694249,3.81130877057677,3.80999180069979,3.80869418856364,3.80741487542038,3.8061528025221,3.80490835841534,3.80369350813453,3.80250527437128,3.80133629798905,3.80017921985133,3.7990266808216,3.79787132176334,3.79670578354004,3.79552883059243,3.79435026650768,3.79317089258688,3.79199114243177,3.79081144964408,3.78963224782555,3.78845397057792,3.78727705199251,3.78610211442305,3.78492896819669,3.78375690635405,3.78258522193577,3.78141320798248,3.78024015753479,3.77906536363335,3.77788797350853,3.77669390139901,3.77548166672591,3.7742618658872,3.77304509528087,3.77184195130488,3.7706630303572,3.76951892883581,3.76842024313869,3.76737447752368,3.76637500937567,3.76541122403168,3.76447250679985,3.76354824298828,3.76262781790511,3.76170061685846,3.76075602515645,3.75978697124338,3.75880163477723,3.75780694883362,3.75680940004479,3.75581547504302,3.75483166046054,3.7538644429296,3.75292030908247,3.75200597550714,3.75113201681734,3.7502934018063,3.74947906998756,3.74867796087472,3.74787901398134,3.747071168821,3.74624336490726,3.74538454175369,3.74448572511772,3.74355511819695,3.7426001388412,3.74162669674032,3.7406407015842,3.7396480630627,3.73865469086569,3.73766649468303,3.73668938420459,3.73572230915142,3.73474138673759])
+            k_data= np.array([3.61578410084995,3.65154559525466,3.68940498650954,3.7280895040219,3.76626872783792,3.80686739965095,3.85076466107381,3.89399280816904,3.94000083430703,3.98728346058335,4.03596008279171,4.08820664787489,4.14288917516013,4.19878054132639,4.2575811943684,4.32036566898534,4.38574167207024,4.4533728807635,4.52395241688328,4.59699790385294,4.67202226197263,4.74561231582054,4.81769675650922,4.88841448816489,4.95643448456022,5.01971642836357,5.07731611589672,5.13159634855857,5.18077269944358,5.22497165106244,5.26489697400258,5.30127245745554,5.33310083352332,5.36261119798573,5.39019788510964,5.41477149814945,5.43237536651653,5.44126115518706,5.43014201165727,5.39096897493914,5.32307856391467,5.22781166059848,5.11367681345689,4.98905199789656,4.86170991549904,4.73646274103473,4.61622515751445,4.50355007687791,4.39832618792815,4.30100010840392,4.21170922552946,4.12871439869907,4.05165905802868,3.98036974663545,3.9154043398762,3.85493306776021,3.79841365653432,3.74583586838269,3.69698919098064,3.65173719308133,3.60991464223567,3.5708645242143,3.53429123809785,3.50018962228936,3.46833008407153,3.43855015420712,3.41032717870334,3.38375913298494,3.35912633468855,3.33588855842888,3.31387737446671,3.29273207549769,3.27228295524477,3.25218802869327,3.23309993188186,3.21507875369483,3.19757466637007,3.1806940344179,3.16457087123899,3.14893159230088,3.13366803204836,3.11908062548436,3.1051366568748,3.09158297362072,3.0786206088875,3.06649294180555,3.05517680290083,3.0447660193941,3.03474486761087,3.02499455942224,3.0163256379721,3.00871794011234,3.00190820345207,2.99595342905676,2.99094149971437,2.98695064294833,2.98415086595136,2.98259352053084,2.98246012087789,2.98358634723467,2.98586061635717,2.98927394898511,2.9937423266503,2.99941753274936,3.00693019395736,3.01458434358629,3.0218886199729,3.02672652998446,3.02779428089034,3.02285462342933,3.00948216534891,2.98599085213365,2.94839618983356,2.89680935946587,2.82825653304307,2.74352750574088,2.64239655010964,2.52519393650563,2.40093527559868,2.26902187050636,2.13492965466757,1.99911852493608,1.86428735918006,1.73112461856157,1.60222424070474,1.48219062624977,1.37000945656976,1.26763631003023,1.17490509665216,1.09122171705812,1.01712119775092,0.950699622988326,0.890691813040762,0.837210442767821,0.789024801712446,0.746506916457371,0.707301101499668,0.670908162046339,0.637494838907625,0.606810929573253,0.578887583830993,0.553118958515689,0.529709517401052,0.507949770760125,0.487106946548385,0.467556454139816,0.449702631932905,0.433535278083627,0.419052020748072,0.406786092124141,0.396321708320906,0.385169707453873,0.37264741488675,0.360147087270235,0.348620963526635,0.337691153743276,0.328317298045815,0.321683280710992,0.316464085197041,0.310041277014961,0.301904703879831,0.293891039004508,0.287737200301535,0.283096160462183,0.278367614320574,0.272507070892467,0.266176035591393,0.260098997204983,0.254458049331799,0.249053297680663,0.24385558283633,0.238872451946284,0.234093505360722,0.229499487301538,0.225100437910199,0.220880148616092,0.216821976299239,0.212937878085058,0.209204452913653,0.205603463148072,0.202149247600098,0.198812245557481,0.19557060507146,0.192440262324011,0.189393845003757,0.186409343483373,0.183500764937834,0.180651337415681,0.177844201508508,0.175086121965372,0.172376836690549,0.169713034153928,0.167091010132569,0.164521615431218,0.162016446795084,0.159566667100637,0.157182436787526,0.154882500125079,0.152665173564292,0.150529406248786,0.148485933941678,0.146542451461713,0.144693758140303,0.142931738861207,0.141254487404446,0.139672780533253,0.138161588932717,0.136694300356665,0.135291994302805,0.133936748534709,0.132587293442756,0.131236038258175,0.129899978037675,0.128542140527488,0.12713090837769,0.125685564540056,0.124197179053107,0.122646668501517,0.121025019584538,0.119341700307876,0.117603034509705,0.11581234858209,0.113955537966154,0.112051484972173,0.110126778157212,0.108184681819833,0.106209362149278,0.104233234265883,0.102289021898974,0.100361316575698,0.0984518037858608,0.0965875709088416,0.0947902579919788,0.0930432212169854,0.0913523726596737,0.0897304755488125,0.0881861572731317,0.086713052253979,0.085308724203967,0.0839712927938606,0.0827043643020105,0.0815092171834421,0.0803746520867089,0.0792893354610971,0.078258285167609,0.0772845321393666,0.0763531533482604,0.0754492722126304,0.0745788411800483,0.0737451550544188,0.0729347402787494,0.0721341509101151,0.0713473061624084,0.0705783167687931,0.0698177891524713,0.069056329736645,0.0682941073570199,0.0675357873912023,0.0667770650320266,0.0660136268031993,0.0652432747929773,0.0644685382660738,0.0636903710284385,0.0629096631207362,0.0621260259197981,0.0613369615258848,0.0605461668821107,0.0597578916133795,0.0589755749021435,0.0581938502460126,0.0574150526628544,0.0566445512873004,0.055887715253982,0.0551431479335838,0.0544081225928513,0.0536862598279002,0.0529811804954401,0.0522954441444064,0.0516264742083904,0.050974153731844,0.0503388704933846,0.0497210201862313,0.0491222370886572,0.0485418014604452,0.0479772006869228,0.0474259221534175,0.0468865427855877,0.0463629343351718,0.0458528950002901,0.0453530382353487,0.0448599774947535,0.0443735557446874,0.0438968538629537,0.0434276679553591,0.0429636762884447,0.0425025782440505,0.0420449973256454,0.0415920549080222,0.041143374327242,0.0406985789193657,0.0402572478673277,0.0398186142111749,0.0393834040443609,0.0389527798835096,0.0385279042452446,0.0381096607499454,0.0376962545693398,0.0372881934814331,0.036886817511291,0.036493466683979,0.0361092295565687,0.0357326027942208,0.0353636947991755,0.0350032968514564,0.0346522002310873,0.0343111527187821,0.0339799128748062,0.0336580821788969,0.0333454530228007,0.0330418177982639,0.0327469799789795,0.0324618052433437,0.0321862412665961,0.0319192936066085,0.0316599678212529,0.0314072694684011,0.0311616143606289,0.0309244460049404,0.0306944391218469,0.0304702042052518,0.0302503517490586,0.0300340036214472,0.0298235298025091,0.0296182971100608,0.0294169141064067,0.0292179893538508,0.0290201314146976,0.0288241169647021,0.0286311914402747,0.0284403286319164,0.0282505008328908,0.0280606803364618,0.0278700640143028,0.0276799475221985,0.0274903448776845,0.0273007667870633,0.0271107239566376,0.0269197270927101,0.0267275586261395,0.0265347269641777,0.026341242205468,0.0261470732390899,0.0259521889541232,0.0257565582396476,0.0255600517753982,0.0253626289894305,0.0251644737122565,0.024965771171127,0.0247667065932931,0.0245674652060056,0.0243677972862318,0.0241674975383202,0.0239668378087861,0.0237660899687913,0.0235655258894974,0.0233654174420661,0.0231599423149472,0.0229468013229542,0.0227332201025775,0.0225264349519051,0.0223336821690249,0.0221621980520252,0.0220268743237098,0.0219340896480177,0.0218624599560856,0.0217900224049936,0.0216948141518216,0.0215548723536497,0.0213508990937206,0.0210897208479815,0.0207880386913802,0.020461940933167,0.020127515882592,0.0198008518489053,0.0194975569202329,0.0191996105460889,0.0188965440169554,0.0185965512987654,0.0183078263574517,0.018038563158947,0.0177969556691843,0.0175892858624063,0.0174105289010361,0.0172557825441295,0.0171206559511805,0.0170007582816832,0.0168916986951315,0.0167890863510194,0.0166993174977802,0.0166304583501715,0.0165755151691592,0.0165274303168877,0.0164791461555018,0.0164236050471461,0.0163538478938163,0.0162729880120961,0.0161864311639813,0.0160951640411992,0.0160001733354776,0.0159024457385439,0.0158029679421257,0.0157026976177204,0.0156009837755374,0.0154971160749228,0.0153910357412939,0.0152826840000678,0.0151720020766619,0.0150589311964932,0.0149433987952759,0.01482125018709,0.0146917433070384,0.0145585406467148,0.0144253046977129,0.0142956979516265,0.0141733829000494,0.0140620220345753,0.0139632198039168,0.0138735551336151,0.0137914150804437,0.0137152857134745,0.0136436531017799,0.0135750033144317,0.0135078224205022,0.0134411594251147,0.0133792904294247,0.0133221006900996,0.0132679198203491,0.013215077433383,0.0131619031424111,0.013106726560643,0.0130478773012886,0.0129849867573209,0.0129201579423489,0.0128536869548204,0.0127857934141503,0.0127166969397534,0.0126466171510444,0.0125757736674381,0.0125043844811224,0.0124314509833342,0.0123564750638964,0.0122801673741076,0.0122032385652667,0.0121263992886723,0.0120503601956233,0.0119758319374183,0.0119035156079385,0.0118329362173755,0.0117634395145095,0.0116949604337732,0.0116274339095989,0.0115607948764194,0.0114949782686669,0.0114299190207742,0.0113655520671736,0.011301608913145,0.0112380228029309,0.0111750446148303,0.0111129252464379,0.0110519155953486,0.010992266559157,0.0109342290354579,0.010878053921846,0.0108244178296829,0.0107742686793951,0.0107267350342722,0.0106808388674221,0.0106356021519525,0.0105900468609714,0.0105431949675866,0.0104940684449058,0.0104417345881847,0.0103870996054982,0.0103309788499743,0.0102734966250375,0.0102147772341122,0.010154944980623,0.0100941241679943,0.0100324390996508,0.00997001407901687,0.0099067659275368,0.00984165938482448,0.0097749338441545,0.00970706679091259,0.00963853571048454,0.00956981808825607,0.00950139140961293,0.00943373315994088,0.00936732082462566,0.00930237034151869,0.00923801496577403])
+            eps_data =  (n_data+1j*k_data)**2
+        elif material=='silicon_webber':
+            lambda_data = np.array([])
+            lambda_data = np.array([281.9774482,288.5350632,295.4049457,302.6099444,310.175193,318.128403,326.5002031,335.3245329,344.6391033,354.4859348,364.9119917,375.9699309,387.7189912,400.2260554,413.566924,427.8278524,443.1074185,459.5188044,477.1926046,496.2803087,516.9586549,539.4351182,563.9548963,590.8098914,620.3503859,653.0004062,689.2782066,729.8239835,775.4379824,827.1338479,886.21,954.39,1033.92,1127.91,886.214837,954.3852091,1033.91731,1127.909793])*1e-9
+            n_data = np.array([3.12,4.086,4.888,5.02,5.01,5.016,5.065,5.156,5.296,5.61,6.522,6.709,6.062,5.57,5.222,4.961,4.753,4.583,4.442,4.32,4.215,4.123,4.042,3.969,3.906,3.847,3.796,3.752,3.714,3.673,0,0,0,3.5341,3.6294,3.5923,3.5597,3.5341])
+            k_data = np.array([5.344,5.395,4.639,3.979,3.587,3.346,3.182,3.058,2.987,3.014,2.705,1.321,0.63,0.387,0.269,0.203,0.163,0.13,0.09,0.073,0.06,0.048,0.032,0.03,0.022,0.016,0.013,0.01,0.008,0.005,7.75e-3,2.26e-3,1.8e-4,1.3e-5,0.00775,0.00226,0.00018,0.000013])
+            eps_data =  (n_data+1j*k_data)**2
+        elif material=='silicon_internet': #
+            lambda_data = np.array([])
+            lambda_data = 1e-9*np.array([250,260,270,280,290,300,310,320,330,340,350,360,370,380,390,400,410,420,430,440,450,460,470,480,490,500,510,520,530,540,550,560,570,580,590,600,610,620,630,640,650,660,670,680,690,700,710,720,730,740,750,760,770,780,790,800,810,820,830,840,850,860,870,880,890,900,910,920,930,940,950,960,970,980,990,1000])
+            n_data = np.array([1.694,1.8,2.129,3.052,4.426,5.055,5.074,5.102,5.179,5.293,5.483,6.014,6.863,6.548,5.976,5.587,5.305,5.091,4.925,4.793,4.676,4.577,4.491,4.416,4.348,4.293,4.239,4.192,4.15,4.11,4.077,4.044,4.015,3.986,3.962,3.939,3.916,3.895,3.879,3.861,3.844,3.83,3.815,3.8,3.787,3.774,3.762,3.751,3.741,3.732,3.723,3.714,3.705,3.696,3.688,3.681,3.674,3.668,3.662,3.656,3.65,3.644,3.638,3.632,3.626,3.62,3.614,3.608,3.602,3.597,3.592,3.587,3.582,3.578,3.574,3.57])
+            k_data = np.array([3.666,4.072,4.69,5.258,5.16,4.128,3.559,3.269,3.085,2.951,2.904,2.912,2.051,0.885,0.465,0.303,0.22,0.167,0.134,0.109,0.091,0.077,0.064,0.057,0.05,0.045,0.039,0.036,0.033,0.03,0.028,0.026,0.024,0.023,0.021,0.02,0.018,0.017,0.016,0.015,0.015,0.014,0.013,0.012,0.011,0.011,0.011,0.01,0.009,0.008,0.008,0.007,0.007,0.006,0.006,0.005,0.005,0.005,0.004,0.004,0.004,0.003,0.003,0.003,0.002,0.002,0.002,0.002,0.002,0.001,0.001,0.001,0.001,0.001,0.001,0.001])
+            eps_data =  (n_data+1j*k_data)**2
+        else:
+            print('Weird, look at your epsilon file!')
+        n   = interp1d(lambda_data,n_data)
+        k   = interp1d(lambda_data,k_data)
+        eps = interp1d(lambda_data,eps_data)
+        return n(wavelength), k(wavelength), eps(wavelength)
\ No newline at end of file
diff --git a/DiffractionGratingsTopOpt/topopt_conical.geo b/DiffractionGratingsTopOpt/topopt_conical.geo
new file mode 100644
index 0000000..8cd6ef7
--- /dev/null
+++ b/DiffractionGratingsTopOpt/topopt_conical.geo
@@ -0,0 +1,71 @@
+/*
+© Simon Ans
+File : topopt_conical.geo
+
+Construction of the geometry of the periodical grating made with sticks using
+the data in param.dat. The geometry is detailed in resolution_functions.set_data.
+*/
+
+Include "param.dat";
+SetFactory("OpenCASCADE");
+
+ref_paramaille = 400 * nm / paramaille;
+lc_pmlSup      = ref_paramaille / paramaille_pmlSup;
+lc_superstrate = ref_paramaille / paramaille_superstrate;
+lc_slide       = ref_paramaille / paramaille_design;
+lc_substrate   = ref_paramaille / paramaille_substrate;
+lc_pmlInf      = ref_paramaille / paramaille_pmlInf;
+
+geometry_sup = h_super + h_PML_sup;
+geometry_inf = h_subs  + h_PML_inf;
+
+// Box
+Rectangle(1) = {-period/2, h_super      , 0, period, h_PML_sup};
+Rectangle(2) = {-period/2, h_design     , 0, period, h_super - h_design};
+Rectangle(3) = {-period/2, 0            , 0, period, h_design};
+Rectangle(4) = {-period/2, -h_subs      , 0, period, h_subs};
+Rectangle(5) = {-period/2, -geometry_inf, 0, period, h_PML_inf};
+
+Coherence;
+
+Lines_Left()    = Line In BoundingBox{-period/2 - 1, -geometry_inf - 1, -1, -period/2 + 1,  geometry_sup + 1, 1};
+Lines_Right()   = Line In BoundingBox{ period/2 - 1, -geometry_inf - 1, -1,  period/2 + 1,  geometry_sup + 1, 1};
+Lines_Up()      = Line In BoundingBox{-period/2 - 1,  geometry_sup - 1, -1,  period/2 + 1,  geometry_sup + 1, 1};
+Lines_Down()    = Line In BoundingBox{-period/2 - 1, -geometry_inf - 1, -1,  period/2 + 1, -geometry_inf + 1, 1};
+Lines_Super()   = Line In BoundingBox{-period/2 - 1,  h_super      - 1, -1,  period/2 + 1,  h_super      + 1, 1};
+Lines_Sub()     = Line In BoundingBox{-period/2 - 1, -h_subs       - 1, -1,  period/2 + 1, -h_subs       + 1, 1};
+
+phys_plot_bnd()  = Lines_Super();
+phys_plot_bnd() += Line In BoundingBox{-period/2 - 1, h_design - 1, -1,  period/2 + 1, h_design + 1, 1};
+phys_plot_bnd() += Line In BoundingBox{-period/2 - 1,         - 1, -1,  period/2 + 1,         + 1, 1};
+phys_plot_bnd() += Lines_Sub() ;
+
+Physical Line(SURF_LEFT)  = Lines_Left();
+Physical Line(SURF_RIGHT) = Lines_Right();
+Physical Line(SURF_UP)    = Lines_Up();
+Physical Line(SURF_DOWN)  = Lines_Down();
+
+Physical Line(SURF_INTEG_SUP) = Lines_Super(); // superstrate/pml cut
+Physical Line(SURF_INTEG_SUB) = Lines_Sub();   // substrate/pml cut
+Physical Line(SURF_PLOT) = phys_plot_bnd[];    // final plot
+
+Physical Surface(PML_SUP)     = {1};
+Physical Surface(SUPERSTRATE) = {2};
+Physical Surface(DESIGN)      = {3};
+Physical Surface(SUBSTRATE)   = {4};
+Physical Surface(PML_INF)     = {5};
+
+Characteristic Length{PointsOf{Physical Surface{PML_SUP};}}     = lc_pmlSup;
+Characteristic Length{PointsOf{Physical Surface{PML_INF};}}     = lc_pmlInf;
+Characteristic Length{PointsOf{Physical Surface{SUPERSTRATE};}} = lc_superstrate;
+Characteristic Length{PointsOf{Physical Surface{SUBSTRATE};}}   = lc_substrate;
+Characteristic Length{PointsOf{Physical Surface{DESIGN};}}      = lc_slide;
+
+Periodic Line {Lines_Left()} = {Lines_Right()} Translate {period,0,0};
+
+Mesh 2;
+Save "topopt_conical.msh";
+
+Delete Physicals;
+Physical Surface(DESIGN) = {3};
+Save "design_region.msh"; 
\ No newline at end of file
diff --git a/DiffractionGratingsTopOpt/topopt_conical.pro b/DiffractionGratingsTopOpt/topopt_conical.pro
new file mode 100644
index 0000000..2f08a8a
--- /dev/null
+++ b/DiffractionGratingsTopOpt/topopt_conical.pro
@@ -0,0 +1,576 @@
+/*
+File : fictiveLamellarGratings_conical.pro
+
+Strating from the geometry computed by fictiveLamellar_conical.geo, this program
+uses the open source environment GetDP to solve the reflexion and transmission
+problem on the sticks grating.
+*/
+
+Include "param.dat";
+
+myDir_init = "res_conical/";
+myDir      = "../res_conical/";
+lambda0 = lambda_wavelength * nm;
+
+Group {
+    // Boundaries
+    surfLeft           = Region[SURF_LEFT];
+    surfRight          = Region[SURF_RIGHT];
+    surfUp             = Region[SURF_UP];
+    surfDown           = Region[SURF_DOWN];
+    surfCutSuperstrate = Region[SURF_INTEG_SUP];
+    surfCutSubstrate   = Region[SURF_INTEG_SUB];
+  
+    // Domains
+    pmlSup         = Region[PML_SUP];
+    superstrate    = Region[{SUPERSTRATE, SURF_INTEG_SUP}];
+    substrate      = Region[{SUBSTRATE, SURF_INTEG_SUB}];
+    If (Flag_pml_inf == 1)
+        pmlInf         = Region[PML_INF];
+    Else
+        pmlInf         = Region[{}];
+    EndIf
+    design         = Region[DESIGN];
+    Omega_source   = Region[{design}];
+    Omega_nosource = Region[{pmlSup, pmlInf, superstrate, substrate}];
+    Omega          = Region[{Omega_source, Omega_nosource}];
+    Omega_top      = Region[{superstrate, design}];
+    Omega_bot      = Region[{substrate}];
+    Omega_pml      = Region[{pmlSup, pmlInf}];
+
+    Plot_domain    = Region[{Omega, -pmlSup, -pmlInf}];
+    Plot_bnd       = Region[SURF_PLOT];
+    Print_point    = Region[PRINT_POINT];
+
+    Omega_DefTr    = Region[{SUBSTRATE, SUPERSTRATE}];  
+    Gama           = Region[{surfCutSubstrate, surfCutSuperstrate}];
+    Tr             = ElementsOf[Omega_DefTr, ConnectedTo Gama];
+}
+
+Function{
+    I[]  = Complex[0.,1.];
+    EX[] = Vector[1,0,0];
+    EZ[] = Vector[0,0,1];
+    bndCol[Plot_bnd] = Complex[1.,1.];
+
+    om0         = 2.*Pi*cel/lambda0;
+    k0          = 2.*Pi/lambda0;
+    epsrSuper[] = Complex[epsilon_r_super_re, epsilon_r_super_im];
+    murSuper[]  = Complex[mu_r_super_re, mu_r_super_im];
+    epsrMin[]   = Complex[epsilon_r_min_re, epsilon_r_min_im];
+    epsrMax[]   = Complex[epsilon_r_max_re, epsilon_r_max_im];
+    murVoxel[]  = Complex[mu_r_voxel_re, mu_r_voxel_im];
+    epsrSubs[]  = Complex[epsilon_r_subs_re,  epsilon_r_subs_im];
+    murSubs[]   = Complex[mu_r_subs_re, mu_r_subs_im];
+    k1norm[]    = k0*n_super;
+    k2norm[]    = k0*n_subs;
+
+    Ae      = A;
+    theta_i = theta_incidence * deg2rad;
+    phi_i   = phi_incidence   * deg2rad;
+    psi_i   = psi_incidence   * deg2rad;
+
+    alpha[] = -k0*n_super*Sin[theta_i]*Sin[phi_i];
+    beta1[] = -k0*n_super*Cos[theta_i];
+    gamma[] = -k0*n_super*Sin[theta_i]*Cos[phi_i];
+    beta2[] = -Sqrt[k0^2*epsrSubs[]-alpha[]^2-gamma[]^2];
+
+    k1[]  = Vector[alpha[], beta1[], gamma[]];
+    k1r[] = Vector[alpha[],-beta1[], gamma[]];
+    k2[]  = Vector[alpha[], beta2[], gamma[]];
+
+    rs[] = (beta1[]-beta2[])/(beta1[]+beta2[]);
+    ts[] =       2.*beta1[] /(beta1[]+beta2[]);
+    rp[] = (beta1[]*epsrSubs[]-beta2[]*epsrSuper[])/(beta1[]*epsrSubs[]+beta2[]*epsrSuper[]);
+    tp[] =                  (2.*beta1[]*epsrSubs[])/(beta1[]*epsrSubs[]+beta2[]*epsrSuper[]);
+
+    spol[]    = Vector[-Cos[phi_i],0,Sin[phi_i]];
+    AmplEis[] =      spol[];
+    AmplErs[] = rs[]*spol[];
+    AmplEts[] = ts[]*spol[];
+    AmplHis[] = Sqrt[ep0*epsrSuper[]/mu0]     *spol[];
+    AmplHrs[] = Sqrt[ep0*epsrSuper[]/mu0]*rp[]*spol[];
+    AmplHts[] = Sqrt[ep0*epsrSuper[]/mu0]*tp[]*spol[];
+
+    Eis[]     = AmplEis[] * Exp[I[]*k1[] *XYZ[]];
+    Ers[]     = AmplErs[] * Exp[I[]*k1r[]*XYZ[]];
+    Ets[]     = AmplEts[] * Exp[I[]*k2[] *XYZ[]];
+    His[]     = AmplHis[] * Exp[I[]*k1[] *XYZ[]];
+    Hrs[]     = AmplHrs[] * Exp[I[]*k1r[]*XYZ[]];
+    Hts[]     = AmplHts[] * Exp[I[]*k2[] *XYZ[]];
+    Eip[]     = -1/(om0*ep0*epsrSuper[]) * k1[]  /\ His[];
+    Erp[]     = -1/(om0*ep0*epsrSuper[]) * k1r[] /\ Hrs[];
+    Etp[]     = -1/(om0*ep0*epsrSubs[])  * k2[]  /\ Hts[];
+
+    BlochX_phase_shift[]     = Exp[ I[]*alpha[]*period];
+    BlochX_phase_shift_adj[] = Exp[-I[]*alpha[]*period];
+
+    For i_order In {0:2*nb_orders}
+        alpha~{i_order}[]       = CompX[k1[]] + 2*Pi/period * (i_order-nb_orders);
+        expmialphax~{i_order}[] = Exp[-I[]*alpha~{i_order}[]*X[]];
+        beta_super~{i_order}[]  = -Sqrt[k0^2*epsrSuper[] - alpha~{i_order}[]^2 - gamma[]^2];
+        beta_subs~{i_order}[]   = -Sqrt[k0^2*epsrSubs[]  - alpha~{i_order}[]^2 - gamma[]^2];
+    EndFor
+
+    a_pml        = 1.;
+    b_pml        = 1.;
+    sx           = 1.;
+    sy[]         = Complex[a_pml,b_pml]; 
+    sz           = 1.;
+    PML_Tensor[] = TensorDiag[sz*sy[]/sx, sx*sz/sy[], sx*sy[]/sz];
+
+    epsilonr[pmlSup]      = epsilon_r_super_re * PML_Tensor[];
+    epsilonr[superstrate] = epsrSuper[]        * TensorDiag[1,1,1];
+    If (Flag_design_metal == 0)
+        epsilonr[design]  = ((epsrMax[] - epsrMin[]) * ScalarField[XYZ[]]{10000} + epsrMin[]) * TensorDiag[1,1,1];
+    Else
+        nDesign[design]   = ((n_max - n_min) * ScalarField[XYZ[]]{10000} + n_min);
+        kDesign[design]   = ((k_max - k_min) * ScalarField[XYZ[]]{10000} + k_min);
+        epsilonr[design]  = (nDesign[] + I[]*kDesign[])^2 * TensorDiag[1,1,1];
+    EndIf
+    epsilonr[substrate]   = epsrSubs[]         * TensorDiag[1,1,1];
+    epsilonr[pmlInf]      = epsilon_r_subs_re  * PML_Tensor[];
+
+    epsilonr_annex[pmlSup]       = epsilon_r_super_re * PML_Tensor[];
+    epsilonr_annex[superstrate]  = epsrSuper[]        * TensorDiag[1,1,1];
+    epsilonr_annex[Omega_source] = epsrSuper[]        * TensorDiag[1,1,1];
+    epsilonr_annex[substrate]    = epsrSubs[]         * TensorDiag[1,1,1];
+    epsilonr_annex[pmlInf]       = epsilon_r_subs_re  * PML_Tensor[];
+
+    mur[pmlSup]       = PML_Tensor[];
+    mur[superstrate]  = TensorDiag[1,1,1];
+    mur[Omega_source] = TensorDiag[1,1,1];
+    mur[substrate]    = TensorDiag[1,1,1];
+    mur[pmlInf]       = PML_Tensor[];
+
+    Ei[] = Ae*(Cos[psi_i]*Eip[]-Sin[psi_i]*Eis[]);
+    Er[] = Ae*(Cos[psi_i]*Erp[]-Sin[psi_i]*Ers[]);
+    Et[] = Ae*(Cos[psi_i]*Etp[]-Sin[psi_i]*Ets[]);
+    Hi[] = 1/(om0*mu0*mur[]) * k1[]  /\ Ei[];
+    Hr[] = 1/(om0*mu0*mur[]) * k1r[] /\ Er[];
+    Ht[] = 1/(om0*mu0*mur[]) * k2[]  /\ Et[];
+
+    E1[pmlSup]     = Ei[]+Er[];
+    E1[Omega_top]  = Ei[]+Er[];
+    E1[Omega_bot]  = Et[];  
+    E1[pmlInf]     = Et[];  
+    E1d[pmlSup]    = Er[];
+    E1d[Omega_top] = Er[];
+    E1d[Omega_bot] = Et[];
+    E1d[pmlInf]    = Et[];
+    E1t[]  = Vector[CompX[E1[]] , CompY[E1[]] ,    0        ];
+    E1l[]  = Vector[     0      ,      0      , CompZ[E1[]] ];
+    E1dt[] = Vector[CompX[E1d[]], CompY[E1d[]],    0        ];
+    E1dl[] = Vector[     0      ,      0      , CompZ[E1d[]]];
+
+    Etot_transfer[] = ComplexVectorField[XYZ[]]{1000};
+    comp_amp_deriv_x_r_transfer[] = ComplexScalarField[XYZ[]]{2000};
+    comp_amp_deriv_z_r_transfer[] = ComplexScalarField[XYZ[]]{2002};
+
+    H1[pmlSup]     = Hi[]+Hr[];
+    H1[Omega_top]  = Hi[]+Hr[];
+    H1[Omega_bot]  = Ht[];
+    H1[pmlInf]     = Ht[];
+    H1d[Omega_top] = Hr[];
+    H1d[Omega_bot] = Ht[];
+
+    Pinc[] = 0.5*Ae^2*Sqrt[epsrSuper[]*ep0/mu0] * Cos[theta_i];
+}
+
+Constraint {
+    {Name Bloch;
+        Case {
+            { Region surfRight; Type LinkCplx ; RegionRef surfLeft;
+                Coefficient BlochX_phase_shift[]; Function Vector[$X-period,$Y,$Z] ;
+            }
+        }
+    }
+    {Name Bloch_adj;
+        Case {
+            { Region surfRight; Type LinkCplx ; RegionRef surfLeft;
+                Coefficient BlochX_phase_shift_adj[]; Function Vector[$X-period,$Y,$Z] ;
+            }
+        }
+    }
+}
+
+Jacobian {
+    { Name JVol ;
+        Case { 
+            { Region All ; Jacobian Vol ; }
+        }
+    }
+    { Name JSur ;
+        Case {
+            { Region All ; Jacobian Sur ; }
+        }
+    }
+}
+
+Integration {
+    If (Flag_o2_geom==0)
+        { Name Int_1 ;
+            Case { 
+                { Type Gauss ;
+                    Case { 
+                        { GeoElement Point    ; NumberOfPoints  1 ; }
+                        { GeoElement Line     ; NumberOfPoints  4 ; }
+                        { GeoElement Triangle ; NumberOfPoints  12 ; }
+                    }
+                }
+            }   
+        }
+    EndIf
+    If (Flag_o2_geom==1)
+        { Name Int_1 ;
+            Case { 
+            { Type Gauss ;
+                Case { 
+                    { GeoElement Point     ; NumberOfPoints  1 ; }
+                    { GeoElement Line2     ; NumberOfPoints  4 ; }
+                    { GeoElement Triangle2 ; NumberOfPoints  12 ; }
+                }
+            }
+        }
+    }
+    EndIf
+    { Name GaussOnePoint ;
+        Case {
+        { Type Gauss ;
+            Case {
+                { GeoElement Point    ; NumberOfPoints  1; }
+                { GeoElement Line     ; NumberOfPoints  1; }
+                { GeoElement Triangle ; NumberOfPoints  1; }
+            }
+        }
+    }
+}
+}
+
+FunctionSpace {
+    { Name Hcurl; Type Form1;
+        BasisFunction {
+            { Name se ; NameOfCoef he ; Function BF_Edge     ; Support Omega; Entity EdgesOf[All]; }
+            { Name se2; NameOfCoef he2; Function BF_Edge_2E  ; Support Omega; Entity EdgesOf[All]; }
+            If (Flag_o2_interp==1)
+                { Name se3; NameOfCoef he3; Function BF_Edge_3F_b; Support Omega; Entity FacetsOf[All]; }
+                { Name se4; NameOfCoef he4; Function BF_Edge_3F_c; Support Omega; Entity FacetsOf[All]; }
+                { Name se5; NameOfCoef he5; Function BF_Edge_4E  ; Support Omega; Entity EdgesOf[All]; }
+            EndIf
+        }
+        Constraint {
+            { NameOfCoef he ; EntityType EdgesOf ; NameOfConstraint Bloch; }
+            { NameOfCoef he2; EntityType EdgesOf ; NameOfConstraint Bloch; }
+            If (Flag_o2_interp==1)
+                { NameOfCoef he5; EntityType EdgesOf ; NameOfConstraint Bloch; }
+            EndIf
+        }
+    }
+    { Name Hcurl_adj; Type Form1;
+        BasisFunction {
+            { Name se ; NameOfCoef he ; Function BF_Edge     ; Support Omega; Entity EdgesOf[All]; }
+            { Name se2; NameOfCoef he2; Function BF_Edge_2E  ; Support Omega; Entity EdgesOf[All]; }
+            If (Flag_o2_interp==1)
+                { Name se3; NameOfCoef he3; Function BF_Edge_3F_b; Support Omega; Entity FacetsOf[All]; }
+                { Name se4; NameOfCoef he4; Function BF_Edge_3F_c; Support Omega; Entity FacetsOf[All]; }
+                { Name se5; NameOfCoef he5; Function BF_Edge_4E  ; Support Omega; Entity EdgesOf[All]; }
+            EndIf
+        }
+        Constraint {
+            { NameOfCoef he ; EntityType EdgesOf ; NameOfConstraint Bloch_adj; }
+            { NameOfCoef he2; EntityType EdgesOf ; NameOfConstraint Bloch_adj; }
+            If (Flag_o2_interp==1)
+                { NameOfCoef he5; EntityType EdgesOf ; NameOfConstraint Bloch_adj; }
+            EndIf
+        }
+    }
+
+    { Name Hgrad_perp; Type Form1P;
+        BasisFunction {
+            { Name sn ; NameOfCoef hn ; Function BF_PerpendicularEdge   ; Support Omega; Entity NodesOf[All]; }
+            { Name sn2; NameOfCoef hn2; Function BF_PerpendicularEdge_2E; Support Omega; Entity EdgesOf[All]; }
+            /* If (Flag_o2_interp==1)
+                { Name sn3; NameOfCoef hn3; Function BF_PerpendicularEdge_2F; Support Omega; Entity FacetsOf[All]; }
+                { Name sn4; NameOfCoef hn4; Function BF_PerpendicularEdge_3E; Support Omega; Entity EdgesOf[All]; }
+                { Name sn5; NameOfCoef hn5; Function BF_PerpendicularEdge_3F; Support Omega; Entity FacetsOf[All]; }
+            EndIf */
+            // BF_PerpendicularEdge_2F, 1., QUA|HEX|PRI, 0 },
+            // BF_PerpendicularEdge_2V, 1., QUA|HEX, 0 },
+            // BF_PerpendicularEdge_3E, 2., ALL, 0 },
+            // BF_PerpendicularEdge_3F, 2., TRI|QUA|TET|HEX|PRI, 0 },
+            // BF_PerpendicularEdge_3V, 2., HEX|PRI, 0 },
+        }
+        Constraint {
+            { NameOfCoef hn ; EntityType NodesOf ; NameOfConstraint Bloch; }
+            { NameOfCoef hn2; EntityType EdgesOf ; NameOfConstraint Bloch; }
+            /* If (Flag_o2_interp==1)
+                { NameOfCoef hn4; EntityType EdgesOf ; NameOfConstraint Bloch; }
+            EndIf */
+        }
+    }
+    { Name Hgrad_perp_adj; Type Form1P;
+        BasisFunction {
+            { Name sn ; NameOfCoef hn ; Function BF_PerpendicularEdge   ; Support Omega; Entity NodesOf[All]; }
+            { Name sn2; NameOfCoef hn2; Function BF_PerpendicularEdge_2E; Support Omega; Entity EdgesOf[All]; }
+            /* If (Flag_o2_interp==1)
+                { Name sn3; NameOfCoef hn3; Function BF_PerpendicularEdge_2F; Support Omega; Entity FacetsOf[All]; }
+                { Name sn4; NameOfCoef hn4; Function BF_PerpendicularEdge_3E; Support Omega; Entity EdgesOf[All]; }
+                { Name sn5; NameOfCoef hn5; Function BF_PerpendicularEdge_3F; Support Omega; Entity FacetsOf[All]; }
+            EndIf */
+            // BF_PerpendicularEdge_2F, 1., QUA|HEX|PRI, 0 },
+            // BF_PerpendicularEdge_2V, 1., QUA|HEX, 0 },
+            // BF_PerpendicularEdge_3E, 2., ALL, 0 },
+            // BF_PerpendicularEdge_3F, 2., TRI|QUA|TET|HEX|PRI, 0 },
+            // BF_PerpendicularEdge_3V, 2., HEX|PRI, 0 },
+        }
+        Constraint {
+            { NameOfCoef hn ; EntityType NodesOf ; NameOfConstraint Bloch_adj; }
+            { NameOfCoef hn2; EntityType EdgesOf ; NameOfConstraint Bloch_adj; }
+            /* If (Flag_o2_interp==1)
+                { NameOfCoef hn4; EntityType EdgesOf ; NameOfConstraint Bloch_adj; }
+            EndIf */
+        }
+    }
+
+    { Name H_DensityField; Type Form3;
+        BasisFunction {
+            { Name sxn ; NameOfCoef uxn ; Function BF_Volume ; Support design; Entity VolumesOf[All] ; }
+        }
+    }
+}
+
+Formulation {
+    // Trivial formulation to get the density field on each element of the mesh
+    {Name form_init_density; Type FemEquation;
+        Quantity {
+            { Name rho; Type Local; NameOfSpace H_DensityField;}
+        }
+        Equation {
+            Galerkin { [ Dof{rho} , {rho} ]; In design; Jacobian JVol; Integration GaussOnePoint; }
+            Galerkin { [        1 , {rho} ]; In design; Jacobian JVol; Integration GaussOnePoint; }
+        }
+    }
+    // Trivial formulation to project the derivatives field on each element of the mesh
+    {Name form_project_adjoint_x; Type FemEquation;
+        Quantity {
+            { Name drho_x; Type Local; NameOfSpace H_DensityField;}}
+        Equation {
+            Galerkin { [  Dof{drho_x}                   , {drho_x} ]; In design; Jacobian JVol; Integration GaussOnePoint; }
+            Galerkin { [ -comp_amp_deriv_x_r_transfer[] , {drho_x} ]; In design; Jacobian JVol; Integration GaussOnePoint; }
+        }
+    }
+    {Name form_project_adjoint_z; Type FemEquation;
+        Quantity {
+            { Name drho_z; Type Local; NameOfSpace H_DensityField;}}
+        Equation {
+            Galerkin { [  Dof{drho_z}                   , {drho_z} ]; In design; Jacobian JVol; Integration GaussOnePoint; }
+            Galerkin { [ -comp_amp_deriv_z_r_transfer[] , {drho_z} ]; In design; Jacobian JVol; Integration GaussOnePoint; }
+        }
+    }
+
+    // {d El} = -EZ /\ grad El
+    { Name helmholtz_conical; Type FemEquation;
+        Quantity {
+            { Name Et; Type Local; NameOfSpace Hcurl; }
+            { Name El; Type Local; NameOfSpace Hgrad_perp; }
+        }
+        Equation {
+            Galerkin {[ 1/mur[] * Dof{d Et}                          , {d Et}     ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ 1/mur[] * Dof{d El}                          , {d El}     ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[-Complex[0,gamma[]]  /mur[] * Dof{d El}       , EZ[]*^{Et} ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ Complex[0,gamma[]]  /mur[] * (EZ[]*^Dof{Et}) , {d El}     ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[           gamma[]^2 /mur[] * (EZ[]*^Dof{Et}) , EZ[]*^{Et} ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            
+            Galerkin {[ -k0^2 * epsilonr[] * Dof{Et}                 , {Et}      ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ -k0^2 * epsilonr[] * Dof{El}                 , {El}      ] ; In Omega; Integration Int_1; Jacobian JVol; }
+
+            Galerkin {[ -k0^2 * (epsilonr[]-epsilonr_annex[]) * E1t[] , {Et} ] ; In Omega_source; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ -k0^2 * (epsilonr[]-epsilonr_annex[]) * E1l[] , {El} ] ; In Omega_source; Integration Int_1; Jacobian JVol; }
+        }
+    }
+    { Name helmholtz_conical_adj; Type FemEquation;
+        Quantity {
+            { Name Et_adj; Type Local; NameOfSpace Hcurl_adj; }
+            { Name El_adj; Type Local; NameOfSpace Hgrad_perp_adj; }
+        }
+        Equation {
+            Galerkin {[ 1/mur[] * Dof{d Et_adj}                           , {d Et_adj}     ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ 1/mur[] * Dof{d El_adj}                           , {d El_adj}     ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ Complex[0,gamma[]]  / mur[] * Dof{d El_adj}       , EZ[]*^{Et_adj} ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[-Complex[0,gamma[]]  / mur[] * (EZ[]*^Dof{Et_adj}) , {d El_adj}     ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[           gamma[]^2 / mur[] * (EZ[]*^Dof{Et_adj}) , EZ[]*^{Et_adj} ] ; In Omega; Integration Int_1; Jacobian JVol; }
+
+            Galerkin {[ -k0^2 * epsilonr[] * Dof{Et_adj}                  , {Et_adj}       ] ; In Omega; Integration Int_1; Jacobian JVol; }
+            Galerkin {[ -k0^2 * epsilonr[] * Dof{El_adj}                  , {El_adj}       ] ; In Omega; Integration Int_1; Jacobian JVol; }
+
+            // Tertiary operator to solve the adjoint problem on x or z with SolveAgain
+            Galerkin {[ -expmialphax~{target_order}[]/period * ($ibasis == 0 ? EX[] : 0) , {Et_adj} ] ; In surfCutSuperstrate; Jacobian JSur; Integration Int_1; }
+            Galerkin {[ -expmialphax~{target_order}[]/period * ($ibasis == 0 ? EX[] : 0) , {El_adj} ] ; In surfCutSuperstrate; Jacobian JSur; Integration Int_1; }
+            
+            Galerkin {[ -expmialphax~{target_order}[]/period * ($ibasis == 1 ? EZ[] : 0) , {Et_adj} ] ; In surfCutSuperstrate; Jacobian JSur; Integration Int_1; }
+            Galerkin {[ -expmialphax~{target_order}[]/period * ($ibasis == 1 ? EZ[] : 0) , {El_adj} ] ; In surfCutSuperstrate; Jacobian JSur; Integration Int_1; }
+        }
+    }
+}
+
+Resolution {
+    { Name res_init_densities;
+        System {
+            { Name D; NameOfFormulation form_init_density; }
+        }
+        Operation {
+            CreateDir[Str[myDir_init]];
+            Generate[D]; Solve[D]; PostOperation[postop_init_density];
+        }
+    }
+    { Name helmholtz_conical_direct_inverse;
+        System {
+            { Name S  ; NameOfFormulation helmholtz_conical      ; Type ComplexValue; }
+            { Name Sa ; NameOfFormulation helmholtz_conical_adj  ; Type ComplexValue; }
+            { Name Px ; NameOfFormulation form_project_adjoint_x ; Type ComplexValue; }
+            { Name Pz ; NameOfFormulation form_project_adjoint_z ; Type ComplexValue; }
+        }
+        Operation {
+            GmshRead["rho_opt.pos",10000];
+            Generate[S]    ; Solve[S]      ; PostOperation[postop_energy];
+            Evaluate[$ibasis = 0];     // Adjoint problem on x
+            Generate[Sa]   ; Solve[Sa]     ; PostOperation[postop_adj_x];
+            Generate[Px]   ; Solve[Px]     ; PostOperation[postop_project_adjoint_x];
+            Evaluate[$ibasis = 1];     // Adjoint problem on z
+            GenerateRHS[Sa]; SolveAgain[Sa]; PostOperation[postop_adj_z];
+            Generate[Pz]   ; Solve[Pz]     ; PostOperation[postop_project_adjoint_z];
+        }
+    }
+}
+
+
+PostProcessing {
+    { Name postpro_init_density; NameOfFormulation form_init_density; NameOfSystem D;
+        Quantity {
+            { Name density; Value { Local { [ {rho} ]; In design; Jacobian JVol; } } }
+        }
+    }
+    { Name postpro_project_adjoint_x; NameOfFormulation form_project_adjoint_x; NameOfSystem Px;
+        Quantity {
+            { Name comp_amp_deriv_x_r_project; Value { Local { [ ElementVol[]*{drho_x} ]; In design; Jacobian JVol; } } }
+        }
+    }
+    { Name postpro_project_adjoint_z; NameOfFormulation form_project_adjoint_z; NameOfSystem Pz;
+        Quantity {
+            { Name comp_amp_deriv_z_r_project; Value { Local { [ ElementVol[]*{drho_z} ]; In design; Jacobian JVol; } } }
+        }
+    }
+    { Name postpro_energy; NameOfFormulation helmholtz_conical; NameOfSystem S;
+        Quantity {
+            { Name boundary ; Value { Local { [ bndCol[]             ]; In Plot_bnd ; Jacobian JVol; } } }
+            //{ Name Etot_z   ; Value { Local { [ CompZ[{Et}+{El}+E1[]]]; In Omega; Jacobian JVol; } } }
+            { Name Etot     ; Value { Local { [ {Et}+{El}+E1[]       ]; In Omega; Jacobian JVol; } } }
+            //{ Name epsr     ; Value { Local { [ CompZZ[epsilonr[]]   ]; In Omega; Jacobian JVol; } } }
+            { Name Q_tot    ; Value { Integral{ [0.5*ep0*om0 * Fabs[Im[CompZZ[epsilonr[]]]] * ( SquNorm[{Et}+{El}+E1[]] ) / (Pinc[]*period) ] ; In Plot_domain ; Integration Int_1 ; Jacobian JVol ; } } }
+
+            For i_order In {0:2*nb_orders}
+                { Name comp_amp_x_r~{i_order} ; Value{ Integral{ [ CompX[{Et}+E1dt[]] * expmialphax~{i_order}[]/period ] ; In surfCutSuperstrate ; Integration Int_1 ; Jacobian JSur ; } } }
+                { Name comp_amp_z_r~{i_order} ; Value{ Integral{ [ CompZ[{El}+E1dl[]] * expmialphax~{i_order}[]/period ] ; In surfCutSuperstrate ; Integration Int_1 ; Jacobian JSur ; } } }
+
+                { Name comp_amp_x_t~{i_order} ; Value{ Integral{ [ CompX[{Et}+E1t[]]  * expmialphax~{i_order}[]/period ] ; In surfCutSubstrate   ; Integration Int_1 ; Jacobian JSur ; } } }
+                { Name comp_amp_z_t~{i_order} ; Value{ Integral{ [ CompZ[{El}+E1l[]]  * expmialphax~{i_order}[]/period ] ; In surfCutSubstrate   ; Integration Int_1 ; Jacobian JSur ; } } }
+            EndFor
+
+            For i_order In {0:2*nb_orders}
+                { Name eff_r~{i_order} ; Value { Term{Type Global; [
+                        1/(Ae^2*beta_super~{i_order}[]*beta1[]) * ((beta_super~{i_order}[]^2 + alpha~{i_order}[]^2) * SquNorm[$comp_ampx_r~{i_order}]
+                                                                +  (beta_super~{i_order}[]^2 + gamma[]^2)           * SquNorm[$comp_ampz_r~{i_order}]
+                                                                +   2*alpha~{i_order}[]*gamma[] * Re[$comp_ampx_r~{i_order}*Conj[$comp_ampz_r~{i_order}]]) ] ; In surfCutSuperstrate ; } } }
+                        
+                { Name eff_t~{i_order} ; Value { Term{Type Global; [
+                        1/(Ae^2*beta_subs~{i_order}[]*beta1[])  * ((beta_subs~{i_order}[]^2 + alpha~{i_order}[]^2) * SquNorm[$comp_ampx_t~{i_order}]
+                                                                +  (beta_subs~{i_order}[]^2 + gamma[]^2)           * SquNorm[$comp_ampz_t~{i_order}]
+                                                                +   2*alpha~{i_order}[]*gamma[] * Re[$comp_ampx_t~{i_order}*Conj[$comp_ampz_t~{i_order}]]) ] ; In surfCutSubstrate ; } } }
+            EndFor
+        }
+    }
+    { Name postpro_adj_x; NameOfFormulation helmholtz_conical_adj; NameOfSystem Sa;
+        Quantity {
+            //{ Name Eadj_x             ; Value { Local { [ {Et_adj}+{El_adj} ]        ; In Omega ; Jacobian JVol; } } }
+            //{ Name Eadj_projx         ; Value { Local { [ CompX[{Et_adj}+{El_adj}] ] ; In Omega ; Jacobian JVol; } } }
+            If (Flag_design_metal == 0)
+                { Name comp_amp_deriv_x_r ; Value { Local { [ k0^2 * (epsilon_r_max_re - epsilon_r_min_re) * Etot_transfer[] * ({Et_adj} + {El_adj}) ]; In design; Jacobian JVol; } } }
+            Else
+                { Name comp_amp_deriv_x_r ; Value { Local { [ 2 * k0^2  * (n_max-n_min + I[]*(k_max-k_min))
+                                                                        * (n_min+I[]*k_min + ScalarField[XYZ[]]{10000} * (n_max-n_min + I[]*(k_max-k_min)))
+                                                                        * Etot_transfer[] * ({Et_adj} + {El_adj}) ]; In design; Jacobian JVol; } } }
+            EndIf
+        }
+    }
+    { Name postpro_adj_z; NameOfFormulation helmholtz_conical_adj; NameOfSystem Sa;
+        Quantity {
+            //{ Name Eadj_z             ; Value { Local { [ {Et_adj}+{El_adj} ]        ; In Omega ; Jacobian JVol; } } }
+            //{ Name Eadj_projz         ; Value { Local { [ CompZ[{Et_adj}+{El_adj}] ] ; In Omega ; Jacobian JVol; } } }
+            If (Flag_design_metal == 0)
+                { Name comp_amp_deriv_z_r ; Value { Local { [ k0^2 * (epsilon_r_max_re - epsilon_r_min_re) * Etot_transfer[] * ({Et_adj} + {El_adj}) ]; In design; Jacobian JVol; } } }
+            Else
+                { Name comp_amp_deriv_z_r ; Value { Local { [ 2 * k0^2  * (n_max-n_min + I[]*(k_max-k_min))
+                                                                        * (n_min+I[]*k_min + ScalarField[XYZ[]]{10000} * (n_max-n_min + I[]*(k_max-k_min)))
+                                                                        * Etot_transfer[] * ({Et_adj} + {El_adj}) ]; In design; Jacobian JVol; } } }
+            EndIf
+        }
+    }
+}
+
+PostOperation {
+    { Name postop_init_density; NameOfPostProcessing postpro_init_density ;
+        Operation {
+            // template_density_table.pos is a template file that stores the position of each triangle of the mesh
+            Print[ density, OnElementsOf design, StoreInField (10000), File StrCat[myDir_init, "template_density_table.pos"]];
+        }
+    }
+    { Name postop_project_adjoint_x; NameOfPostProcessing postpro_project_adjoint_x ;
+        Operation {
+            Print[ comp_amp_deriv_x_r_project, OnElementsOf design, File StrCat[myDir, Sprintf("comp_amp_deriv_x_r_project_%g.pos", i_lambda)]];
+        }
+    }
+    { Name postop_project_adjoint_z; NameOfPostProcessing postpro_project_adjoint_z ;
+        Operation {
+            Print[ comp_amp_deriv_z_r_project, OnElementsOf design, File StrCat[myDir, Sprintf("comp_amp_deriv_z_r_project_%g.pos", i_lambda)]];
+        }
+    }
+    { Name postop_energy; NameOfPostProcessing postpro_energy ;
+        Operation {
+            Print[ boundary, OnElementsOf Plot_bnd, File StrCat[myDir, "boundary.pos"] ] ;
+            //Print[ Etot, OnGrid {$A, $B, 0} {-period/2:period/2:period/10, -h_subs:h_super:(h_super+h_subs)/30, 0}, File StrCat[myDir, "Etot.pos"] ];
+            //Print[ Etot_z, OnElementsOf Omega, File StrCat[myDir, Sprintf("Etot_z_%g.pos", i_lambda)]];
+            Print[ Etot  , OnElementsOf Plot_domain, StoreInField (1000), File StrCat[myDir, Sprintf("Etot_%g.pos", i_lambda)]];
+            //Print[ epsr  , OnElementsOf Plot_domain, File StrCat[myDir, Sprintf("epsr_%g.pos", i_lambda)]];
+            Print[ Q_tot[Plot_domain], OnGlobal, Format FrequencyTable, File StrCat[myDir, Sprintf("absorption-Q_tot_%g.txt", i_lambda)]];
+
+            For i_order In {0:2*nb_orders}
+                Print[ comp_amp_x_r~{i_order}[surfCutSuperstrate], OnGlobal, StoreInVariable $comp_ampx_r~{i_order}, Format Table, File StrCat[myDir, Sprintf("comp_amp_x_r_%g_%g.txt",i_order-nb_orders,i_lambda)]];
+                Print[ comp_amp_z_r~{i_order}[surfCutSuperstrate], OnGlobal, StoreInVariable $comp_ampz_r~{i_order}, Format Table, File StrCat[myDir, Sprintf("comp_amp_z_r_%g_%g.txt",i_order-nb_orders,i_lambda)]];
+
+                Print[ comp_amp_x_t~{i_order}[surfCutSuperstrate], OnGlobal, StoreInVariable $comp_ampx_t~{i_order}, Format Table, File StrCat[myDir, Sprintf("comp_amp_x_t_%g_%g.txt",i_order-nb_orders,i_lambda)]];
+                Print[ comp_amp_z_t~{i_order}[surfCutSuperstrate], OnGlobal, StoreInVariable $comp_ampz_t~{i_order}, Format Table, File StrCat[myDir, Sprintf("comp_amp_z_t_%g_%g.txt",i_order-nb_orders,i_lambda)]];
+            EndFor
+            For i_order In {0:2*nb_orders}
+                Print[ eff_r~{i_order}[surfCutSuperstrate], OnRegion surfCutSuperstrate, Format Table, File StrCat[myDir, Sprintf("efficiency_r_%g_%g.txt", i_order-nb_orders,i_lambda)]];
+                Print[ eff_r~{i_order}[surfCutSuperstrate], OnRegion surfCutSuperstrate, Format Table, File > StrCat[myDir, Sprintf("efficiency_r_%g_%g_list.txt", i_order-nb_orders,i_lambda)]];
+                Print[ eff_t~{i_order}[surfCutSuperstrate], OnRegion surfCutSuperstrate, Format Table, File StrCat[myDir, Sprintf("efficiency_t_%g_%g.txt", i_order-nb_orders,i_lambda)]];
+            EndFor
+        }
+    }
+    { Name postop_adj_x; NameOfPostProcessing postpro_adj_x ;
+        Operation {
+            //Print[ Eadj_x, OnGrid {$A, $B, 0} {-period/2:period/2:period/10, -h_subs:h_super:(h_super+h_subs)/30, 0}, File StrCat[myDir, "Eadj_x.pos"] ];
+            //Print[ Eadj_projx, OnElementsOf Plot_domain, File StrCat[myDir, "Eadj_projx.pos"] ];
+            //Print[ Eadj_x            , OnElementsOf Plot_domain, File StrCat[myDir, "Eadj_x.pos"] ];
+            Print[ comp_amp_deriv_x_r, OnElementsOf design, StoreInField (2000), File StrCat[myDir, Sprintf("comp_amp_deriv_x_r_%g.pos",i_lambda)], Depth 1];
+        }
+    }
+    { Name postop_adj_z; NameOfPostProcessing postpro_adj_z ;
+        Operation {
+            //Print[ Eadj_z, OnGrid {$A, $B, 0} {-period/2:period/2:period/10, -h_subs:h_super:(h_super+h_subs)/30, 0}, File StrCat[myDir, "Eadj_z.pos"] ];
+            //Print[ Eadj_projz, OnElementsOf Plot_domain, File StrCat[myDir, "Eadj_projz.pos"] ];
+            //Print[ Eadj_z            , OnElementsOf Plot_domain, File StrCat[myDir, "Eadj_z.pos"] ];
+            Print[ comp_amp_deriv_z_r, OnElementsOf design, StoreInField (2002), File StrCat[myDir, Sprintf("comp_amp_deriv_z_r_%g.pos",i_lambda)], Depth 1];
+        }
+    }
+}
diff --git a/DiffractionGratingsTopOpt/topopt_conical_clean.sh b/DiffractionGratingsTopOpt/topopt_conical_clean.sh
new file mode 100644
index 0000000..1ee8afc
--- /dev/null
+++ b/DiffractionGratingsTopOpt/topopt_conical_clean.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# File : topopt_conical_clean.sh
+# Clean the folder by deleting all the files created by the computation
+
+rm *.msh 2> /dev/null
+rm *.txt 2> /dev/null
+rm *.npz 2> /dev/null
+rm *.dat 2> /dev/null
+rm *.pre 2> /dev/null
+rm *.out 2> /dev/null
+rm *.pdf 2> /dev/null
+rm *.pos 2> /dev/null
+rm *.png 2> /dev/null
+rm *.jpg 2> /dev/null
+rm *.mp4 2> /dev/null
+rm -rf topopt_conical_wavelength* 2> /dev/null
+rm -rf __pycache__/ 2> /dev/null
+rm -rf res_conical/ 2> /dev/null
diff --git a/DiffractionGratingsTopOpt/topopt_conical_main.py b/DiffractionGratingsTopOpt/topopt_conical_main.py
new file mode 100644
index 0000000..871a79b
--- /dev/null
+++ b/DiffractionGratingsTopOpt/topopt_conical_main.py
@@ -0,0 +1,85 @@
+import numpy as np
+import nlopt
+import resolution_functions
+import optimization_functions
+import matplotlib.pyplot as plt
+import os
+import meshio as mio
+from config_topopt_conical_data import *
+
+'''
+© Simon Ans
+File : topopt_conical_main.py
+
+Optimize the permittivities on the mesh to maximize the reflection efficiencies
+for different wavelengths on a given order.
+'''
+
+if __name__=="__main__":
+    
+    ## Prepare the computation ------------------------------------------------------------------------------------------------------------
+
+    # Parallelization of the Finite Element Method
+    os.system("export OPENBLAS_NUM_THREADS=%d"%num_threads_resolution)
+
+    # Create the paramater file and the mesh
+    resolution_functions.set_data()
+    resolution_functions.generate_mesh()
+    resolution_functions.make_computation_directories()
+    
+    ## Density field ----------------------------------------------------------------------------------------------------------------------
+
+    msh_density_init = optimization_functions.init_density(res_folder_name + "template_density_table.pos", "rho_opt.pos", analytic_init_density)
+    #msh_density_init = np.loadtxt("rho_opt.txt")
+
+    if (Flag_test == 1):
+        ## Test of the adjoint method -----------------------------------------------------------------------------------------------------
+        if (Flag_design_metal == 1):
+            optimization_functions.test_jacobian(msh_density_init, 7)
+            #optimization_functions.test_jacobian_soloPoint(msh_density_init, 7, 40, 300)
+        else :
+            optimization_functions.test_jacobian(msh_density_init, 3)
+            #optimization_functions.test_jacobian_soloPoint(msh_density_init, 3, 40, 350)
+        resolution_functions.print_sum_energies()
+
+    else :
+        ## Optimization process -----------------------------------------------------------------------------------------------------------
+        
+        problem_size = np.size(msh_density_init)
+        # Choose the MMA optimization (actually GCMMA from the 2002 paper of Svanberg)
+        opt = nlopt.opt(nlopt.LD_MMA, problem_size)
+
+        # Define the target
+        opt.set_min_objective(optimization_functions.target)
+
+        # Boundaries
+        lb_array = low_bnd*np.ones(problem_size)
+        ub_array = up_bnd *np.ones(problem_size)
+        opt.set_lower_bounds(lb_array)
+        opt.set_upper_bounds(ub_array)
+
+        # Stopping criteria
+        opt.set_ftol_abs(tol)    
+        opt.set_maxeval(maxiter)
+
+        if (Flag_binarize == 1):
+            # Optimization with binarization
+            for iter_bin in range(nb_binarizations+1):
+                np.savetxt("iter_bin.txt", np.array([iter_bin]))
+                print("######                Binarization iteration %d...            ######"%iter_bin)
+                print("----------------------------------------------------------------------------------------------\n")
+                rho_opt = opt.optimize(msh_density_init)
+                msh_density_init = rho_opt.copy()
+            optimization_functions.final_binarization(res_folder_name + "template_density_table.pos", "rho_opt.pos")
+        else :
+            np.savetxt("iter_bin.txt", np.array([0]))
+            rho_opt = opt.optimize(msh_density_init)
+
+        plot_msh_density(rho_opt, "rho_opt.pdf")
+        plot_msh_density(np.loadtxt("jacobian.txt"), "jac_opt.pdf")
+        
+        # Print the optimization outcome
+        sum_energies = resolution_functions.print_sum_energies()
+        min_value = opt.last_optimum_value()
+        successful_termination = opt.last_optimize_result()
+        optimization_functions.feedback_result(min_value, successful_termination)
\ No newline at end of file
-- 
GitLab