pysolar
pysolar copied to clipboard
Some checks for Clearness index to keep ìt between 0 and 1
It seems in some scenarios i observed KT > 1
and ZeroDivisionError
. So i made changes to my own code like this. This might be helpful for others.
try:
KT = (ghi_data / EXTR1)
if KT > 1:
KT = 1
except ZeroDivisionError:
return 0
return KT