Search code examples
pythonpyephem

In python ephem I am unable to get position's of certain constellations


import ephem

date = '2018/9/20'

sun = ephem.Sun()
sun.compute(date)
print 'Sun in', list(ephem.constellation(sun))[1]

moon = ephem.Moon()
moon.compute(date)
print 'Moon in', list(ephem.constellation(moon))[1]

mars = ephem.Mars()
mars.compute(date)
print 'Mars in', list(ephem.constellation(mars))[1]

mercury = ephem.Mercury()
mercury.compute(date)
print 'Mercury in', list(ephem.constellation(mercury))[1]

jupiter = ephem.Jupiter()
jupiter.compute(date)
print 'Jupiter in', list(ephem.constellation(jupiter))[1]

venus = ephem.Venus()
venus.compute(date)
print 'Venus in', list(ephem.constellation(venus))[1]

saturn = ephem.Saturn()
saturn.compute(date)
print 'Saturn in', list(ephem.constellation(saturn))[1]

I have found the all 7 planets in their house for the specific date. Now I am in need to find the Rahu and Ketu house in a astro table. How to get that? Is there any functions for it?


Solution

  • I am quite sure that only real planets are available in ephem. I found this definition

    Astronomically, Rahu and Ketu denote the points of intersection of the paths of the Sun and the Moon as they move on the celestial sphere.

    Using some math will tell you the points. Maybe this might help you to transform the coordinates between the different systems.

    From that you could derive a view point in ephem, it is called an Observer and pass it to ephem.constellation(o),