6 ms·
Two pictures 10 minutes apart of sun close to the horizon (and UTC Timecode) is all you need. Python Astropy gives also size of the sun (i.e. photo scale), so y
by timonoko 4y ago
Two pictures 10 minutes apart of sun close to the horizon (and UTC Timecode) is all you need. Python Astropy gives also size of the sun (i.e. photo scale), so you have everything you need to reverse this function.
def sun_angle(mon,day,hour,min,sec,lat,lon):
import astropy.coordinates as coord
from astropy.time import Time
import astropy.units as u
loc = coord.EarthLocation(lon=lon * u.deg, lat=lat * u.deg)
times = f'2022-{mon}-{day}T{hour}:{min}:{sec}'
now = Time(times, format='isot', scale='utc')
altaz = coord.AltAz(location=loc, obstime=now)
sun = coord.get_sun(now).transform_to(altaz).alt
return sun.degree
- timonoko 4y agoForgot the bloody atmospheric distortion. But no worries, Astropy has estimate for that too, know as "parallax correction".
- timonoko 4y agoMy Bad. "Parallax Correction" was for the camera's altitude (or photographers height). The atmospheric correction was something else.
- timonoko 4y agoBTW. In urban environment there are plenty of horizontal lines pointing to the vanishing point. Thus it is totally possible to make a camera app, which calculates your position from the sun alone. This might make total sense in Urban Warfare, when the enemy has blocked GPS signals.