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

Sidereal zodiac calculations: are they possible at all? #48

Closed sundraw closed 2 years ago

sundraw commented 2 years ago

Here is what documentation says:

To compute sidereal positions, set bit FLG_SIDEREAL and use the function set_sid_mode() in order to define the ayanamsha you want. For more information, read to chapter TODO

I.e. documentation wasn't completed. Here is what I tried:

swe.set_sid_mode(swe.SE_SIDM_LAHIRI)
jd = jd_from_date(moment)
sun = swe.calc_ut(jd, swe.SUN, swe.FLG_SIDEREAL)[0][0]

The result is:

module 'swisseph' has no attribute 'SE_SIDM_LAHIRI'

How do I define the ayanamsha then?

sundraw commented 2 years ago

I tried to do the calculation without setting the preferred ayanamsha and it was successful but I can guess that the default ayanamsha is Fagan/Bradley, i.e. no what I need.

sundraw commented 2 years ago

I found out by experimenting and searching through documentation that swe.SIDM_LAHIRI does give me the desired result.