######################## Post Processing ########################
# We can plot the amplitudes of each transmitted plane wave order as a
# function of angle.
plotting.PW_amplitudes(stacks_list, add_name = '-default_substrate')
# By default this will plot the amplitudes in the substrate, however we can also give
# the index in the stack of a different homogeneous layer and calculate them here.
# We here chose a subset of orders to plot.
plotting.PW_amplitudes(stacks_list, chosen_PWs = [-1,0,2], \
    lay_interest = 1)

# When many plane wave orders are included these last plots can become confusing,
# so instead one may wish to sum together the amplitudes of all propagating orders,
# of all evanescent orders, and all far-evanescent orders
# (which have in plane k>n_H * k0).
plotting.evanescent_merit(stacks_list, lay_interest = 0)


plotting.BM_amplitudes(stacks_list, lay_interest = 2, chosen_BMs = [0,1,2,3,4,5])

# Lastly we also plot the transmission, reflection and absorption of each
# layer and the stack.
plotting.t_r_a_plots(stacks_list, xvalues = wavelengths)


######################## Wrapping up ########################
# Calculate and record the (real) time taken for simulation
elapsed = (time.time() - start)
hms     = str(datetime.timedelta(seconds=elapsed))
hms_string = 'Total time for simulation was \n \
    %(hms)s (%(elapsed)12.3f seconds)'% {
Exemplo n.º 2
0
"""
Reload simulation results for further manipulation.

Sample script illustrating how to reload simulation objects from .npz files.
Once you have access to the objects you can do everything you forgot to at runtime,
eg. plot different spectra, plot using routines you didn't have at runtime,
view/print/export particular quantities.
"""

import numpy as np
import sys
sys.path.append("../backend/")

import objects
import materials
import plotting
from stack import *

directory = 'single_grating'
npz_file = 'Simo_results'
data = np.load('../' + directory + '/' + npz_file + '.npz')
stacks_list = data['stacks_list']

#### stacks_list is now just like in the original simo.py ####

# plotting.t_r_a_plots(stacks_list)

plotting.evanescent_merit(stacks_list, lay_interest=0, save_mean_ev=True)
plotting.evanescent_merit(stacks_list, lay_interest=1, save_mean_ev=True)
Exemplo n.º 3
0
"""
Reload simulation results for further manipulation.

Sample script illustrating how to reload simulation objects from .npz files.
Once you have access to the objects you can do everything you forgot to at runtime,
eg. plot different spectra, plot using routines you didn't have at runtime,
view/print/export particular quantities.
"""

import numpy as np
import sys

sys.path.append("../backend/")

import objects
import materials
import plotting
from stack import *

directory = "single_grating"
npz_file = "Simo_results"
data = np.load("../" + directory + "/" + npz_file + ".npz")
stacks_list = data["stacks_list"]

#### stacks_list is now just like in the original simo.py ####

# plotting.t_r_a_plots(stacks_list)

plotting.evanescent_merit(stacks_list, lay_interest=0, save_mean_ev=True)
plotting.evanescent_merit(stacks_list, lay_interest=1, save_mean_ev=True)
Exemplo n.º 4
0
######################## Post Processing ########################
# We can plot the amplitudes of each transmitted plane wave order as a
# function of angle.
plotting.PW_amplitudes(stacks_list, add_name='-default_substrate')
# By default this will plot the amplitudes in the substrate, however we can also give
# the index in the stack of a different homogeneous layer and calculate them here.
# We here chose a subset of orders to plot.
plotting.PW_amplitudes(stacks_list, chosen_PWs = [-1,0,2], \
    lay_interest = 1)

# When many plane wave orders are included these last plots can become confusing,
# so instead one may wish to sum together the amplitudes of all propagating orders,
# of all evanescent orders, and all far-evanescent orders
# (which have in plane k>n_H * k0).
plotting.evanescent_merit(stacks_list, lay_interest=0)

plotting.BM_amplitudes(stacks_list,
                       lay_interest=2,
                       chosen_BMs=[0, 1, 2, 3, 4, 5])

# Lastly we also plot the transmission, reflection and absorption of each
# layer and the stack.
plotting.t_r_a_plots(stacks_list, xvalues=wavelengths)

######################## Wrapping up ########################
# Calculate and record the (real) time taken for simulation
elapsed = (time.time() - start)
hms = str(datetime.timedelta(seconds=elapsed))
hms_string = 'Total time for simulation was \n \
    %(hms)s (%(elapsed)12.3f seconds)' % {