from flatlib.datetime import Datetime
from flatlib.geopos import GeoPos
from flatlib.chart import Chart, const
# Date: 2005-03-03 Time: 6:45 AM UTC: +5:30
date = Datetime([2005, 3, 3], ['+',6,45,0], "+05:30")
pos = GeoPos(19.0760, 72.8777)
print("lat: ", pos.lat, "lng: ", pos.lon)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import datetime | |
def date_utc_to_julian(year, month, day, hour, minute, second, utc_offset_hours, utc_offset_minutes): | |
# Convert the date to a datetime object | |
dt = datetime(year, month, day, hour, minute, second) | |
# Calculate the Julian date offset | |
julian_offset = 2440587.5 | |
# Calculate the number of seconds in a day | |
seconds_per_day = 86400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import swisseph as swe | |
from datetime import datetime | |
def date_utc_to_julian(year, month, day, hour, minute, second, utc_offset_hours, utc_offset_minutes): | |
# Convert the date to a datetime object | |
dt = datetime(year, month, day, hour, minute, second) | |
# Calculate the Julian date offset | |
julian_offset = 2440587.5 | |
# Calculate the number of seconds in a day |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import swisseph as swe | |
# pyswisseph version used 2.10.3.2 | |
def planets_rashi(year, month, day, hour, minute, second, latitude, longitude, tzoffset): | |
""" | |
This is a simple python script to calculate planets and rashi | |
""" | |
swe.set_sid_mode(swe.SIDM_LAHIRI, 0, 0) # Set the Ayanamsa | |
flags = swe.FLG_SWIEPH + swe.FLG_SPEED + swe.FLG_SIDEREAL |