-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add 'nrel' spa option for ET irradiance, fix doy - 1 bug #215
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
Conversation
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
Here are some benchmarks: times = pd.DatetimeIndex(start='2015', end='2016', freq='1min')
In [40]: %timeit pvlib.irradiance.extraradiation(times, method='nrel', how='numba')
1 loop, best of 3: 1.67 s per loop
In [41]: %timeit pvlib.irradiance.extraradiation(times, method='nrel')
1 loop, best of 3: 3.87 s per loop
In [42]: %timeit pvlib.irradiance.extraradiation(times, method='pyephem')
1 loop, best of 3: 8.34 s per loop
In [43]: %timeit pvlib.irradiance.extraradiation(times, method='spencer')
10 loops, best of 3: 45.8 ms per loop
In [44]: %timeit pvlib.irradiance.extraradiation(times, method='asce')
10 loops, best of 3: 26 ms per loop I was hoping that the nrel method would be faster, but it's still an improvement over pyephem. |
A sloppy copy/paste job led to an unnecessary slow line of code in solarposition.nrel_earthsun_distance. I removed the slow line and reran the tests: In [61]: times = pd.DatetimeIndex(start='2015', end='2016', freq='1min')
In [62]: %timeit pvlib.irradiance.extraradiation(times, method='nrel', how='numba')
The slowest run took 10.33 times longer than the fastest. This could mean that an intermediate result is being cached.
1 loop, best of 3: 215 ms per loop
In [63]: %timeit pvlib.irradiance.extraradiation(times, method='nrel')
1 loop, best of 3: 953 ms per loop
In [64]: %timeit pvlib.irradiance.extraradiation(times, method='pyephem')
1 loop, best of 3: 7.9 s per loop
In [65]: %timeit pvlib.irradiance.extraradiation(times, method='spencer')
10 loops, best of 3: 64.4 ms per loop
In [66]: %timeit pvlib.irradiance.extraradiation(times, method='asce')
10 loops, best of 3: 28.5 ms per loop |
…d invalid model to extrarad
Jacc0027
added a commit
to Jacc0027/pvlib-python
that referenced
this pull request
Nov 1, 2021
kandersolar
added a commit
that referenced
this pull request
Jun 23, 2023
* Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Merge branch 'Spectral-corrections' of https://github.com/Jacc0027/pvlib-python into Spectral-corrections * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update pvlib/atmosphere.py Co-authored-by: Kevin Anderson <[email protected]> * relocation of parameter descriptions according to the order of input parameters * Update api.rst Adding atmosphere.AM_AOD_PW_spectral correction as requested in #1296 * remove input screening * move reference values to be optional parameters * fix implementation issues * first cut at tests using file from Jacc0027 * CI correction. Line #215 * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Testing tests * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Test Review * Update atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update atmosphere.py Added the requested changes * Update atmosphere.py Fixed 2 blank line errors. * Update test_atmosphere.py Updated test function name to: caballero_spectral_correction * Update api.rst Updated the atmosphere function name from AM_AOD_PW_spectral_correction to caballero_spectral_correction * Update test_atmosphere.py Updated some functions calls from AM_AOD_PW_spectral_correction to caballero_spectral_correction * Update atmosphere.py Updated the logic to show errors. * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update pvlib/atmosphere.py Co-authored-by: Cliff Hansen <[email protected]> * Update atmosphere.py * Update atmosphere.py * Update atmosphere.py Trying to solve #814 and #817 issues. * Update atmosphere.py * Update api.rst * Delete api.rst * Update test_atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * Update test_atmosphere.py * update function logic and get tests working * Update atmosphere.py Updated both "TODO" issues. * Update atmosphere.py * Update v0.9.6.rst Added caballero spectral correction as a new function. * Update airmass_atmospheric.rst Added a new function: atmosphere.caballero_spectral_correction * Update pvlib/atmosphere.py Co-authored-by: Anton Driesse <[email protected]> * rename function and move to pvlib.spectrum following the conventions set out in #1628 * misc cleanup - reorder and rename parameters to match #1768 - remove reference parameters - shorten/simplify docstring - restructure calculation to be more readable --------- Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Kevin Anderson <[email protected]> Co-authored-by: Cliff Hansen <[email protected]> Co-authored-by: Anton Driesse <[email protected]> Co-authored-by: Kevin Anderson <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds a new 'nrel' option to irradiance.extraradiation that uses the well tested ephemeris code in spa.py. It also fixes the doy - 1 bug described in #211.
My plan is to let #214 sit for another day for comments, merge it, and then rebase/merge this PR.