Tuesday, 26 April 2016

positional astronomy - Get date and time by position of the sun and the observer position

Ok guys, I've found the solution. Sadly, if you really want to know the really exact datetime, there is no exact and universal formula.



I found several formulas:



http://physics.stackexchange.com/questions/25336/reverse-sun-position-algorithm



http://www.pveducation.org/pvcdrom/properties-of-sunlight/declination-angle



http://www.itacanet.org/the-sun-as-a-source-of-energy/part-3-calculating-solar-angles/



There are several problem with these formulas.



What I'd like to know?



As I mentioned in my original post, I have a datetime, and a geolocation, and with that Swiss ephemeris program, I can "query" the angle of the sun.



From this point, I substract 88 degree with this angle, and I want to know the exact date time by the angle and the geolocation.



The problems



The first problem is the declination. There are several problems with this. The declination is not the same at every day in a year as you know. Ok, let's say, I want to figure it out. I can not. Since, I want to know the exact date first, I do not know, the ordinal date. Sigh, at this point the whole formula has a missing value. But, let's assume, I know. Even, if I know the ordinal date, the formula is not right, because the declination is not the same at 2015-01-01 and 2016-01-01. Let's see:



swetest.exe -edirD:/Apache/htdocs/astro/vendors/swiss/ -b01.01.2010 -geopos19.2,47.29,0 -topo  -p0 -eswe -fPlTd -g, -head -n5 -s365.4
Sun , 280.4507684,01.01.2010,-23.0283899
Sun , 280.6104798,01.01.2011 9:36:00 ET,-23.0160751
Sun , 280.7713793,01.01.2012 19:12:00 ET,-23.0008866
Sun , 280.9345061,01.01.2013 4:48:00 ET,-22.9876598
Sun , 281.0890407,01.01.2014 14:24:00 ET,-22.9741190


-22...., -23... is the declination. Declination is the same in a day.



So these formulas can gives you approximate results, but not the exact, even if you know the ordinal date. And I think, the formula is does not calculate with the leap years.



The solution



In my case, the solution was to track back 95 days, and get 20 recors for every day from that time. 95 because the sun is moving 1 degree about 1 day and 2-3 hours. The sun has different speed at different dates, 95days seems enought for me for 88 degree.



With my program, I am checking, where the integer values are equals. For example, if I need to get 69.217465 degree I am just checking, where the sun was in 69.xxxxx position.



When I have this date, I am track back 3 days, and list the values by hours, 72 hours. I get the proximate date and time. And after this, I track back 3 hours, and listing the results by seconds.



This will be the exact (most proximate) date and time.



From a Yahoo group, a guy told me, this is an interpolation. This is how you can get the exact date time for a given angle, I do not know more precise method. If you know, please write me.

No comments:

Post a Comment