Analysis for 50% daylight coverage at any given time

Hello there,

I am trying to figure out a way that I can discover the number of total minutes that a test surface receives at least 50% (at any given moment) of direct sunlight exposure between 9am-3pm.

Is there an easy way to do this in ladybug? Please see my grasshopper script and .3dm file below.

170202_sunlight analysis.3dm (3.76 MB)
170203_sunlight analysis_script_parametric building (453 KB)

this is a tricky one

Hi Claudia,

Could you please elaborate on your question? I want to look into this, but I am not sure if I understand you correctly.


The way I see it, this component is about whether you receive sunlight or not at a particular time. It won’t count a 50% sunlight.

It could tell you if a certain point receives sunlight for at least 50% of the time. But I am not sure if that’s what you’re looking for.

hi Devang,

The way I see it, she is looking for the number of hours for which the teste surface is at least 50% exposed to the sun, but not sure about it.


If that’s the case then that can be done with this component I believe.

Hi Devang,

yes, Aurelien is correct. I want to know the number of hours for which the test surface is at least 50% exposed to the sun. So for how long is there >%50 sun exposure on the surface - does that make sense??

Hey - to elaborate further than below, I am not concerned if one point receives sunlight for 50% of the time. I need to find out for how long is the entire surface receiving at least 50% sunlight coverage. So if at 10am only 40% of the surface is getting sunlight then that time wont count, but if at 11am the surface is getting 50% sunlight coverage then that will count towards how long in total it receives 50% or more.

Use sunIsVisible output, flip the matrix, count the number of True values and divide it by the number of total hours, count the number of values that are larger than 0.5.

PS: I assumed each sun position represents an hour otherwise you need to divide the file value by the number of time steps to get the number of hours.

Thank you so much Mostapha! I will test this when I can on Monday and post my results - thank you for you help!

Yes - the sun position represents every hour between 9am - 3pm.

Mostapha, what do you mean by ‘flip the matrix’ ?

Hi Claudia,

Please find a sample attached. I have added a small component that helps you calculate the number you’re interested in. The component has tooltip descriptions.

In the attached file, I am calculating the number of minutes as you mentioned in the original post. However, you can change the timeStep on sunpath and set it to 1 to get the number of hours.

Hope this helps!

-Devang (406 KB)

I did the same in your file. Please find revised file attached.

-Devang (583 KB)

I ran a quick study on your model. I was looking into the number of hours everyday between 9am to 3pm every month when at least 50% of test geometry would receive sunlight. Following are results.


Hi Devang - thank you so so much for you help! it works like a charm! perfect!


Sure. I enjoyed doing this. I liked this line of inquiry. Thanks for sharing this with us.

Hi Devang,

I was wondering if you may be able to help me find a solution for another extension I have made to this script? I am trying to use galapogas to solve the best solution for maximum floor area whilst remaining above the 180mins sunlight coverage at 50%. I have it currently solving for the greatest floor area but i am not sure how to add the other criteria of only finding solutions that are above the required sunlight hours (180mins) - do you have any ideas/ tips??

Please see my attached files to get a better idea of what I mean :slight_smile:

170207_sunlight analysis_script_parametric building heights_percentages_of (447 KB)
170207_sunlight analysis.3dm (4.34 MB)


Galapagos allow you ONLY one fitness function. In your case either the time or the coverage. If you want to combine them you need to create your own function that gives you one value that you can connect to galapagos.

The other option is using Octopus instead Galapagos, that will receive multiple functions.


Hi Claudia,

As Abraham pointed out, Octopus will be a better match for a multi objective optimization. However, the current Octopus version does not work with Gh 9.0076 (Crashes Rhino) so I am not able to provide a workflow for Octopus.

I have set up something using Galapagos that meets your criteria.

Please find the file attached.

Hope this helps.

-Devang (503 KB)
170207_sunlightanalysis.3dm (4.3 MB)