Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to calculate dawn / dusk times

Tags:

c

I'm currently using this code to calculate the sunrise / sunset times. (To be more precise, I'm looking for civil dawn / civil dusk times which are defined as the time when the sun is between 0° and -6° altitude). As a next step, I'd like to compute the dawn beginning and dusk ending times. I believe the calculations must be very similar.

My idea is that if I want to calculate the dawn beginning (dusk ending) time for a place I just calculate the sunrise (sunset) times for a place 6° farther east (west).

Can somebody confirm this assumption, or am I thinking wrong?

Thanks for answers!

-- Ry

EDIT: Thought about it a little more and came to the conclusion that my assumption is wrong. Moving 6° East is wrong, moving 6° orthogonal to the light/shadow-border would be right. (It becomes obvious if you imagine the earth's axis not being tilted by 23.xx° but 90° - moving east wouldn't change anything).

like image 446
ryyst Avatar asked Apr 09 '10 17:04

ryyst


1 Answers

The code that you link to uses a constant (90.833) in the calcHourAngle* methods. If you look at these definitions of sunrise/sunset, you will notice that same 90.833 constant under Technical Definitions and Computational Details. A little further down, under civil twilight, the similar constant of 96 is used. Perhaps changing that constant would get what you are looking for?

like image 51
Scott W Avatar answered Sep 30 '22 00:09

Scott W