Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calculate the date & time given the position of the sun (Azimuth & elevation) and latitude and longitude

Related to this extremely helpful question regarding finding the azimuth & elevation of the sun for a given date, and coordinates. I wish to find the inverse: times & dates the sun will be in that position of the sky.

Therefore I am wondering could someone help with maybe an existing formula or modifying the one linked to.

My current idea was to take two ranges with a variation of a couple of degrees for both, one for the azimuth (120-123 degrees) and elevation (18-21 degrees). Then write an algorithm to iterate through all days / times, and check if the given ranges exist for a time on that day. Looping through these days and using the attached algorithm isn't exactly going to keep Big O small, and also won't be best for performance.

Any help or tips appreciated, please.

Thanks.

like image 944
Brian Halpin Avatar asked Jan 08 '13 16:01

Brian Halpin


1 Answers

There is some useful stuff here (see the links - in particular [12]-[15])

https://en.wikipedia.org/wiki/Position_of_the_Sun

One problem is if you are using this to determine things like "which days would the sun be directly over the 'Heel Stone' at Stonehenge in Z-thousand BC", then there will be a lot of sources of errors beyond precession and/or nutation (earthquakes change the earths rotation period, when the Sun is close to the horizon you'll get some significant refraction). There is also http://www.stargazing.net/kepler/sun.html . However, as there are many days and times when the sun is in a particular position, the method of guessing a window of date and time and then doing a Newton-style approximation iteratively is probably best. Perhaps if you could give more information as to why you are trying to find the answer (i.e."when does the shadow of the oak tree fall on the buried treasure..."), we could be more helpful?

like image 96
peter Avatar answered Oct 11 '22 02:10

peter