-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathasteroids.py
More file actions
29 lines (16 loc) · 727 Bytes
/
asteroids.py
File metadata and controls
29 lines (16 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import astrology
class Asteroid:
"""Data of an Asteroid"""
def __init__(self, tjd_ut, aId, flag):
self.aId = aId
rflag, dat, serr = astrology.swe_calc_ut_ex(tjd_ut, aId, flag)
rflag, datEqu, serr = astrology.swe_calc_ut_ex(tjd_ut, aId, flag+astrology.SEFLG_EQUATORIAL)
self.data = (dat[0], dat[1], datEqu[0], datEqu[1])
self.name = astrology.swe_get_planet_name(aId)
class Asteroids:
"""Calculates the positions of the asteroids"""
ids = [astrology.SE_CERES, astrology.SE_CHIRON, astrology.SE_JUNO, astrology.SE_PALLAS, astrology.SE_PHOLUS, astrology.SE_VESTA]
def __init__(self, tjd_ut, flag):
self.asteroids = []
for i in Asteroids.ids:
self.asteroids.append(Asteroid(tjd_ut, i, flag))