Reputation: 15
I try to convert J2000 RA/DEC coordinates of an object to the "observed position", i.e. topocentric RA/DEC coordinates including refraction effects. Following the docs (http://rhodesmill.org/pyephem/radec.html#how-the-three-positions-differ) I did this:
from math import pi
import ephem
from datetime import datetime
ra = 20.370473492 / 12. * pi
dec = 40.256674958 / 180. * pi
tt = datetime(2016, 07, 27, 23, 30, 0)
lowell = ephem.Observer()
lowell.lon = '-111:32.1'
lowell.lat = '35:05.8'
lowell.elevation = 2198
lowell.date = tt
lowell.pressure = 1000
bd = ephem.FixedBody()
bd._ra = ra
bd._dec = dec
bd.compute(lowell)
print "Pressure: ", lowell.pressure
print "Input: ", bd._ra, bd._dec
print "Astrometric Geocentric Position: ", bd.a_ra, bd.a_dec
print "Apparent Geocentric Position ", bd.g_ra, bd.g_dec
print "Apparent Topocentric Position: ", bd.ra, bd.dec
print "Horizontal Position: ", bd.alt, bd.az
lowell.pressure = 0
bd.compute(lowell)
print "Pressure: ", lowell.pressure
print "Input: ", bd._ra, bd._dec
print "Astrometric Geocentric Position: ", bd.a_ra, bd.a_dec
print "Apparent Geocentric Position ", bd.g_ra, bd.g_dec
print "Apparent Topocentric Position: ", bd.ra, bd.dec
print "Horizontal Position: ", bd.alt, bd.az
First notable thing is: The apparent geocentric and apparent topocentric coordinates do not differ. If corrections for parallax and refraction were made as stated in the docs, they should differ.
Second thing: If I set the pressure to zero, refraction should disappear and something should change. However, only the horizontal coordinates change (by some 11 arcminutes, that looks right), but all ra/dec coordinates stay the same.
What am I missing here?
Or in other words: Can I somehow get refraction-correction RA/DEC coordinates from pyephem?
(btw, I use the newest pyepehm version, 3.7.6.0)
Upvotes: 1
Views: 594
Reputation: 89415
The short answer is that refraction simply does not affect RA and declination.
There are two ways to visualize this. The first is to image the object you are interested in, sitting amidst a grid of RA and declination lines that make up the part of the celestial sphere where it is located. Now, in your mind, imagine looking at the object and the grid around it as they are bent by the atmosphere. Because they are passing through the same atmosphere, they will be refracted the same amount — and the object's refracted image will be in the same position relative to the image of the refracted RA and declination lines as it was before! So its RA and declination are still the same.
Another way to visualize it is to imagine that the planet's RA and declination tell you what little group of distant objects the planet will be in front of — which distant galaxies and quasars the object will be sitting among. Now, if you will imagine the patch of sky where the object is sitting, and imagine the image of that patch of sky being refracted through the atmosphere, you will see that the objects and planet all get refracted together. So, again, refraction will not change the object's RA and declination — it will appear in front of exactly the same galaxies as it would have if there were no refraction at all.
The long answer is that, to create the number you are imagining, you could probably take the horizontal coordinates, set the observer's atmosphere to zero pressure, and use the observer's .radec_of(...)
method to turn the horizontal coordinates back into the RA and dec that would sit at that position on the sky if the atmosphere were not refracting them. But I hope that the above discussion makes clear that the numbers you get out, strictly speaking, will have no physical meaning or significance: RA and declination do not change because of refraction, and the changed RA and declination you get back will not refer to any true position on a sky chart.
Upvotes: 1