-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Fixed errors in soiling.hsu function and tests #977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
c8c3758
3a77400
bff444f
f412ddb
db6bb16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,7 @@ def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10, | |
Concentration of airborne particulate matter (PM) with | ||
aerodynamicdiameter less than 10 microns. [g/m^3] | ||
|
||
depo_veloc : dict, default {'2_5': 0.4, '10': 0.09} | ||
depo_veloc : dict, default {'2_5': 0.0009, '10': 0.004} | ||
Deposition or settling velocity of particulates. [m/s] | ||
|
||
rain_accum_period : Timedelta, default 1 hour | ||
|
@@ -69,15 +69,15 @@ def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10, | |
|
||
# never use mutable input arguments | ||
if depo_veloc is None: | ||
depo_veloc = {'2_5': 0.004, '10': 0.0009} | ||
depo_veloc = {'2_5': 0.0009, '10': 0.004} | ||
|
||
# accumulate rainfall into periods for comparison with threshold | ||
accum_rain = rainfall.rolling(rain_accum_period, closed='right').sum() | ||
# cleaning is True for intervals with rainfall greater than threshold | ||
cleaning_times = accum_rain.index[accum_rain >= cleaning_threshold] | ||
|
||
horiz_mass_rate = pm2_5 * depo_veloc['2_5']\ | ||
+ np.maximum(pm10 - pm2_5, 0.) * depo_veloc['10'] | ||
+ np.maximum(pm10 - pm2_5, 0.) * depo_veloc['10'] * 3600 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry if I'm thinking about this wrong, but I want to raise two points about this calculation:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kanderson-nrel: I agree that I should take another look at the hardcoding of 3600. About your second point, let me look more carefully at the Matlab version and see how it deals with it. |
||
tilted_mass_rate = horiz_mass_rate * cosd(tilt) # assuming no rain | ||
|
||
# tms -> tilt_mass_rate | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed the PR number in the whatsnew entry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I merged too early, thanks for taking a careful look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just submitted PR980 that addresses @kanderso-nrel 's comment about arbitrary time intervals. Next I will submit a demonstration of the hsu function showing that it matches one of the figures in the original JPV paper.