def test_BL_correction(): wl = np.linspace(800, 950, 4) * 1e-9 GaAs = material("GaAs")() thick_cell = SolarCell([Layer(material=GaAs, width=si("20um"))]) opts = State() opts.position = None prepare_solar_cell(thick_cell, opts) position = np.arange(0, thick_cell.width, 1e-9) opts.position = position opts.recalculate_absorption = True opts.no_back_reflexion = False opts.BL_correction = False opts.wavelength = wl solve_tmm(thick_cell, opts) no_corr = thick_cell.absorbed opts.BL_correction = True solve_tmm(thick_cell, opts) with_corr = thick_cell.absorbed assert with_corr == approx( np.array([6.71457872e-01, 6.75496354e-01, 2.09738887e-01, 0])) assert no_corr == approx( np.array([6.71457872e-01, 6.75496071e-01, 2.82306407e-01, 0]))
GaInP = material('GaInP')(In=0.5) GaAs = material('GaAs')() Ge = material('Ge')() optical_struct = SolarCell([Layer(material=GaInP, width=si('5000nm')), Junction([Layer(material=GaAs, width=si('200nm')), Layer(material=GaAs, width=si('5um'))], kind = 'DA'), Layer(material=Ge, width=si('50um')) ]) wl = np.linspace(250, 1700, 300)*1e-9 options = State() options.wavelength = wl options.optics_method = 'TMM' options.no_back_reflexion = False options.BL_correction = True options.recalculate_absorption = True options.theta = 0 c_list = [['c', 'c', 'c', 'c'], ['c', 'c', 'c', 'i'], ['c', 'i', 'i', 'c'], ['i', 'i', 'i', 'i']] titles = ['All coherent', 'Bottom Ge layer explicity incoherent', 'Both layers of GaAs junction incoherent', 'All layers incoherent']