end
--[[ Ported from https://pypi.org/project/suntime/
- which is based on https://stackoverflow.com/questions/19615350/calculate-sunrise-and-sunset-times-for-a-given-gps-coordinate-within-postgresql
+ which is based on https://stackoverflow.com/questions/19615350/
which took the algorithm from https://web.archive.org/web/20161022214335/https://williams.best.vwh.net/sunrise_sunset_algorithm.htm
year: number
if(cosH > 1) then
-- return None -- The sun never rises on this location (on the specified date)
print("Sun will never rise here and now.")
- os.exit()
+ os.exit(1)
elseif(cosH < -1) then
-- return None -- The sun never sets on this location (on the specified date)
print("Sun will never rise here and now.")
- os.exit()
+ os.exit(0)
end
-- 7b. finish calculating H and convert into hours