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

Some day angles is not coming #72

Closed bhavishyagoyal12 closed 1 year ago

bhavishyagoyal12 commented 1 year ago

When i am running following code on 22nd May 2023 I am getting angles between Jupiter and Moon but when running same code on 23 May 2023 I am not getting angle between Jupiter and Moon


  def get_angles(Begindatestring = "2023/07/18"):
  Begindate = datetime.strptime(Begindatestring, "%Y/%m/%d")

  Enddate = Begindate + timedelta(days=0)
  pos = GeoPos('18N58', '72N50')
  date = Datetime(Enddate.strftime("%Y/%m/%d"), '09:30', '+05:30')

      # Create a kerykeion instance:
      # Args: Name, year, month, day, hour, minuts, city, nation(optional)
  kanye = KrInstance("Kanye", Enddate.year, Enddate.month,Enddate.day, 9, 15,city='Mumbai',nation ='IN',tz_str ='Asia/Kolkata')
  kanye1 = KrInstance("Kanye1", Enddate.year, Enddate.month,Enddate.day, 9, 15,city='Mumbai',nation ='IN',tz_str ='Asia/Kolkata')

  name = CompositeAspects(kanye, kanye1)
  aspect_list = name.get_all_aspects() # name.get_relevant_aspects()
  df = pd.DataFrame(aspect_list)
  # ipdb.set_trace()
  df['P1_P2'] = df['p1_name'] + '-' + df['p2_name']
  # print(df)

  df2 = pd.pivot_table(df,index=None, columns='P1_P2', values='aspect_degrees')

  # # Rename the columns to combine 'p1_name' and 'p2_name'
  # df2.columns = [f"{col} {df2.columns[0].split()[1]}" for col in df2.columns]

  # ipdb.set_trace()
  # df2.drop('P1_P2',inplace=True)
  df2['date'] = Enddate
  # print(df2)
  return df2````
g-battaglia commented 1 year ago

Hi, I'm not sure what you're trying to achieve here... But it's very likely that one day there is an aspect and the next day there is not, it depends of the orbit that was set, you can set it in kr.config.json

bhavishyagoyal12 commented 1 year ago

Thanks for your comments but is there any way i can get angles between two planets even if there is no aspect ?

g-battaglia commented 1 year ago

In version 4 of the library, which will be released soon, there is a function for calculating the difference between two planet's positions: from kerykeion.charts.charts_utils import degreeDiff

bhavishyagoyal12 commented 1 year ago

Thanks I will be waiting for that version

On Wed, 26 Jul, 2023, 00:00 Giacomo Battaglia, @.***> wrote:

In version 4 of the library, which will be released soon, there is a function for calculating the difference between two planet's positions: from kerykeion.charts.charts_utils import degreeDiff

— Reply to this email directly, view it on GitHub https://github.com/g-battaglia/kerykeion/issues/72#issuecomment-1650335578, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGICHGJWGZXXCQOY7NMQWGTXSAGGDANCNFSM6AAAAAA2VCA4UY . You are receiving this because you authored the thread.Message ID: @.***>

EsoCoding commented 1 year ago

Its not to hard to calculate the distance/angle. If you code Astrology software it is not a waste of time to understand these how talculate the different between point a and b in a circle.. This is a snipped should be changed to your preferences. In this case it looks for natal aspects. anyway you calculates the absolute difference between two longitude values by substracting one posiion of the other. Abs is to to let value stay positve, and then you divide 360 degrees in 2. and it sounds harder then then it is. Example from a loop for natal aspects: And it to a function change the preferenes to fit in usage:

for i in range(0, 8):
    for j in range(0, 9):
        da = abs(planets[i] - planets[j])
        if da > 180:
            da = 360 - da
        print("The for planet "+str(i)+" and planet "+str(j)+ " is " + str(da))

Which will output somethig like this:

The for planet0 and planet0 is 0.0
The for planet0 and planet1 is 110.0
The for planet0 and planet2 is 130.0
The for planet0 and planet3 is 150.0
The for planet0 and planet4 is 94.0
The for planet0 and planet5 is 170.0
The for planet0 and planet6 is 111.0
The for planet0 and planet7 is 170.0
The for planet0 and planet8 is 110.5
The for planet1 and planet0 is 110.0
The for planet1 and planet1 is 0.0
The for planet1 and planet2 is 120.0
The for planet1 and planet3 is 40.0
The for planet1 and planet4 is 156.0
The for planet1 and planet5 is 60.0
The for planet1 and planet6 is 139.0
The for planet1 and planet7 is 80.0
The for planet1 and planet8 is 0.5
The for planet2 and planet0 is 130.0
The for planet2 and planet1 is 120.0
The for planet2 and planet2 is 0.0
The for planet2 and planet3 is 80.0
The for planet2 and planet4 is 36.0
The for planet2 and planet5 is 60.0
The for planet2 and planet6 is 19.0
The for planet2 and planet7 is 40.0
The for planet2 and planet8 is 119.5
The for planet3 and planet0 is 150.0
The for planet3 and planet1 is 40.0
The for planet3 and planet2 is 80.0
The for planet3 and planet3 is 0.0
The for planet3 and planet4 is 116.0
The for planet3 and planet5 is 20.0
The for planet3 and planet6 is 99.0
The for planet3 and planet7 is 40.0
The for planet3 and planet8 is 39.5
The for planet4 and planet0 is 94.0
The for planet4 and planet1 is 156.0
The for planet4 and planet2 is 36.0
The for planet4 and planet3 is 116.0
The for planet4 and planet4 is 0.0
The for planet4 and planet5 is 96.0
The for planet4 and planet6 is 17.0
The for planet4 and planet7 is 76.0
The for planet4 and planet8 is 155.5
The for planet5 and planet0 is 170.0
The for planet5 and planet1 is 60.0
The for planet5 and planet2 is 60.0
The for planet5 and planet3 is 20.0
The for planet5 and planet4 is 96.0
The for planet5 and planet5 is 0.0
The for planet5 and planet6 is 79.0
The for planet5 and planet7 is 20.0
The for planet5 and planet8 is 59.5
The for planet6 and planet0 is 111.0
The for planet6 and planet1 is 139.0
The for planet6 and planet2 is 19.0
The for planet6 and planet3 is 99.0
The for planet6 and planet4 is 17.0
The for planet6 and planet5 is 79.0
The for planet6 and planet6 is 0.0
The for planet6 and planet7 is 59.0
The for planet6 and planet8 is 138.5
The for planet7 and planet0 is 170.0
The for planet7 and planet1 is 80.0
The for planet7 and planet2 is 40.0
The for planet7 and planet3 is 40.0
The for planet7 and planet4 is 76.0
The for planet7 and planet5 is 20.0
The for planet7 and planet6 is 59.0
The for planet7 and planet7 is 0.0
The for planet7 and planet8 is 79.5