@@ -24,12 +24,13 @@ def test_snow_nrel_hourly():
24
24
freq = '1h' )
25
25
poa_irradiance = pd .Series ([400 , 200 , 100 , 1234 , 134 , 982 , 100 , 100 ],
26
26
index = dt )
27
- temperature = pd .Series ([10 , 2 , 10 , 1234 , 34 , 982 , 10 , 10 ], index = dt )
28
- slide_amt = sliding_coefficient * sind (surface_tilt )
27
+ temp_air = pd .Series ([10 , 2 , 10 , 1234 , 34 , 982 , 10 , 10 ], index = dt )
29
28
snowfall_data = pd .Series ([1 , .5 , .6 , .4 , .23 , - 5 , .1 , .1 ], index = dt )
30
29
snow_coverage = snowcoverage .snow_nrel (
31
- snowfall_data , poa_irradiance , temperature , surface_tilt ,
30
+ snowfall_data , poa_irradiance , temp_air , surface_tilt ,
32
31
threshold_snowfall = 0.6 )
32
+
33
+ slide_amt = sliding_coefficient * sind (surface_tilt )
33
34
covered = np .append (np .array ([0. , 0. ]),
34
35
1.0 - slide_amt * np .array ([0 , 1 , 2 , 3 , 4 , 5 ]))
35
36
expected = pd .Series (covered , index = dt )
@@ -41,16 +42,20 @@ def test_snow_nrel_subhourly():
41
42
sliding_coefficient = 0.197
42
43
dt = pd .date_range (start = "2019-1-1 11:00:00" , end = "2019-1-1 14:00:00" ,
43
44
freq = '15T' )
44
- poa_irradiance = pd .Series ([400 , 200 , 100 , 1234 , 134 , 982 , 100 , 100 ],
45
+ poa_irradiance = pd .Series ([400 , 200 , 100 , 1234 , 134 , 982 , 100 , 100 , 100 ,
46
+ 100 , 1000 , 1000 , 0 ],
45
47
index = dt )
46
- temperature = pd .Series ([10 , 2 , 10 , 1234 , 34 , 982 , 10 , 10 ], index = dt )
47
- slide_amt = sliding_coefficient * sind (surface_tilt )
48
- snowfall_data = pd .Series ([1 , .5 , .6 , .4 , .23 , - 5 , .1 , .1 ], index = dt )
48
+ temp_air = pd .Series ([10 , 2 , 10 , 1234 , 34 , 982 , 10 , 10 , 10 , 10 , 10 , 10 ,
49
+ 10 ], index = dt )
50
+ snowfall_data = pd .Series ([1 , .5 , .6 , .4 , .23 , - 5 , .1 , .1 , 0. , 1. , 0. , 0. ,
51
+ 0. ], index = dt )
49
52
snow_coverage = snowcoverage .snow_nrel (
50
- snowfall_data , poa_irradiance , temperature , surface_tilt ,
51
- threshold_snowfall = 0.6 )
52
- covered = np .append (np .array ([0. , 0. ]),
53
- 1.0 - slide_amt * np .array ([0 , 1 , 2 , 3 , 4 , 5 ]))
53
+ snowfall_data , poa_irradiance , temp_air , surface_tilt ,
54
+ threshold_snowfall = 0.5 )
55
+ 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 ]))
58
+ covered = np .append (covered , np .array ([1. , 1. , 1. , 1. - slide_amt ]))
54
59
expected = pd .Series (covered , index = dt )
55
60
assert_series_equal (snow_coverage , expected )
56
61
0 commit comments