g-battaglia / kerykeion

Data driven Astrology 💫
Kerykeion is a python library for astrology. It can generate SVG charts and extract all data about a birthchart, a synastry chart and a transit chart.
https://kerykeion.net
GNU Affero General Public License v3.0
297 stars 103 forks source link

Zodiac Type #102

Closed must-be-rohit closed 1 month ago

must-be-rohit commented 8 months ago

Hello, What is the way to convert the zodiac calculations from Tropic to Sidereal print(Kundali.zodiac_type) Tropic

must-be-rohit commented 8 months ago

After studying the code got the parameter zodiac_type="Sidereal" under AstrologicalSubject() that can be used to change the calculations. Even after changing the type, the planet positions do not match with the positions provided by astrology software.
How to use this mode from the main swisseph swe.set_sid_mode(swe.SIDM_LAHIRI)

must-be-rohit commented 8 months ago

While studying the code further I got to the module astrological_subject and the SIDM flag is not set to LAHIRI due to which certain calculations for sidereal are incorrect.

def _planets_degrees_lister(self): """Sidereal or tropic mode.""" self._iflag = swe.FLG_SWIEPH + swe.FLG_SPEED

    if self.zodiac_type == "Sidereal":
        self._iflag += swe.FLG_SIDEREAL
        **#mode = "SIDM_FAGAN_BRADLEY"
        mode = "SIDM_LAHIRI"**
        swe.set_sid_mode(getattr(swe, mode))

Possible to rollout a fix for this?

g-battaglia commented 8 months ago

Hi, thank you for pointing out that problem, if you submit a pull request with the fix I'll be glad to integrate your code!

must-be-rohit commented 7 months ago

I just created the pull request with the update, if you can verify and merge

g-battaglia commented 7 months ago

I have to take a better look at it, this pull request makes "SIDM_LAHIRI" the default, the best option would be to create another kwarg to the AstrologicalSubject class

g-battaglia commented 2 months ago

@must-be-rohit I updated the AstrologicalSubject class to have the possibility to set a sidereal mode (Ayanamsa), here a code snippet as example:

johnny = AstrologicalSubject("Johnny Depp", 1963, 6, 9, 0, 0, "Owensboro", "US", zodiac_type="Sidereal", sidereal_mode="LAHIRI")

Let me know if it works!