I'd like to be able to find the latitude and longitude on Earth (assuming a sphere is fine) which is closest to Pluto at the current time (or where Pluto is directly overhead).
Is this possible with PyEphem?
I'd like to be able to find the latitude and longitude on Earth (assuming a sphere is fine) which is closest to Pluto at the current time (or where Pluto is directly overhead).
Is this possible with PyEphem?
Your question is valid and is a common operation. When computing when an object will be visible, many observers want to be able to draw a globe or map that is marked with the position from which an object like Pluto is directly overhead. Such a position on the globe at a given instant (and you do say “at the current time”) is, all other things being equal, the best-situated place from which to observe the object.
Unfortunately, the “libastro” C library that PyEphem wraps seems to only provide one instance of this concept: Earth satellites have .sublat
and .sublong
attributes, because it is so common to want to draw the path of a satellite on a globe or map.
But libastro does not generalize the concept. From what I can see, there is no way to generate the point on the Earth that is directly below any other Solar System object. And since I have not been in the habit of trying to extend libastro, it is likely that PyEphem will not gain this ability.
However, I have been developing a replacement for PyEphem that is written in pure Python and that I will be free to extend, called Skyfield. I will hopefully have this concept working there soon, and when I do so I plan to make it work for all objects, and not limit it to Earth satellites!
(In the meantime, as pointed out in the comments: you could try asking PyEphem for the geocentric RA and dec and, if you could adjust RA by the Earth's current hour angle, then you could turn those into an approximate latitude and longitude.)
The orbital speed of Earth around the Sun is 30,000 m/s, the highest mountain is about 9,000 m and the rotational speed of the surface around the polar axis is about 450 m/s. So this makes me conclude that topography such as height over the Sea has to be of little importance.
The polar axis around which the Earth turns is tilted by 23 degrees relative to the ecliptic plane of the planets' average. Pluto's orbit is 17 degrees tilted so every region on Earth between +40 and -40 degrees latitude should, sequentially in time, be the one spot on Earth's surface which is closest to Pluto. Spread out over looong times. That's about between New York and Sydney. For the least inclined planets the nearest point on Earth would be somewhere between Houston and Rio de Janeiro, i.e. every place on Earth within 24 degrees north or south of the equator (except very local depressions).
#!/usr/bin/python
import ephem, math
obs = ephem.Observer();
obs.long,obs.lat=0,0;
pl = ephem.Pluto(ephem.now())
print 180.*(pl.g_ra-obs.sidereal_time())/math.pi,180.*pl.g_dec/math.pi
To a good approximation, the code above will tell you the longitude and latitude (in that order) where Pluto is currently overhead. You can edit it for different planets/times.
lat=-20.94, lon=25.38
. Your code gives very similar results: lat=-20.9443019471, lon=25.3799291351
.
$\endgroup$