Пример #1
0
  def __init__(self, date, hour_min, utc, geo_pos_1, geo_pos_2):
    # Build a chart for a date and location
    date = Datetime(date, hour_min, utc)
    pos = GeoPos(geo_pos_1, geo_pos_2)
    chart = Chart(date, pos, hsys=const.HOUSES_PLACIDUS, IDs=const.LIST_OBJECTS) #Page 25, livre: Cours complet d'astrologie
    
    # Prepare angles
    angles = []
    angles.append(chart.get(const.ASC))
    angles.append(chart.get(const.IC))
    angles.append(chart.get(const.DESC))
    angles.append(chart.get(const.MC))

    # Prepare houses
    houses = []
    houses.append(chart.get(const.HOUSE1))
    houses.append(chart.get(const.HOUSE2))
    houses.append(chart.get(const.HOUSE3))
    houses.append(chart.get(const.HOUSE4))
    houses.append(chart.get(const.HOUSE5))
    houses.append(chart.get(const.HOUSE6))
    houses.append(chart.get(const.HOUSE7))
    houses.append(chart.get(const.HOUSE8))
    houses.append(chart.get(const.HOUSE9))
    houses.append(chart.get(const.HOUSE10))
    houses.append(chart.get(const.HOUSE11))
    houses.append(chart.get(const.HOUSE12))

    # Prepare planets
    planets = []
    planets.append(chart.get(const.SUN))
    planets.append(chart.get(const.MOON))
    planets.append(chart.get(const.MERCURY))
    planets.append(chart.get(const.VENUS))
    planets.append(chart.get(const.MARS))
    planets.append(chart.get(const.JUPITER))
    planets.append(chart.get(const.SATURN))
    planets.append(chart.get(const.URANUS))
    planets.append(chart.get(const.NEPTUNE))
    planets.append(chart.get(const.PLUTO))
    planets.append(chart.get(const.CHIRON))
    planets.append(chart.get(const.NORTH_NODE))
    planets.append(chart.get(const.SOUTH_NODE))
    planets.append(chart.get(const.PARS_FORTUNA))
    self.data = export(angles=angles, houses=houses, planets=planets)
    
    This recipe shows sample code for handling 
    accidental dignities.

"""

from flatlibfr import const
from flatlibfr.chart import Chart
from flatlibfr.datetime import Datetime
from flatlibfr.geopos import GeoPos

from flatlibfr.dignities import accidental
from flatlibfr.dignities.accidental import AccidentalDignity

# Build a chart for a date and location
date = Datetime('2015/03/13', '17:00', '+00:00')
pos = GeoPos('38n32', '8w54')
chart = Chart(date, pos)

# Get some objects
obj = chart.get(const.VENUS)
sun = chart.get(const.SUN)

# Sun relation
relation = accidental.sunRelation(obj, sun)
print(relation)

# Augmenting or Diminishing light
light = accidental.light(obj, sun)
print(light)
Пример #3
0
"""
    Author: João Ventura <*****@*****.**>
    
    
    This recipe shows sample code for calculating the dates
    of the previous and next solar and lunar eclipses.

"""

from flatlibfr.datetime import Datetime
from flatlibfr.ephem import ephem

# Build a Datetime object
date = Datetime('2016/10/11', '12:00', '+00:00')

# Get the date of the maximum phase of the next global lunar eclipse
lunar_eclipse = ephem.nextLunarEclipse(date)
print(lunar_eclipse)  # <2017/02/11 00:43:48 00:00:00>

# Get the date of the maximum phase of the next global solar eclipse
solar_eclipse = ephem.nextSolarEclipse(date)
print(solar_eclipse)  # <2017/02/26 14:53:23 00:00:00>
Пример #4
0
    plt.ylabel('Distance in minutes')
    plt.xlabel('Year')
    plt.title(title)
    plt.axhline(y=0, c='red')
    plt.show()


# Set the starting year
sYear = 1980

# Get successive spring equinox dates
equinoxes = []
span = 100
for year in range(sYear, sYear + span):

    # Get the spring equinox date for the year
    dt = Datetime('%s/01/01' % year, '00:00')
    sr = ephem.nextSolarReturn(dt, 0.00)
    equinoxes.append([year, sr.jd])

# Compute successive differences
diffs = []
for i in range(len(equinoxes) - 1):
    year1, jd1 = equinoxes[i]
    year2, jd2 = equinoxes[i + 1]
    diffs.append([year1, (jd2 - jd1 - 365.2425) * 24 * 60])

print(diffs)
title = 'Solar year length from %s to %s\n' % (sYear, sYear + span)
title += '(Compared to average year of 365.2425)'
plot(diffs, title)
Пример #5
0
    Author: João Ventura <*****@*****.**>
    
    
    This recipe shows sample code for handling 
    solar returns.

"""

from flatlibfr import const
from flatlibfr.chart import Chart
from flatlibfr.datetime import Datetime
from flatlibfr.geopos import GeoPos
from flatlibfr.predictives import returns

# Build a chart for a date and location
date = Datetime('2013/06/13', '17:00', '+01:00')
pos = GeoPos('38n32', '8w54')
chart = Chart(date, pos)

# Get the next solar return Chart given a date
today = Datetime('2015/04/06', '10:40', '+01:00')
srChart = returns.nextSolarReturn(chart, today)

# Print the date and Asc
asc = srChart.get(const.ASC)
print(asc)  # <Asc Taurus +26:25:47>
print(srChart.date)  # <2015/06/14 04:38:37 01:00:00>

# Solar return of the year
srChart = chart.solarReturn(2015)
print(asc)  # <Asc Taurus +26:25:47>
Пример #6
0
 def setUp(self):
     self.date = Datetime('2015/03/13', '17:00', '+00:00')
     self.pos = GeoPos('38n32', '8w54')
Пример #7
0
    years = [elem[0] for elem in hdiff]
    hours = [elem[1] for elem in hdiff]
    plt.plot(years, hours)
    plt.ylabel('Hour distance')
    plt.xlabel('Year')
    plt.title(title)
    plt.axhline(y=-24, c='red')
    plt.show()


# Set the birth date and time
date = [1983, 3, 21]
time = ['+', 0, 0, 0]

# Get the sun position at birth
dt = Datetime(date, time)
pos = GeoPos('38n32', '8w54')
sun = ephem.getObject(const.SUN, dt, pos)

# Collect hour differences for the following 100 years
hdiff = []
span = 100
for year in range(date[0], date[0] + 1 + span):

    # Get solar return of the year
    dt = Datetime('%s/01/01' % year, '00:00')
    sr = ephem.nextSolarReturn(dt, sun.lon)

    # Create anniversary date for the year
    date[0] = year
    an = Datetime(date, time)
Пример #8
0
"""
    Author: João Ventura <*****@*****.**>
    
    
    This recipe shows sample code for handling 
    profections.

"""

from flatlibfr import const
from flatlibfr.chart import Chart
from flatlibfr.datetime import Datetime
from flatlibfr.geopos import GeoPos
from flatlibfr.predictives import profections


# Build a chart for a date and location
date = Datetime('2011/03/13', '17:00', '+00:00')
pos = GeoPos('38n32', '8w54')
chart = Chart(date, pos)

# Get the profection Chart for a date
today = Datetime('2015/04/06', '10:40', '+01:00')
pChart = profections.compute(chart, today)

# Print the Asc
asc = pChart.get(const.ASC)
print(asc)  #  <Asc Capricorn +05:23:06>