Skip to content

Commit e80763c

Browse files
committed
temperature -> temp_air, test correction, fix default for m
1 parent f3a2eec commit e80763c

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

pvlib/snowcoverage.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def snow_nrel_fully_covered(snowfall, threshold=1.):
5050
return time_adjusted >= threshold
5151

5252

53-
def snow_nrel(snowfall, poa_irradiance, temperature, surface_tilt,
54-
threshold_snowfall=1., m=-80, sliding_coefficient=0.197):
53+
def snow_nrel(snowfall, poa_irradiance, temp_air, surface_tilt,
54+
threshold_snowfall=1., m=80., sliding_coefficient=0.197):
5555
'''
5656
Calculates the fraction of the slant height of a row of modules covered by
5757
snow at every time step.
@@ -67,14 +67,14 @@ def snow_nrel(snowfall, poa_irradiance, temperature, surface_tilt,
6767
Accumulated snowfall within each time period. [cm]
6868
poa_irradiance : Series
6969
Total in-plane irradiance [W/m^2]
70-
temperature : Series
70+
temp_air : Series
7171
Ambient air temperature at the surface [C]
7272
surface_tilt : numeric
7373
Tilt of module's from horizontal, e.g. surface facing up = 0,
7474
surface facing horizon = 90. Must be between 0 and 180. [degrees]
7575
threshold_snowfall : float, default 1.0
7676
Minimum hourly snowfall to cover a row's slant height. [cm/hr]
77-
m : float, default -80.
77+
m : float, default 80.
7878
Coefficient used in [1]_ to determine if snow can slide given
7979
irradiance and air temperature. [W/(m^2 C)]
8080
sliding coefficient : float, default 0.197
@@ -102,7 +102,7 @@ def snow_nrel(snowfall, poa_irradiance, temperature, surface_tilt,
102102
snow_events = snowfall[snow_nrel_fully_covered(snowfall,
103103
threshold_snowfall)]
104104

105-
can_slide = temperature > poa_irradiance / m
105+
can_slide = temp_air > poa_irradiance / m
106106
slide_amt = sliding_coefficient * sind(surface_tilt) * \
107107
_time_delta_in_hours(poa_irradiance.index)
108108

pvlib/tests/test_snowcoverage.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,10 @@ def test_snow_nrel_subhourly():
5050
snowfall_data = pd.Series([1, .5, .6, .4, .23, -5, .1, .1, 0., 1., 0., 0.,
5151
0.], index=dt)
5252
snow_coverage = snowcoverage.snow_nrel(
53-
snowfall_data, poa_irradiance, temp_air, surface_tilt,
54-
threshold_snowfall=0.5)
53+
snowfall_data, poa_irradiance, temp_air, surface_tilt)
5554
slide_amt = sliding_coefficient * sind(surface_tilt) * 0.25
56-
covered = np.append(np.array([0., 1., 1.]),
57-
1.0 - slide_amt * np.array([1, 2, 3, 4, 5, 6]))
55+
covered = np.append(np.array([0., 1., 1., 1.]),
56+
1.0 - slide_amt * np.array([1, 2, 3, 4, 5]))
5857
covered = np.append(covered, np.array([1., 1., 1., 1. - slide_amt]))
5958
expected = pd.Series(covered, index=dt)
6059
assert_series_equal(snow_coverage, expected)

0 commit comments

Comments
 (0)