param_layer = NHs # Specify the layer for which the parameters should be printed on figures.
params_string = plotting.gen_params_string(param_layer, last_light_object, max_num_BMs=max_num_BMs)

wls_normed = wavelengths/period

for h in range(len(NH_heights)):
    height = NH_heights[h]
    wl_list = []
    stack_label = 0
    for wl in range(len(wavelengths)):
        wl_list.append(stacks_wl_list[wl][stack_label][h])
    mess_name = '_h%(h)i'% {'h'   : h, }
    plotting.EOT_plot(wl_list, wls_normed, params_string, add_name = mess_name) 
# Dispersion
plotting.omega_plot(wl_list, wavelengths, params_string) 


# 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)'% {
            'hms'       : hms,
            'elapsed'   : elapsed, }

python_log = open("python_log.log", "w")
python_log.write(hms_string)
python_log.close()

print '*******************************************'
Exemple #2
0
######################## Plotting ########################
last_light_object = light_list.pop()

wls_normed = wavelengths/period

for h in range(len(NH_heights)):
    height = NH_heights[h]
    wl_list = []
    stack_label = 0
    for wl in range(len(wavelengths)):
        wl_list.append(stacks_list[wl][stack_label][h])
    mess_name = '_h%(h)i'% {'h'   : h, }
    plotting.EOT_plot(wl_list, wls_normed, add_name = mess_name, savetxt = True)
# Dispersion
plotting.omega_plot(wl_list, wavelengths)


# 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)'% {
            'hms'       : hms,
            'elapsed'   : elapsed, }

python_log = open("python_log.log", "w")
python_log.write(hms_string)
python_log.close()

print '*******************************************'
np.savez('Simo_results', stacks_list=stacks_list)


######################## Plotting ########################

# We here wish to know the photovoltaic performance of the structure,
# where all light absorbed in the NW layer is considered to produce exactly
# one electron-hole pair.
# To do this we specify which layer of the stack is the PV active layer
# (default active_layer_nu=1), and indicate that we want to calculate
# the ideal short circuit current (J_sc) of the cell.
# We could also calculate the 'ultimate efficiency' by setting ult_eta=True.
plotting.t_r_a_plots(stacks_list, active_layer_nu=1, J_sc=True)

# We also plot the dispersion relation for each layer.
plotting.omega_plot(stacks_list, 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)'% {
            'hms'       : hms,
            'elapsed'   : elapsed, }

python_log = open("python_log.log", "w")
python_log.write(hms_string)
python_log.close()

print(hms_string)
# Save full simo data to .npz file for safe keeping!
np.savez('Simo_results', stacks_list=stacks_list)

######################## Plotting ########################

# We here wish to know the photovoltaic performance of the structure,
# where all light absorbed in the NW layer is considered to produce exactly
# one electron-hole pair.
# To do this we specify which layer of the stack is the PV active layer
# (default active_layer_nu=1), and indicate that we want to calculate
# the ideal short circuit current (J_sc) of the cell.
# We could also calculate the 'ultimate efficiency' by setting ult_eta=True.
plotting.t_r_a_plots(stacks_list, active_layer_nu=1, J_sc=True)

# We also plot the dispersion relation for each layer.
plotting.omega_plot(stacks_list, 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)' % {
    'hms': hms,
    'elapsed': elapsed,
}

python_log = open("python_log.log", "w")
python_log.write(hms_string)
python_log.close()

param_layer = NWs # Specify the layer for which the parameters should be printed on figures.
params_string = plotting.gen_params_string(param_layer, last_light_object, max_num_BMs=max_num_BMs)

#### Example 1: simple multilayered stack.
stack_label = 1 # Specify which stack you are dealing with.
stack1_wl_list = []
for i in range(len(wavelengths)):
    stack1_wl_list.append(stacks_wl_list[i][stack_label])
active_layer_nu = 1

Efficiency = plotting.t_r_a_plots(stack1_wl_list, wavelengths, params_string, 
    active_layer_nu=active_layer_nu, stack_label=stack_label) 
# Dispersion
plotting.omega_plot(stack1_wl_list, wavelengths, params_string, stack_label=stack_label) 














# #### Example 0: simple interface.
Exemple #6
0
last_light_object = light_list.pop()

wls_normed = wavelengths / period

