astrorigin / pyswisseph

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

BIT_HINDU_RISING ignored? #51

Closed velkyvont closed 2 years ago

velkyvont commented 2 years ago

swe.BIT_HINDU_RISING seems to be ignored

from flatlib.datetime import Datetime
import swisseph as swe
swe.set_ephe_path('/home/au/.local/lib/python3.8/site-packages/flatlib/resources/swefiles')

print (Datetime.fromJD(swe.rise_trans(swe.julday(2022, 4, 7), swe.SUN, -79.903611, 32.861389, 0, 0, 0, swe.CALC_RISE, swe.BIT_HINDU_RISING)[1][0], "-04:00"))
print (Datetime.fromJD(swe.rise_trans(swe.julday(2022, 4, 7), swe.SUN, -79.903611, 32.861389, 0, 0, 0, swe.CALC_SET, swe.BIT_HINDU_RISING)[1][0], "-04:00"))

print (Datetime.fromJD(swe.rise_trans(swe.julday(2022, 4, 7), swe.SUN, -79.903611, 32.861389, 0, 0, 0, swe.CALC_RISE)[1][0], "-04:00"))
print (Datetime.fromJD(swe.rise_trans(swe.julday(2022, 4, 7), swe.SUN, -79.903611, 32.861389, 0, 0, 0, swe.CALC_SET)[1][0], "-04:00"))

in both cases I get the same result:

<2022/04/08 06:58:19 -04:00:00>
<2022/04/07 19:44:20 -04:00:00>
<2022/04/08 06:58:19 -04:00:00>
<2022/04/07 19:44:20 -04:00:00>

I don't understand. Bug or my mistake?

velkyvont commented 2 years ago

seems like I used the parameters wrong, this version works well:

swe.rise_trans(jd_start=swe.julday(int(self.date.strftime("%Y")), int(self.date.strftime("%m")), int(self.date.strftime("%d"))), body=swe.SUN, lon=self.long, lat=self.lat, rsmi=swe.CALC_RISE | swe.BIT_HINDU_RISING)[1][0]