Exemplo n.º 1
0
 def get_cycles(self,nowdt=None): 
     date,_ = parsestrtime(self.date)
     _,_,year = date.split("/")
     if not nowdt:
         nowdt = datetime.now()
     nowyear = nowdt.year
     cycles,_ = divmod(nowyear-int(year),72)
     return cycles
Exemplo n.º 2
0
def solar_rev(boss):
    date, time = parsestrtime(boss.state.curr_chart.date)
    d,m,y = [int(i) for i in date.split("/")]
    nowyear = boss.state.date.dt.year
    julday = pysw.julday(nowyear,m,d,0.0)
    sun = boss.state.curr_chart.planets[0]
    s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    
    while sunnow > sun:
        julday -= 0.1
        s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)

    while sunnow < sun:
        julday += 0.01
        s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    julday -= 0.01
    s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    
    while sunnow < sun:
        julday += 0.001
        s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    julday -= 0.001
    s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    
    while sunnow < sun:
        julday += 0.0001
        s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    julday -= 0.0001
    s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)

    while sunnow < sun:
        julday += 0.00001
        s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    julday -= 0.00001
    s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)

    while sunnow < sun:
        julday += 0.000001
        s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    julday -= 0.000001
    s,sunnow,e = pysw.calc(julday,0,boss.state.epheflag)
    
    sol = pysw.revjul(julday)
    zone = boss.state.curr_chart.zone
    dt = boss.state.date.getnewdt(sol)
    boss.da.panel.set_date_only(dt)