Understanding astronomical refraction