MCPcopy Create free account
hub / github.com/danieljfarrell/pvtrace / test2

Function test2

pvtrace/device/lsc.py:703–749  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

701
702
703def test2():
704 x = np.arange(400, 801, dtype=np.float)
705 size = (l, w, d) = (4.8, 1.8, 0.250) # cm-1
706 lsc = LSC(size, wavelength_range=x)
707
708 lsc.add_luminophore(
709 "Fluro Red",
710 np.column_stack((x, fluro_red.absorption(x) * 11.387815)), # cm-1
711 np.column_stack((x, fluro_red.emission(x))),
712 quantum_yield=0.95,
713 )
714
715 lsc.add_absorber("PMMA", 0.02) # cm-1
716
717 def lamp_spectrum(x):
718 """ Fit to an experimentally measured lamp spectrum with long wavelength filter.
719 """
720
721 def g(x, a, p, w):
722 return a * np.exp(-(((p - x) / w) ** 2))
723
724 a1 = 0.53025700136646192
725 p1 = 512.91400020614333
726 w1 = 93.491838802960473
727 a2 = 0.63578999789955015
728 p2 = 577.63100003089369
729 w2 = 66.031706473985736
730 return g(x, a1, p1, w1) + g(x, a2, p2, w2)
731
732 lamp_dist = Distribution(x, lamp_spectrum(x))
733 wavelength_callable = lambda: lamp_dist.sample(np.random.uniform())
734 position_callable = lambda: rectangular_mask(l / 2, w / 2)
735 lsc.add_light(
736 "Oriel Lamp + Filter",
737 (0.0, 0.0, 0.5 * d + 0.01), # put close to top surface
738 rotation=(np.radians(180), (1, 0, 0)), # normal and into the top surface
739 wavelength=wavelength_callable, # wavelength delegate callable
740 position=position_callable, # uniform surface illumination
741 )
742
743 lsc.add_solar_cell({"left", "right", "near", "far"})
744 lsc.add_air_gap_mirror(lambertian=False)
745
746 lsc.show()
747 throw = 300
748 lsc.simulate(throw, emit_method="redshift")
749 lsc.report()
750
751
752if __name__ == "__main__":

Callers 1

lsc.pyFile · 0.85

Calls 13

add_luminophoreMethod · 0.95
add_absorberMethod · 0.95
sampleMethod · 0.95
add_lightMethod · 0.95
add_solar_cellMethod · 0.95
add_air_gap_mirrorMethod · 0.95
showMethod · 0.95
simulateMethod · 0.95
reportMethod · 0.95
DistributionClass · 0.90
rectangular_maskFunction · 0.90
LSCClass · 0.85

Tested by

no test coverage detected