I am finding that when I convert an (Alt, Az) to an (Ra, Dec) and then back with PyEphem, I don't get what I started with. Below is a simple example.
import ephem
print ephem.__version__
# '3.7.3.4'
gbt = ephem.Observer()
gbt.long = '-79:50:23.4'
gbt.lat = '38:25:59.23'
gbt.pressure = 0 # no refraction correction.
gbt.epoch = ephem.J2000
# Set the date to the epoch so there is nothing changing.
gbt.date = '2000/01/01 12:00:00'
# Should get the north pole right?
ra, dec = gbt.radec_of(0, '38:25:59.23')
# Not the north pole... error might be abberation.
print dec
# 89:59:30.5
# Now check internal consistancy by reversing the calculation.
pole = ephem.FixedBody()
pole._ra = ra
pole._dec = dec
pole._epoch = ephem.J2000
pole.compute(gbt)
# Should get what I started with right?
alt = pole.alt
# Not what I started with... error unknown.
print alt
# 38:26:26.7
As noted in the comments, not getting exactly the north pole might just be stellar aberration, although the 30" is more than Wikipedia stated maximum effect of 20".
The fact that I don't get the same thing when I do the reverse calculation is truly puzzling me. Any suggestions?