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 6 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

Fixed by commit 61855079. Thanks for the patch!

pingswept avatar Feb 22 '19 14:02 pingswept

Sorry, had to revert this, as it broke the build.

This broke the build with this error on Python 3.4: ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I suspect this could be fixed pretty easily if anyone has the inclination.

pingswept avatar Feb 22 '19 14:02 pingswept