Hard cutoff in Atmospheric Refraction near the horizon #1105
Replies: 2 comments 2 replies
-
|
I'm intrigued. Are you completely bypassing Skyfields's refraction calculations, and implementing your own? I'm building a sensor that updates the elevation at every 0.5 degrees, by using find_descrete to find when it crosses the next 0.5 degree threshold, and then calling altaz() at the returned time. Works perfectly, except at elevations between about -1, and -0.4. I suspect the problem is related to Skyfield's hard cutoff for refraction at -1. I definitely like how refraction was handled better in pyephem. Edit: I believe I know what you're saying, and I'm working my own plan to accomplish the same! Thanks for the idea! |
Beta Was this translation helpful? Give feedback.
-
When Skyfield was first written, its goal was to give exactly the positions returned by the science-grade USNO library NOVAS which, as it happens, cuts off refraction at –1.0° because by that point the object is below the horizon and isn't visible. And so Skyfield did the same, because it meant that the two libraries could be compared, for testing purposes, to very high precision. Which was useful because NOVAS was written by actual professionals in astrometry, whereas I wrote Skyfield merely as an amateur astronomer who happened to love Python. 🙂 But the sudden jump is indeed annoying. Maybe it could be kept, but be hidden behind a compatibility flag (like In your own code, I assume that –3 and –5 are arbitrary design choices, just as –1 was for the NOVAS authors? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi. I am using Skyfield to calculate precise celestial object positions for a visualization. I have observed a significant, non-physical jump (discontinuity) in the calculated apparent altitude precisely when the object crosses the geometric altitude threshold of$-1.0^\circ$ .
This issue is visible as a sudden, sharp drop in the object's apparent position, which creates an artifact in any system that requires smooth, continuous altitude tracking.
This behavior seems to stem from the hard cutoff implemented in the core refraction logic, where the full correction
dis applied only within a strict range:When alt_degrees is$<-1.0^\circ$ , the refraction correction is instantly set to $0.0^\circ$ , causing the jump.
Why was the specific value of$-1.0^\circ$ chosen as the strict lower limit for applying the refraction correction, rather than a deeper limit like $-3^\circ$ or $-5^\circ$ ? Does this choice stem from a known limitation of the underlying Bennett formula at that specific point? Given that the refraction effect does not vanish instantaneously in the physical world, why was a smooth transition (e.g., tapering, blending, or damping) not implemented to bridge the gap between the full correction at $-1.0^\circ$ and zero correction further below the horizon?
For applications requiring smooth altitude progression, this discontinuity is problematic. I have already tested a solution using a cosine damping function that gradually fades the refraction correction to zero between$-3.0^\circ$ and $-5.0^\circ$ of geometric altitude.
This method entirely removes the jump. If you are interested in this approach, I can share the implementation details.
Beta Was this translation helpful? Give feedback.
All reactions