How to calculate dawn / dusk times
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 calculatio开发者_如何学JAVAns 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).
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?
i don't have a comment on your code, but you can use the following site to verify the output from your program: http://aa.usno.navy.mil/data/docs/RS_OneYear.php
This works, but only if it's okay to assume that elevation is insignificant. Depending on how exact you need to be, someone on a high mountaintop will experience sunrise (or sunset) slightly before (or after) somebody at sea level. For instance, if you're standing on Mount Everest, sunrise and sunset are shifted apart by ~16 minutes, relative to sea level (source: back of the envelope math).
Note that the more extreme your latitude, the starker the contrasts between longer summer days and longer winter nights. Some places on Earth receive sunlight all 24 hours of the day during summer and are shrouded in darkness all 24 hours of the night. These places don't have a daily "dawn" or "dusk", although you could pick the times halfway in between when the sun is lowest and highest in the sky.
This doesn't work. An easy way to prove this to yourself is that at the poles, the elevation of the sun doesn't change as you rotate your body, so going east or west by 6 degrees won't affect your times.
If you're closer to the equator, this calculation will probably be more accurate, but I don't think it's ever perfect.
精彩评论