algorithmic modeling for Rhino

Hi Mostapha, Chris and Abram

Having read Kimia's comment, I made a new potential component that finds sunrise, sunset for anyplace on earth using equations from Astronomical Algorithms, by Jean Meeus.
Besides these two output, it calculates the solar position (elevation angle and azimut) considering the atmospheric refraction.
I saw the difference between solInitOutput (based on Radiance) and the script that I wrote (based on NOAA). Some formulas are the same, while others are different. for example "Julian day", "solar altitude"..
Anyway, they are two different models.
At the moment the imputs are:
1) location
2) analysis period
3) year
and the outputs are:
1) civil twilight
2) official sunrise/sunset
3) solar elevation angle
4) solar azimut
This is an example where I used data of a real place.

and these are two photos that I took in this place.

SUNRISE (Civil Twilight) 06:44 AM

SUNRISE (Official) 07:14 AM
Note that in the first photo the street lights are on, while in the second are off because of the good level of luminous energy.
I hope that it could be useful.


Views: 3186


Replies are closed for this discussion.

Replies to This Discussion

This is the latest version of LB sunrise sunset.

a) Input: HOYs outputs of LB HOY_DOY

b) Input:  for example, lists of values from 1 to 8760

c) Input: LB AnalysisPeriod



In addition, it is possible to combine SunIsUp with SunLightDuration.

Hi Antonello, 

Awesome! Just like to ask you a further question. Let's say we want to do Ladybug_solar envelope study for a site and we expect to know the volume generated on site will have no solar blocking impact on surrounding targeted buildings.

So far I can define an analysis period however they are not relevant to sunrise/sunset. 

Since solar height near sunset/sunrise is very low and I intend to exclude them from the calculation. The criteria could be defined, for example 2hrs after sunrise and 2hrs before sunset.

Is it possible a schedule with respect to such criteria could be generated and input into "Ladybug_sun path" so that the calculation of "Ladybug_solar envelope" will be dynamic and respect each day's sunrise/sunset hours? 

Your feedback will be greatly appreciated!




Have you seen this example? Boris has also created this video. You can use sunpath to generate to sun-vectors for any desired time.

Hi, Mostapha

Thanks for your prompt reply.

I believe I saw two examples published by Boris but I could not figure out a way to follow sunrise/sunset hrs everyday. Then I used a walkaround by modifying weather file to trace down those precise hours everyday.

I may miss details in Boris's example files and video. I will look them again.Thank you so much for your help. 

Have a nce weekend! Cheney

Hi Cheney,

your idea sounds good. If I understood well, you want to filter analysis period and it should show you just the period that goes from 2 hours after the sunrise to 2 hours before the sunset (for example) for each day of the year.
And then, you want to use the vectors which come from the filter above for sun envelopes.
I think it is possible, I'll try to add your idea to sunset/sunrise component as soon as possible. Thanks!


Hi Antonello, 

Thanks for your reply. 

Yes, it wouod be great to see a schedule which can respect your sunrise/sunset calc with time adjustment filter. Eventually it can be directed into sun path calculation and exclude those sun vectors near sunrise/sunset. 

I am currently using a walkaround by modifying epw weather file to filter out sun vectors and notice I can get the results I expected. So it is doable. You guys are awsome at writing the code and I really enjoy the way of communication in this forum which sharpens LB HB a more powerful tool! 

Regards, Cheney

Hi Cheney,

I added your idea to LB sunrise/sunset. It works with IsSunUp output which is a list of 0 and 1 which also works as boolean pattern. 0 means the sun is down, 1 means the sun is up. The idea comes from Chris.

Now, I should think how to connect it to LB sun path. If you look well, LB sun path does not append outputs when the sun is down, whilst isSunUp output of LB sunrise/sunset works for all the hours you connect obviously.

here for you, a couple of images:

Meanwhile you can try the updated version of the component in the attached file.

Hi Mostapha,

During my tests I noted this:

Yellow: LB sun path

Blue: LB sunrise/sunset

Could it be related to the question you have discussed here?




Hi Antonello, 

Somehow I could not reply your latest post (with "LB" attached).

The "isSunUpshit_" filter is awesome! I also like the idea of "IsSunUp" output. I am still a GH newbie, but why not using "IsSunUp" output to filter out your 8760hrs "sun vector" output and eventually feed LB "sun path"? You have all the necessary output to do such calculation.      

I am also thinking, in addition to "isSunUpshit_", an additional filter which could respect solar altitude will also be very helpful. What do you think? purely relying on a fixed hours before/after sunset/sunrise might be rigid.




Hi Cheney

Good news, I have also added the second filter, take a look here:

Now you can combine the two filters.

I have to do a couple of checks, however I think it is already good.



Hi Antonello,

Awesome! This is a great component and I've used it to define solar exposure volume successfully (by taking your output to modify epw weather file). 

Hopefully in the near future this component can be directed to sunpath/analysisPeriod_ so that requested sunVectors could be exported.   

Thanks for your great help! 

Regards , Cheney 

Hi Cheney,

You can find the last version of ladybug sunrise sunset with the conditional statement for the sun altitude in the updated version of LB.

You can update your LB version directly by using "Ladybug_Update Ladybug".







  • Add Photos
  • View All


  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service