Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add extraterrestrial and direct spectra of ASTM G173-03 standard spectrum (AM1.5) #2039

Merged
merged 46 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fdc1da3
Implement all for spectrum.get_ASTM_G173
echedey-ls Apr 11, 2024
d7b9a67
Full implementation
echedey-ls Apr 11, 2024
46ae6a8
I messed up with git, again
echedey-ls Apr 11, 2024
2dc68e8
Minor updates to docs
echedey-ls Apr 12, 2024
7f744b6
Add print statements to examples
echedey-ls Apr 12, 2024
b78c9ec
Add example from my other branch
echedey-ls Apr 12, 2024
7e21e6c
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls Apr 12, 2024
4ca113a
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls Apr 15, 2024
1363ecc
Microoptimization :rocket:
echedey-ls Apr 28, 2024
57ecb25
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls May 3, 2024
1c98466
Fix implementation
echedey-ls May 3, 2024
f1d4d86
Format with Ruff, thx Ruff :green_heart:
echedey-ls May 3, 2024
588f43c
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls May 6, 2024
80a05b2
Update v0.11.0.rst
echedey-ls May 6, 2024
e8cf5db
Change signature to `get_standard_spectrum`, future-proof implementation
echedey-ls May 16, 2024
767ec3c
linter :volcano:
echedey-ls May 16, 2024
4632f31
Update plot_standard_ASTM_G173-03.py
echedey-ls May 23, 2024
e89631a
Update mismatch.py
echedey-ls May 23, 2024
78a5fde
Update mismatch.py
echedey-ls May 23, 2024
386e909
reference->standard & docs
echedey-ls May 23, 2024
adc3435
docs
echedey-ls May 23, 2024
5ff3d00
Fixes
echedey-ls May 23, 2024
b674635
Fix tests, I'm kinda stupid
echedey-ls May 23, 2024
483fc38
Deprecation announcement in condition
echedey-ls May 23, 2024
922f0cf
duh
echedey-ls May 23, 2024
3887384
Update mismatch.py
echedey-ls May 23, 2024
8945f49
Add fail on version
echedey-ls May 23, 2024
6f68f32
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls May 28, 2024
fd26f3a
Units
echedey-ls May 30, 2024
27894e8
Unit formatting, forgot this
echedey-ls May 30, 2024
768e10f
Remove deprecated admonition duplicate
echedey-ls Jun 2, 2024
f98896a
Unit formatting went too far
echedey-ls Jun 2, 2024
c57abff
Function rename to get_reference_spectrum
echedey-ls Jun 2, 2024
279e85d
Clean warnings from test logs
echedey-ls Jun 2, 2024
c1030b0
Fix wrongly made test
echedey-ls Jun 2, 2024
1bffca5
Other get_am15g references in code
echedey-ls Jun 2, 2024
bf2e372
Update plot_standard_ASTM_G173-03.py
echedey-ls Jun 2, 2024
8c1f4f7
lintar
echedey-ls Jun 2, 2024
e2d70cc
Order of commits matter
echedey-ls Jun 2, 2024
a7176ac
Rm units of function not in scope
echedey-ls Jun 2, 2024
81151bf
Rename function to get_reference_spectra
echedey-ls Jun 3, 2024
9787038
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls Jun 14, 2024
997e6a1
Code Review from Kevin
echedey-ls Jun 14, 2024
9a11714
Merge branch 'full-read-of-astm-g-173-03' of https://github.com/eched…
echedey-ls Jun 14, 2024
b3d2bbf
linter :D
echedey-ls Jun 14, 2024
b9c0abc
Remove stupid keyword-only params requirement
echedey-ls Jun 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/examples/spectrum/plot_standard_ASTM_G173-03.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,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.
echedey-ls marked this conversation as resolved.
Show resolved Hide resolved

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 spectrum.

am15 = pvlib.spectrum.get_standard_spectrum(reference="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('Wavelength (nm)')
plt.ylabel('Irradiance (W/m²/nm)')
plt.title('ASTM G173-03 Solar Spectral Irradiance')
plt.legend()
plt.grid(True)
plt.tight_layout()
plt.show()
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Spectrum
spectrum.spectrl2
spectrum.get_example_spectral_response
spectrum.get_am15g
spectrum.get_standard_spectrum
spectrum.calc_spectral_mismatch_field
spectrum.spectral_factor_caballero
spectrum.spectral_factor_firstsolar
Expand Down
3 changes: 3 additions & 0 deletions docs/sphinx/source/whatsnew/v0.11.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Deprecations

Enhancements
~~~~~~~~~~~~
* Added extraterrestrial and direct spectra of the ASTM G173-03 standard with
the new function :py:func:`pvlib.spectrum.get_standard_spectrum`.
(:issue:`1963`, :pull:`2039`)


Bug fixes
Expand Down
Loading
Loading