Skip to content

pvlib.soiling.hsu model implementation errors #970

Closed

Description

@jsstein

Describe the bug
I ran an example run using the Matlab version of the HSU soiling function and found that the python version did not give anywhere near the same results. The Matlab results matched the results in the original JPV paper. As a result of this test, I found two errors in the python implementation, which are listed below:

  1. depo_veloc = {'2_5': 0.004, '10': 0.0009} has the wrong default values. They are reversed.
    The proper dictionary should be: {'2_5': 0.0009, '10': 0.004}. This is confirmed in the JPV paper and the Matlab version of the function.

  2. The horiz_mass_rate is in g/(m^2hr) but should be in g/(m^2s). The line needs to be multiplied by 60x60 or 3600.
    The proper line of code should be:
    horiz_mass_rate = (pm2_5 * depo_veloc['2_5']+ np.maximum(pm10 - pm2_5, 0.) * depo_veloc['10'])*3600

When I made these changes I was able to match the validation dataset from the JPV paper, as shown below.
image

Activity

  1. added this to the 0.8.0 milestone on May 19, 2020
  2. mikofski commented on May 19, 2020

    @mikofski
    Member

    nice sleuthing Josh! Is a PR forthcoming? 🎉

  3. jsstein commented on May 19, 2020

    @jsstein
    ContributorAuthor
  4. cwhanse commented on May 19, 2020

    @cwhanse
    Member

    Now I need to go back and figure out where I missed these errors in the review.

  5. mikofski commented on May 19, 2020

    @mikofski
    Member

    Now I need to go back and figure out where I missed these errors in the review.

    Nah, IMHO this right here is why I ❤️    open science. Everyone makes a mistake, even the best, and it may go unnoticed perhaps for a long time, but when used in earnest by many, important issues are caught & fixed more quickly. This right here is the proof!

  6. cwhanse commented on Jun 12, 2020

    @cwhanse
    Member

    Some improvements are needed in #977

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions