@@ -55,20 +55,21 @@ def test_coverage_nrel_hourly_with_snow_depth():
5555 surface_tilt = 45
5656 slide_amount_coefficient = 0.197
5757 threshold_depth = 0.5
58- dt = pd .date_range (start = "2019-1-1 10:00:00" , end = "2019-1-1 17 :00:00" ,
58+ dt = pd .date_range (start = "2019-1-1 10:00:00" , end = "2019-1-1 18 :00:00" ,
5959 freq = '1h' )
60- poa_irradiance = pd .Series ([400 , 200 , 100 , 1234 , 134 , 982 , 100 , 100 ],
60+ poa_irradiance = pd .Series ([400 , 200 , 100 , 1234 , 134 , 982 , 100 , 100 , 100 ],
6161 index = dt )
62- temp_air = pd .Series ([10 , 2 , 10 , 1234 , 34 , 982 , 10 , 10 ], index = dt )
63- snowfall_data = pd .Series ([1 , .5 , .6 , .4 , .23 , - 5 , .1 , .1 ], index = dt )
64- snow_depth = pd .Series ([1 , 1 , 1 , 1 , 0 , 1 , 0 , .1 ], index = dt )
62+ temp_air = pd .Series ([10 , 2 , 10 , 1234 , 34 , 982 , 10 , 10 , 10 ], index = dt )
63+ # restarts with new snow on 5th time step
64+ snowfall_data = pd .Series ([1 , .5 , .6 , .4 , .23 , 5. , .1 , .1 , 0. ], index = dt )
65+ snow_depth = pd .Series ([1 , 1 , 1 , 1 , 0 , 1 , 1 , 0 , .1 ], index = dt )
6566 snow_coverage = snow .coverage_nrel (
6667 snowfall_data , poa_irradiance , temp_air , surface_tilt ,
6768 snow_depth = snow_depth , threshold_snowfall = 0.6 ,
6869 threshold_depth = threshold_depth )
6970
7071 slide_amt = slide_amount_coefficient * sind (surface_tilt )
71- covered = 1.0 - slide_amt * np .array ([0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 ])
72+ covered = 1.0 - slide_amt * np .array ([0 , 1 , 2 , 3 , 0 , 0 , 1 , 0 , 0 ])
7273 expected = pd .Series (covered , index = dt )
7374 expected [snow_depth < threshold_depth ] = 0
7475 assert_series_equal (expected , snow_coverage )
0 commit comments