Skip to content

Commit

Permalink
review improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kandersolar committed Aug 27, 2020
1 parent 89b0452 commit fb3f71e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pvlib/soiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10,

# determine the time intervals in seconds (dt_sec)
dt = rainfall.index
dt2 = np.roll(dt.copy(), 1)
# subtract shifted values from original and convert to seconds
dt3 = np.delete((dt-dt2), 0).total_seconds()
# append last value to end so same number of elements in the array
dt_sec = np.append(dt3[0], dt3).astype('float64')
dt_diff = (dt[1:] - dt[:-1]).total_seconds()
# ensure same number of elements in the array, assuming that the interval
# prior to the first value is equal in length to the first interval
dt_sec = np.append(dt_diff[0], dt_diff).astype('float64')

horiz_mass_rate = (
pm2_5 * depo_veloc['2_5'] + np.maximum(pm10 - pm2_5, 0.)
* depo_veloc['10']) * dt_sec # noqa: W503
* depo_veloc['10']) * dt_sec
tilted_mass_rate = horiz_mass_rate * cosd(tilt) # assuming no rain

# tms -> tilt_mass_rate
Expand Down

0 comments on commit fb3f71e

Please sign in to comment.