Skip to content

Commit ab71926

Browse files
committed
Update average_photon_energy.py
wording, remove table
1 parent 698eea9 commit ab71926

File tree

1 file changed

+12
-31
lines changed

1 file changed

+12
-31
lines changed

docs/examples/spectrum/average_photon_energy.py

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
# :py:func:`~pvlib.spectrum.average_photon_energy` function to calculate the
1313
# Average Photon Energy (APE, :math:`\overline{E_\gamma}`) of spectral
1414
# irradiance distributions simulated using :py:func:`~pvlib.spectrum.spectrl2`.
15-
# More information on the SPECTRL2 model can be found in [2]_
15+
# More information on the SPECTRL2 model can be found in [2]_.
1616
# The APE parameter is a useful indicator of the overall shape of the solar
1717
# spectrum [1]_. Higher (lower) APE values indicate a blue (red) shift in the
18-
# spectrum and is one of a variety of such characterisation indexes that are
18+
# spectrum and is one of a variety of such characterisation methods that is
1919
# used in the PV performance literature [3]_.
2020
#
2121
# To demonstrate this functionality, first we need to simulate some spectra
@@ -83,7 +83,7 @@
8383
plt.plot(spectra_components['wavelength'], spectra_components['poa_global'])
8484
plt.xlim(200, 2700)
8585
plt.ylim(0, 1.8)
86-
plt.ylabel(r"Irradiance (Wm⁻²nm⁻¹")
86+
plt.ylabel(r"Spectral irradiance (Wm⁻²nm⁻¹)")
8787
plt.xlabel(r"Wavelength (nm)")
8888
time_labels = times.strftime("%H:%M")
8989
labels = [
@@ -94,9 +94,9 @@
9494
plt.show()
9595

9696
# %%
97-
# Given the changing irradiance throughout the day, it is not obvious from
98-
# inspection how the relative distribution of light changes as a function of
99-
# wavelength. We can normalise the spectral irradiance curves to visualise
97+
# Given the changing broadband irradiance throughout the day, it is not obvious
98+
# from inspection how the relative distribution of light changes as a function
99+
# of wavelength. We can normalise the spectral irradiance curves to visualise
100100
# this shift in the shape of the spectrum over the course of the day. In
101101
# this example, we normalise by dividing each spectral irradiance value by the
102102
# total broadband irradiance, which we calculate by integrating the entire
@@ -129,14 +129,11 @@
129129
# We can now see from the normalised irradiance curves that at the start and
130130
# end of the day, the spectrum is red shifted, meaning there is a greater
131131
# proportion of longer wavelength radiation. Meanwhile, during the middle of
132-
# the day, there is a blue shift in the spectral distribution, indicating a
133-
# greater prevalence of shorter wavelength radiation.
132+
# the day, there is a greater prevalence of shorter wavelength radiation — a
133+
# blue shifted spectrum.
134134
#
135-
# How can we quantify this shift? That is where the average photon energy comes
135+
# How can we quantify this shift? This is where the average photon energy comes
136136
# into play.
137-
#
138-
# XX shifted relative to what --- itself, reference // clarify --- e.g. AM1.5
139-
# below
140137

141138
# %%
142139
# Calculating the average photon energy
@@ -159,9 +156,9 @@
159156
ape = spectrum.average_photon_energy(spectra)
160157

161158
# %%
162-
# We can update the normalised spectral irradiance plot to include each
163-
# spectrum's irradiance distribution APE value in the legend. Note that the
164-
# units of the average photon energy here are electronvolts (eV).
159+
# We can update the normalised spectral irradiance plot to include the APE
160+
# value of each spectral irradiance distribution in the legend. Note that the
161+
# units of the APE are electronvolts (eV).
165162

166163
plt.figure()
167164
plt.plot(wavelength, poa_global_normalised)
@@ -182,22 +179,6 @@
182179
# APE is observed closer to the middle of the day. For reference, AM1.5 between
183180
# 300 and 4000 nm is 1.4501 eV. This indicates that the simulated spectra are
184181
# slightly red shifted with respect to the AM1.5 standard reference spectrum.
185-
# The table below summarises the APE values calculated for our day under the
186-
# specified atmospheric conditions.
187-
188-
# =================== ==========
189-
# Time APE (eV)
190-
# =================== ==========
191-
# 08:00 1.25
192-
# 09:00 1.37
193-
# 10:00 1.40
194-
# 11:00 1.41
195-
# 12:00 1.42
196-
# 13:00 1.41
197-
# 14:00 1.40
198-
# 15:00 1.38
199-
# 16:00 1.28
200-
# =================== ==========
201182

202183
# %%
203184
# References

0 commit comments

Comments
 (0)