-
Notifications
You must be signed in to change notification settings - Fork 1.1k
add Kimber soiling model #860
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
Merged
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1f204ce
add Kimber soiling model
mikofski d9e8c99
remove spaces, thx stickler
mikofski 1b0b74e
typos: aa = a, rest = reset
mikofski ed5c444
move soiling to losses
mikofski 14ef35c
Merge branch 'master' into kimber_soil
mikofski c6c26ac
Merge branch 'master' into kimber_soil
mikofski 671ff00
add test for kimber soiling model
mikofski 55bd7c5
add kimber to api.rst
mikofski 8988864
add test for manual wash
mikofski a1372a6
please fix kimber gallery example
mikofski e174dba
Fix indent on references
mikofski f01d52f
add test for no rain, max soil
mikofski 04eb758
fix typos in Kimber soiling model
mikofski ec26d8f
update what's new w/ kimber model
mikofski ba16b2b
Apply suggestions from code review
mikofski 7c86399
update rainfall and threshold args in kimber
mikofski 0d9ed77
change soiling_rate to soiling_loss_rate
mikofski 4736027
add a 1-liner for `soiling_kimber` in the sphinx docs
mikofski e5d7a93
separate tests for Kimber
mikofski c7b1c0e
delete trailing whitespace in kimber test
mikofski e68cff3
vectorize kimber soiling
mikofski 6acf512
fix trailing whitespace in kimber
mikofski 75d6df6
Kimber needs pandas-0.22
mikofski 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,62 @@ | ||
""" | ||
Kimber Soiling Model | ||
==================== | ||
|
||
Examples of soiling using the Kimber model [1]_. | ||
|
||
References | ||
---------- | ||
.. [1] "The Effect of Soiling on Large Grid-Connected Photovoltaic Systems | ||
in California and the Southwest Region of the United States," Adrianne | ||
Kimber, et al., IEEE 4th World Conference on Photovoltaic Energy | ||
Conference, 2006, :doi:`10.1109/WCPEC.2006.279690` | ||
""" | ||
|
||
# %% | ||
# This example shows basic usage of pvlib's Kimber Soiling model with | ||
# :py:meth:`pvlib.losses.soiling_kimber`. | ||
# | ||
# The Kimber Soiling model assumes that soiling builds up at a constant rate | ||
# until cleaned either manually or by rain. The rain must reach a threshold to | ||
# clean the panels. When rains exceeds the threshold, it's assumed the earth is | ||
# damp for a grace period before it begins to soil again. There is a maximum | ||
# soiling build up that cannot be exceeded even if there's no rain or | ||
# manual cleaning. | ||
# | ||
# Threshold | ||
# --------- | ||
# The example shown here demonstrates how the threshold affects soiling. | ||
# Because soiling depends on rainfall, loading weather data is always the first | ||
# step. | ||
|
||
from datetime import datetime | ||
from matplotlib import pyplot as plt | ||
from pvlib.iotools import read_tmy3 | ||
from pvlib.losses import soiling_kimber | ||
from pvlib.tests.conftest import DATA_DIR | ||
|
||
# get TMY3 data with rain | ||
greensboro = read_tmy3(DATA_DIR / '723170TYA.CSV', coerce_year=1990) | ||
# NOTE: can't use Sand Point, AK b/c Lprecipdepth is -9900, ie: missing | ||
greensboro_rain = greensboro[0].Lprecipdepth | ||
# calculate soiling with no wash dates | ||
THRESHOLD = 25.0 | ||
soiling_no_wash = soiling_kimber(greensboro_rain, threshold=THRESHOLD) | ||
soiling_no_wash.name = 'soiling' | ||
# daily rain totals | ||
daily_rain = greensboro_rain.resample('D').sum() | ||
plt.plot( | ||
daily_rain.index.to_pydatetime(), daily_rain.values/25.4, | ||
soiling_no_wash.index.to_pydatetime(), soiling_no_wash.values*100.0) | ||
plt.hlines( | ||
THRESHOLD/25.4, xmin=datetime(1990, 1, 1), xmax=datetime(1990, 12, 31), | ||
linestyles='--') | ||
plt.grid() | ||
plt.title( | ||
f'Kimber Soiling Model, dashed line shows threshold ({THRESHOLD}[mm])') | ||
plt.xlabel('timestamp') | ||
plt.ylabel('soiling build-up fraction [%] and daily rainfall [inches]') | ||
plt.legend(['daily rainfall [in]', 'soiling [%]']) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -315,6 +315,7 @@ Losses | |
:toctree: generated/ | ||
|
||
losses.soiling_hsu | ||
losses.soiling_kimber | ||
|
||
|
||
Other | ||
|
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.
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.