astrorigin / pyswisseph

Python extension to the Swiss Ephemeris
https://astrorigin.com/pyswisseph
GNU Affero General Public License v3.0
228 stars 65 forks source link

Issues in calculating the nakshatra #30

Closed dalalns closed 4 years ago

dalalns commented 4 years ago

could you please check why i am getting wrong nakshatra while using this library. I have create the question and posted on stackoverflow at below location. https://stackoverflow.com/questions/62200954/using-pyswisseph-getting-wrong-output-while-finding-nakshatra

astrorigin commented 4 years ago

No idea, but if you're using the development version of pyswisseph, you could try this:

import swisseph as swe
from swisseph import contrib as swh

swe.set_ephe_path('/usr/share/swisseph')

res, flg = swe.calc_ut(swh.jdnow(), swe.MOON)
nak, pada = swh.long2nakshatra(res[0])
print('Nakshatra = %d, pada = %d' % (nak, pada))

The contrib module previously was private-hidden in the swe module, so just put an underscore before the function.

Edit: of course add/edit this to fit your parameters, ayanamsa etc.

I would also add that contributions from expert indian astro-programmers would be greatly appreciated.