Flowers that open and close based on sun radiation values

blue flowers for life.3dm (4.1 MB)
blue flowers (99.7 KB)
Hello there,
I am a beginner at grasshopper. I am trying to design a shading device that consists of 6 petal flowers enclosed in 45 circles. The shading device has buildings on the side. I wish to control the opening angle of every flower based on the sun radiation value at the centre of that flower circle (45 such points, one centre point for every flower). The shade of the buildings beside it need to be taken into consideration while calculating the sun radiation values at these points.

I have managed to put the two main scripts together but I am clueless about how I should link them. Once I get the radiation values, I can remap them for the angles. Since I have a low configuration computer device, it makes it difficult to experiment and figure it out. Can anybody help me with the script and how I should put it together