Lighting analysis

Hi community,

I have a problem in the following code, about the example of ladybugtool lighting study complemented with a “dynamic” envelope and I also try to make an analysis for each hour of the day.

The problem is that when analyzing and finally defining optimal lighting ranges between 400 and 1000 lux and trying to select from the result the number of test points with optimal lighting the result is always very scattered when changing the position of the envelope and returning to the same degrees the The answer is always different, how can I make this result more homogeneous?

Thanks in advance I leave the code in grasshopper so you can review it.

00 Base Rhino.3dm (166.7 KB) 02 11 E_C Nordic Embassies in Berlin - Alfred Berger, Tiina (584.5 KB)