Python code for calculating the irradiance on a surface given sun position and array angle. Also includes other methods for finding cosine losses. Use/update the method on line 560 for main calculations. Adapted/modified from NREL's PVLib https://github.com/pvlib/pvlib-python