-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add extraterrestrial and direct spectra of ASTM G173-03 standard spectrum (AM1.5) #2039
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
Merged
kandersolar
merged 46 commits into
pvlib:main
from
echedey-ls:full-read-of-astm-g-173-03
Jun 17, 2024
Merged
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 d7b9a67
Full implementation
echedey-ls 46ae6a8
I messed up with git, again
echedey-ls 2dc68e8
Minor updates to docs
echedey-ls 7f744b6
Add print statements to examples
echedey-ls b78c9ec
Add example from my other branch
echedey-ls 7e21e6c
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls 4ca113a
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls 1363ecc
Microoptimization :rocket:
echedey-ls 57ecb25
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls 1c98466
Fix implementation
echedey-ls f1d4d86
Format with Ruff, thx Ruff :green_heart:
echedey-ls 588f43c
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls 80a05b2
Update v0.11.0.rst
echedey-ls e8cf5db
Change signature to `get_standard_spectrum`, future-proof implementation
echedey-ls 767ec3c
linter :volcano:
echedey-ls 4632f31
Update plot_standard_ASTM_G173-03.py
echedey-ls e89631a
Update mismatch.py
echedey-ls 78a5fde
Update mismatch.py
echedey-ls 386e909
reference->standard & docs
echedey-ls adc3435
docs
echedey-ls 5ff3d00
Fixes
echedey-ls b674635
Fix tests, I'm kinda stupid
echedey-ls 483fc38
Deprecation announcement in condition
echedey-ls 922f0cf
duh
echedey-ls 3887384
Update mismatch.py
echedey-ls 8945f49
Add fail on version
echedey-ls 6f68f32
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls fd26f3a
Units
echedey-ls 27894e8
Unit formatting, forgot this
echedey-ls 768e10f
Remove deprecated admonition duplicate
echedey-ls f98896a
Unit formatting went too far
echedey-ls c57abff
Function rename to get_reference_spectrum
echedey-ls 279e85d
Clean warnings from test logs
echedey-ls c1030b0
Fix wrongly made test
echedey-ls 1bffca5
Other get_am15g references in code
echedey-ls bf2e372
Update plot_standard_ASTM_G173-03.py
echedey-ls 8c1f4f7
lintar
echedey-ls e2d70cc
Order of commits matter
echedey-ls a7176ac
Rm units of function not in scope
echedey-ls 81151bf
Rename function to get_reference_spectra
echedey-ls 9787038
Merge branch 'main' into full-read-of-astm-g-173-03
echedey-ls 997e6a1
Code Review from Kevin
echedey-ls 9a11714
Merge branch 'full-read-of-astm-g-173-03' of https://github.com/eched…
echedey-ls b3d2bbf
linter :D
echedey-ls b9c0abc
Remove stupid keyword-only params requirement
echedey-ls File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
||
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.