问题
I have difficulties with finding current coordinates (RA, DEC) for star in sky. In net I have found only this one tutorial, how to use ephem library: http://asimpleweblog.wordpress.com/2010/07/04/astrometry-in-python-with-pyephem/
As I understood I need to:
- create observer
telescope = ephem.Observer() telescope.long = ephem.degrees('10') telescope.lat = ephem.degrees('60') telescope.elevation = 200
Create a body Object star here is trouble, I have only (RA,DEC) coordinates for star
Calculate position by .calculate(now())
by new coordinates find altitude
One more question about accuracy of this library, how accurate it is? I have compared juliandate and sidestreal time between this program and kstars, looks like quite similar.
and this http://www.jgiesen.de/astro/astroJS/siderealClock/
PS! Or may be some one can reccomend better library for this purposes.
回答1:
I guess you're looking for FixedBody?
telescope = ephem.Observer()
telescope.long = ephem.degrees('10')
telescope.lat = ephem.degrees('60')
telescope.elevation = 200
star = ephem.FixedBody()
star._ra = 123.123
star._dec = 45.45
star.compute(telescope)
print star.alt, star.az
I don't know about the accuracy; pyephem uses the same code as xephem, and eg the positions of the planets are given by rounded-down VSOP87 solutions (accuracy better than 1 arcsecond); kstars appears to use the full VSOP solution.
But this will really depend on your need; eg don't rely on it blindly guiding your telescope, there are better solutions for that.
回答2:
star = ephem.FixedBody(ra=123.123, dec=45.45)
in my case fixedbody creation does not work, should be
star = ephem.FixedBody()
star._ra = ephem.hours('10:10:10')
star._dec = ephem.degrees('10:10:10')
来源:https://stackoverflow.com/questions/6870743/calculation-star-position-in-the-sky-pyephem