for h in range(len(NH_heights)):
    height = NH_heights[h]
    wl_list = []
    stack_label = 0
    for wl in range(len(wavelengths)):
        wl_list.append(stacks_list[wl][stack_label][h])
    mess_name = '_h%(h)i' % {
        'h': h,
    }
    plotting.EOT_plot(wl_list, wls_normed, add_name=mess_name, savetxt=True)
# Dispersion
plotting.omega_plot(wl_list, wavelengths)

# 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)' % {
    'hms': hms,
    'elapsed': elapsed,
}

python_log = open("python_log.log", "w")
python_log.write(hms_string)
python_log.close()

print '*******************************************'

######################## Plotting ########################
eta = []
for s in range(len(sub_ns)):
    stack_label = s # Specify which stack you are dealing with.
    stack1_wl_list = []
    for i in range(len(wavelengths)):
        stack1_wl_list.append(stacks_list[i][stack_label])
    sub_n = sub_ns[s]
    Efficiency = plotting.t_r_a_plots(stack1_wl_list, ult_eta=True,
        stack_label=stack_label, add_name = str(s))
    eta.append(100.0*Efficiency[0])
    # Dispersion of structured layer is the same for all cases.
    if s == 0:
        plotting.omega_plot(stack1_wl_list, wavelengths, stack_label=stack_label)

# Now plot as a function of substrate refractive index.
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
fig = plt.figure()
linesstrength = 3
font = 18
ax1 = fig.add_subplot(1,1,1)
ax1.plot(sub_ns,eta, 'k-o', linewidth=linesstrength)
ax1.set_xlabel('Substrate refractive index',fontsize=font)
ax1.set_ylabel(r'$\eta$ (%)',fontsize=font)
plt.savefig('eta_substrates')

# Animate spectra as a function of substrates.
Exemple #8
0
                                           max_num_BMs=max_num_BMs)

wls_normed = wavelengths / period

for h in range(len(NH_heights)):
    height = NH_heights[h]
    wl_list = []
    stack_label = 0
    for wl in range(len(wavelengths)):
        wl_list.append(stacks_wl_list[wl][stack_label][h])
    mess_name = '_h%(h)i' % {
        'h': h,
    }
    plotting.EOT_plot(wl_list, wls_normed, params_string, add_name=mess_name)
# Dispersion
plotting.omega_plot(wl_list, wavelengths, params_string)

# 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)' % {
    'hms': hms,
    'elapsed': elapsed,
}

python_log = open("python_log.log", "w")
python_log.write(hms_string)
python_log.close()

print '*******************************************'
eta = []
for s in range(len(sub_ns)):
    stack_label = s  # Specify which stack you are dealing with.
    stack1_wl_list = []
    for i in range(len(wavelengths)):
        stack1_wl_list.append(stacks_list[i][stack_label])
    sub_n = sub_ns[s]
    Efficiency = plotting.t_r_a_plots(stack1_wl_list,
                                      ult_eta=True,
                                      stack_label=stack_label,
                                      add_name=str(s))
    eta.append(100.0 * Efficiency[0])
    # Dispersion of structured layer is the same for all cases.
    if s == 0:
        plotting.omega_plot(stack1_wl_list,
                            wavelengths,
                            stack_label=stack_label)

# Now plot as a function of substrate refractive index.
import matplotlib
matplotlib.use('pdf')
import matplotlib.pyplot as plt
fig = plt.figure()
linesstrength = 3
font = 18
ax1 = fig.add_subplot(1, 1, 1)
ax1.plot(sub_ns, eta, 'k-o', linewidth=linesstrength)
ax1.set_xlabel('Substrate refractive index', fontsize=font)
ax1.set_ylabel(r'$\eta$ (%)', fontsize=font)
plt.savefig('eta_substrates')

param_layer = NWs # Specify the layer for which the parameters should be printed on figures.
params_string = plotting.gen_params_string(param_layer, last_light_object, max_num_BMs=max_num_BMs)

#### Example 1: simple multilayered stack.
stack_label = 1 # Specify which stack you are dealing with.
stack1_wl_list = []
for i in range(len(wavelengths)):
    stack1_wl_list.append(stacks_wl_list[i][stack_label])
active_layer_nu = 1

Efficiency = plotting.t_r_a_plots(stack1_wl_list, wavelengths, params_string, 
    active_layer_nu=active_layer_nu, stack_label=stack_label) 
# Dispersion
plotting.omega_plot(stack1_wl_list, wavelengths, params_string, stack_label=stack_label) 














# #### Example 0: simple interface.