-
Notifications
You must be signed in to change notification settings - Fork 1.1k
DISC model and zenith threshold #311
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
Comments
PS: I skimmed through the first reference |
The filter is (mostly) inherited from the matlab code, which apparently chose 87 degrees to match a FORTRAN implementation of the algorithm: https://github.com/sandialabs/MATLAB_PV_LIB/blob/master/pvl_disc.m#L134
I say "mostly" because we changed the ghi filter condition from 1 to 0 at some point, which was probably a mistake. The filter should be I'm guessing that we can make a more permissive filter without needing to add an optional argument. Is the zenith filter actually necessary if we already have the ghi and dni filters? It's not clear to me how the algorithm would behave without it. Maybe filtering on some other quantity (e.g. dni = 0 if Kn > 1?) would be preferable. The zenith filter is probably preventing nans in the airmass calculation, but you could handle that differently. |
This is also related to #250 |
The 87 threshold is in the Matlab code to mimic FORTRAN which we got from SRRL. When we started PVLib we tried to implement models faithfully with the published references. In this case, because the publication isn't clear on a few points, we followed code which appeared to be authoritative. From the comments in the code, it appears at one point in the code development, true zenith > 87 was causing numerical issues. I'm not sure that's still a problem. In the matlab code, one does have issues if zenith > 93.885, because the air mass function will return imaginary numbers, which casts the valid values as also imaginary. I note that NREL distributes an Excel sheet implementing the DISC model which sets the zenith limit to 80. I think we can change the value if we choose. We could add a parameter zenith_limit to the function signature with a default of 87. |
Coming at the end of the function, this seems to be an optional step. It would be great if someone could look at what the algorithm produces in this region, to determine whether and how the output becomes unreasonable. I would prefer (again) to see a gradual transition from the model to the constraint--if necessary. |
This should have been closed by #400 |
Hi,
I tried to look for previous issues that address this question ( #24 and #6 ) but I don't think they did.
I noticed that a threshold was used on zenith values in the DISC model above which the calculated DNI was set to 0.
https://github.com/pvlib/pvlib-python/blob/master/pvlib/irradiance.py#L1158
Does the condition
(zenith > 87)
come from the original model or was it implemented to filter potential outliers? In which case why87
? And can we create a function argument that would allow us to use different threshold values?Thanks!
The text was updated successfully, but these errors were encountered: