def test_kimber_soiling_norain(greensboro_rain,
                               expected_kimber_soiling_norain):
    """Test Kimber soiling model with no rain"""
    # a year with no rain
    norain = pd.Series(0, index=greensboro_rain.index)
    # calculate soiling with no rain
    soiling_norain = soiling_kimber(norain, istmy=True)
    # test no rain, soiling reaches maximum
    assert np.allclose(soiling_norain.values, expected_kimber_soiling_norain)
Beispiel #2
0
def test_kimber_soiling_nowash(greensboro_rain,
                               expected_kimber_soiling_nowash):
    """Test Kimber soiling model with no manual washes"""
    # Greensboro typical expected annual rainfall is 8345mm
    assert greensboro_rain.sum() == 8345
    # calculate soiling with no wash dates
    soiling_nowash = soiling_kimber(greensboro_rain)
    # test no washes
    assert np.allclose(soiling_nowash.values,
                       expected_kimber_soiling_nowash['soiling'].values)
def test_kimber_soiling_manwash(greensboro_rain,
                                expected_kimber_soiling_manwash):
    """Test Kimber soiling model with a manual wash"""
    # a manual wash date
    manwash = [datetime.date(1990, 2, 15), ]
    # calculate soiling with manual wash
    soiling_manwash = soiling_kimber(
        greensboro_rain, manual_wash_dates=manwash, istmy=True)
    # test manual wash
    assert np.allclose(
        soiling_manwash.values,
        expected_kimber_soiling_manwash['soiling'].values)
Beispiel #4
0
# 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,
                                 cleaning_threshold=THRESHOLD,
                                 istmy=True)
soiling_no_wash.name = 'soiling'
# daily rain totals
daily_rain = greensboro_rain.iloc[:-1].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]')