|
11 | 11 | # This example demonstrates how to use the |
12 | 12 | # :py:func:`~pvlib.spectrum.average_photon_energy` function to calculate the |
13 | 13 | # Average Photon Energy (APE, :math:`\overline{E_\gamma}`) of spectral |
14 | | -# irradiance distributions simulated using :py:func:`~pvlib.spectrum.spectrl2`. |
| 14 | +# irradiance distributions. This example uses spectral irradiance simulated |
| 15 | +# using :py:func:`~pvlib.spectrum.spectrl2`, but the same method is |
| 16 | +# applicable to spectral irradiance from any source. |
15 | 17 | # More information on the SPECTRL2 model can be found in [1]_. |
16 | 18 | # The APE parameter is a useful indicator of the overall shape of the solar |
17 | 19 | # spectrum [2]_. Higher (lower) APE values indicate a blue (red) shift in the |
18 | 20 | # spectrum and is one of a variety of such characterisation methods that is |
19 | 21 | # used in the PV performance literature [3]_. |
20 | 22 | # |
21 | | -# To demonstrate this functionality, first we need to simulate some spectra |
| 23 | +# To demonstrate this functionality, first we will simulate some spectra |
22 | 24 | # using :py:func:`~pvlib.spectrum.spectrl2`. In this example, we will simulate |
23 | 25 | # spectra following a similar method to that which is followed in the |
24 | 26 | # `Modelling Spectral Irradiance |
|
105 | 107 | poa_global = spectra_components['poa_global'] |
106 | 108 | wavelength = spectra_components['wavelength'] |
107 | 109 |
|
108 | | -broadband_irradiance = np.array([trapezoid(poa_global[:, i], wavelength) |
109 | | - for i in range(poa_global.shape[1])]) |
| 110 | +broadband_irradiance = trapezoid(poa_global, wavelength, axis=0) |
110 | 111 |
|
111 | 112 | poa_global_normalised = poa_global / broadband_irradiance |
112 | 113 |
|
|
0 commit comments