forked from pvlib/pvlib-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot_standard_ASTM_G173-03.py
More file actions
31 lines (24 loc) · 880 Bytes
/
Copy pathplot_standard_ASTM_G173-03.py
File metadata and controls
31 lines (24 loc) · 880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
ASTM G173-03 Standard Spectrum
==============================
This example demonstrates how to read the data from the ASTM G173-03 standard
spectrum bundled with pvlib and plot each of the components.
The ASTM G173-03 standard provides reference solar spectral irradiance data.
"""
import matplotlib.pyplot as plt
import pvlib
# %%
# Use :py:func:`pvlib.spectrum.get_standard_spectrum` to retrieve a
# standard spectra file.
am15 = pvlib.spectrum.get_standard_spectrum(standard="ASTM G173-03")
# Plot
plt.plot(am15.index, am15['extraterrestrial'], label='Extraterrestrial')
plt.plot(am15.index, am15['global'], label='Global')
plt.plot(am15.index, am15['direct'], label='Direct')
plt.xlabel(r'Wavelength $[nm]$')
plt.ylabel(r'Irradiance $[\frac{W}{m^2 nm}$')
plt.title('ASTM G173-03 Solar Spectral Irradiance')
plt.legend()
plt.grid(True)
plt.tight_layout()
plt.show()