pysolar icon indicating copy to clipboard operation
pysolar copied to clipboard

Some checks for Clearness index to keep ìt between 0 and 1

Open raghu1121 opened this issue 5 years ago • 2 comments

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 

raghu1121 avatar Feb 17 '19 19:02 raghu1121