-
Notifications
You must be signed in to change notification settings - Fork 34
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
Component sum functions #163
Conversation
Two questions for discussion:
I like the |
@cwhanse on your first point let me hook things up to pvlib--I like the idea of outsourcing here to existing packages because it makes our lives easier. I need to stew on point 2, @PetersonUOregon may have some good insight. |
The computation of DNI from GHI, DHI, and SZA is always a bit tricky near the horizon as @cwhanse said. As it currently is the function does have a variable szalimit that can be used to minimize some of this unwanted behavior. For example setting the szalimt to 85 instead of 90, would result in division of .09, (not zero). The other option here, is that we impose a QC to the output value to make sure that DNI does not exceed a clear sky model. But I expect that this is beyond the scope of this function. |
@kanderso-nrel could you take a look at this PR? I couldn't find a good way to integrate any of the pvlib component sum functions into these functions, but the code is simplified enough that I'm not sure any integration is necessary. I also added an example gallery example. |
I'll happily review this but I think we should make sure we're all on the same page about goals first.
I'm torn; "completing the irradiance triangle" could be viewed as a gap filling method more suited to pvanalytics or an irradiance prediction model more suited to pvlib. I think I'd lean towards improving the functionality that pvlib already has along these lines (#157 (comment)), which as @kperrynrel points out is either incomplete (only capable of producing DNI) or not intended to be accessed by the user. Maybe a good starting point is promoting the body of |
To me, the two-to-three component calculations feel like they belong in pvlib, but the fill_nighttime function belongs here. I support "promoting the body of ModelChain._complete_irradiance into a new function pvlib.irradiance.complete_irradiance" The code is in |
Thanks @kanderso-nrel and @cwhanse --what do you guys think about me making two component sum functions for DHI and GHI calculations in PVlib, then importing these functions here, and applying the nighttime filter? |
Instead of adding new functions, I think we take the guts out of |
@cwhanse and @kanderso-nrel just tagged a new issue in PVLib. I can work on it this week, and then once we go through a review process and PR in PVLib, we pick this back up? pvlib/pvlib-python#1565 |
Now that pvlib/pvlib-python#1567 has landed, what's the next step here? If pvlib keeps to its new quarterly release schedule, the new
|
I'm fine with this option. |
Make a new pvlib release! |
I definitely think @wholmgren 's suggestion is the easiest if we can just cut a new pre-release, but I also am not a pvlib maintainer so it's up to you guys on what you'd like to do! I'm going to get started on integrating the pvlib code into this PR today, and will just vendor the function over until we make a final decision. |
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
Co-authored-by: Cliff Hansen <cwhanse@sandia.gov>
@kperrynrel take a look at the function's doc page, the Parameters and Return sections aren't rendering right. I tried to fix it so I would understand what was wrong, but no luck. Reminder: you'll need to pull upstream since I was committing changes. |
@cwhanse pulling your commits down now and seeing what I can do to debug. Thanks for taking a look |
Looks OK to me on first glance, maybe your browser is caching an older broken version and a hard refresh will fix it? The only rendering issue jumping out at me is the link to the pvlib docs; that's just due to using markdown link syntax instead of RST syntax. |
Is this what you're seeing @cwhanse ? Mine also looks pretty screwy. @kanderso-nrel what is yours rendering as? |
Looks OK to me now with latest commit. |
Looks good to me as well @kanderso-nrel |
Added logic for component sum equations for GHI, DHI, and DNI. Worked with @PetersonUOregon to build out the logic.
docs/api.rst
.in
docs/whatsnew
for all changes. Includes link to the GitHub Issue with
:issue:`num`
or this Pull Request with
:pull:`num`
. Includes contributor nameand/or GitHub username (link with
:ghuser:`user`
).