> P.S. Using this has made it clear to me how bad most sunrise/sunset calculators actually are.
That may just be a function of how you define "sunrise" and "sunset". It is never as simple as "when the sun hits the horizon", but something about some number of arc minutes from something something.
Dependent on the refractive index, which depends on air density and temperature and humidity too; and we have to integrate over the region between the horizon and the upper atmosphere (diagonally, of course)…
To be clear I was complaining that basically everyone calculates “sunrise” and “sunset” differently. If you check half a dozen different “sunset” calculators you will get a surprisingly wide variation in the times they provide. At least where I live the error seems to average 5-10 minutes.
That may just be a function of how you define "sunrise" and "sunset". It is never as simple as "when the sun hits the horizon", but something about some number of arc minutes from something something.