Open kdebrab opened 2 years ago
The example is not fully correct (I should have converted ghi to the plane before feeding it to gti_dirint), but that doesn't really matter for the bug report.
In this case, the plane doesn't see the sun during the times, so diriving the components would be trivial/impossible (the plane only sees diffuse), but, in any case, the algorithm should not raise an UnboundLocalError.
Confirmed. The problem appears to be that _gti_dirint_lt_90
is always called, without checking if any aoi
value is less than 90. The test for gti_dirint
doesn't hit this corner case.
Maybe put an if
block around this line.
It's not as simple as putting an if aoi_lt_90.any()
around _gti_dirint_lt_90
. _gti_dirint_gte_90
requires the best_kt_prime
determined in _gti_dirint_lt_90
. I don't think we can make this work without going beyond what's in the Marion paper. I suggest we instead return an informative error if insufficient data is supplied with aoi < 90.
Describe the bug
irradiance.gti_dirint
fails for surface faced NorthTo Reproduce
raises
The error is not raised e.g. when
surface_azimuth = 180
.Versions:
pvlib.__version__
: 0.9.0pandas.__version__
: 1.3.4