-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Snow coverage model from SAM #764
Snow coverage model from SAM #764
Conversation
Yes! Thank you! Can you please search the issues for "snow" or "Marion" to find the ticket number and then add a comment that says, "closes #XYZ" thanks! |
Edited above comment. |
I'm not opposed to a python native implementation of this model, but I'll ask a due diligence question: is it feasible, and desirable, to wrap the appropriate function in SAM SSC using nrel-pysam? I haven't located the snow model function in the SAM SSC so I don't know if 1) it does what we want, or 2) it is exposed by nrel-pysam. @janinefreeman |
@cwhanse The snow model implementation in SAM is exposed in nrel-pysam via cmod_snowmodel (https://github.com/NREL/ssc/blob/develop/ssc/cmod_snowmodel.cpp) which calls a shared library (https://github.com/NREL/ssc/blob/develop/shared/lib_snowmodel.cpp) that allows it to be integrated on the DC side in the detailed PV model. |
I think there's value in a python implementation (particularly for people that want to play with the source code), I think there's value in pysam exposing the c implementation to python users (consistency with SAM, maybe speed), but what's the point of pvlib wrapping the pysam wrapper? |
Agree with this. I was able to fit data better by tuning some of the empirically determined coefficients in Marion's model. |
It is not easy (at least for me it isn't) to figure out how to use pysam to access specific SAM functions, so in cases where we are leveraging SAM functions, I think it is worth wrapping the wrapper for pvlib users' convenience. |
That is true, the SAM implementation doesn't expose the model parameters because most of our users do not have the data necessary to tweak those. On a related note, @JPalakapillyKWH if any of your analysis tuning the parameters to the model is publish-able, the industry would definitely appreciate that :) |
@wholmgren do we want this PR as it's own module, or bundled with other code into a more general "irradiance_loss" module? I'm inclined to the former, anticipating a "soiling" module, whatever we call the "iam" module, "shading" module, etc. |
I also favor putting this in its own module. Maybe snow instead snowcoverage? Not sure coverage adds anything and Anton recently reminded us that module names should be brief. We should probably think harder about if/when/how to interface with pysam elsewhere. |
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.
@JPalakapillyKWH thanks for this contribution! A partial review focused on consistency with the references, terms and interface with the rest of pvlib.
…now_coverage_model
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.
@cwhanse I like this rewrite and how it declutters the namespace. Is it worth mentioning in the docstring that this implementation differs from the original in that the original works in "tenths of row slant height"?
…KWH/pvlib-python into snow_coverage_model
…now_coverage_model
Test failures are for pvlib.bifacial.pvfactors. I believe this PR is ready. |
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.
Some small doc suggestions. Also, consider adding @JPalakapillyKWH to the contributors list for getting the ball rolling.
I included a comment in that review but I think it got buried back in the thread history, so I'll repost it -- I think this suggestion didn't make it into the PR: #764 (comment) |
Co-Authored-By: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com>
Co-Authored-By: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com>
Co-Authored-By: Kevin Anderson <57452607+kanderso-nrel@users.noreply.github.com>
…KWH/pvlib-python into snow_coverage_model
Looks great! I appreciate your commitment on this @cwhanse. I'll leave it open for a little while longer for others to review, if desired, then I'll merge. Thank you! |
docs/sphinx/source/api.rst
for API changes.docs/sphinx/source/whatsnew
file for all changes.Brief description of the problem and proposed solution (if not already fully described in the issue linked to above):
I implemented the snow coverage model first proposed by Marion et al. in [1] and later validated and implemented in SAM [2]. Thought it might be useful to include in pvlib.
[1] Marion, B.; Schaefer, R.; Caine, H.; Sanchez, G. (2013). “Measured and modeled photovoltaic
system energy losses from snow for Colorado and Wisconsin locations.” Solar Energy 97; pp.
112-121.
[2] https://www.nrel.gov/docs/fy17osti/68705.pdf