Observer.radec_of() incorrect?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PyEphem |
Invalid
|
Medium
|
Brandon Rhodes |
Bug Description
Why doesn't separation2 in the following script have a value of 0.1?
Is this a bug or am I misunderstanding what obs.radec_of() is doing?
import ephem
obs = ephem.Observer()
#obs.lon, obs.lat, obs.elevation = 0, 0, 0
#obs.epoch = '2000'
#obs.date = '2001/01/01'
altitude = 0.1
az1, alt1 = 0, 0
az2, alt2 = 0, altitude
ra1, dec1 = obs.radec_of(az1, alt1)
ra2, dec2 = obs.radec_of(az2, alt2)
print 'ra1, dec1 = ', ra1, dec1
print 'ra2, dec2 = ', ra2, dec2
# I would expect separation == elevation, but this is not the case
print 'altitude = ', altitude
print 'separation1 = ', ephem.separatio
print 'separation2 = ', ephem.separatio
"""
Output:
ra1, dec1 = 0:13:46.67 89:22:17.4
ra2, dec2 = 12:13:42.27 84:29:00.3
altitude = 0.1
separation1 = 0.1
separation2 = 0.107251950977"""
Your code is asking "if one object appears at the horizon and another at 0.1 radians above it (about 5.729578°) then what is the REAL angle between them on a star chart?" And since the atmosphere artificially curves the image of objects upwards near the horizon, two objects must in reality be farther apart than 0.1 radians to APPEAR a mere 0.1 radians apart in altitude in the sky.
To turn off the effects of the atmosphere, set "obs.pressure = 0" and the separation2 should be very close to 0.1 — I am not finding that it is EXACTLY equal, but that might be because of the trig functions not wanting to work exactly backwards — or is there another slight effect besides atmospheric distortion that I am forgetting about? :)