def __init__(self, pchrts, step12, rownum): self.dates = [] y = pchrts[0][1] + rownum m = pchrts[0][2] d = pchrts[0][3] if (not util.checkDate(y, m, d)): y, m, d = util.incrDay(y, m, d) #calc dat = (y, m, d) self.dates.append(dat) idx = 12 mon = 30.4368492 if not step12: idx = 13 mon = 28.0955531 calflag = astrology.SE_GREG_CAL if pchrts[0][0].time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL jdval = astrology.swe_julday(y, m, d, pchrts[0][0].time.time, calflag) for i in range(idx - 1): jdval += mon jy, jm, jd, jh = astrology.swe_revjul(jdval, calflag) # d, m, s = util.decToDeg(jh) dat = (jy, jm, jd) self.dates.append(dat)
def __init__(self, pchrts, step12, rownum): self.dates = [] y = pchrts[0][1] + rownum m = pchrts[0][2] d = pchrts[0][3] if not util.checkDate(y, m, d): y, m, d = util.incrDay(y, m, d) # calc dat = (y, m, d) self.dates.append(dat) idx = 12 mon = 30.4368492 if not step12: idx = 13 mon = 28.0955531 calflag = astrology.SE_GREG_CAL if pchrts[0][0].time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL jdval = astrology.swe_julday(y, m, d, pchrts[0][0].time.time, calflag) for i in range(idx - 1): jdval += mon jy, jm, jd, jh = astrology.swe_revjul(jdval, calflag) # d, m, s = util.decToDeg(jh) dat = (jy, jm, jd) self.dates.append(dat)
def __init__(self, radix, y, m, d, t, cnt=0): #t is in GMT placelon = radix.place.lon placelat = radix.place.lat #negative on SH? ramc = radix.houses.ascmc2[houses.Houses.MC][houses.Houses.RA] declAsc = radix.houses.ascmc2[houses.Houses.ASC][houses.Houses.DECL] #radian!! oaAsc = util.normalize(ramc + 90.0) val = math.tan(math.radians(declAsc)) * math.tan( math.radians(placelat)) adlatAsc = 0.0 if math.fabs(val) <= 1.0: adlatAsc = math.degrees(math.asin(val)) dsalatAsc = 90.0 + adlatAsc nsalatAsc = 90.0 - adlatAsc dhlatAsc = dsalatAsc / 3.0 #diurnal house nhlatAsc = nsalatAsc / 3.0 #nocturnal house #placelon is negative in case of western long!! lon360 = placelon if placelon < 0.0: lon360 = 360.0 + placelon jdbirth = astrology.swe_julday(y, m, d, t, astrology.SE_GREG_CAL) jd = jdbirth + cnt * 365.2421904 #deltaYear diffYear = (jd - radix.time.jd) / 365.2421904 #Profection cycle in Years cycInYears = diffYear - (int(diffYear / 12.0)) * 12 #Number of diurnal steps (real) DCycInYears = cycInYears if cycInYears > 6.0: DCycInYears = 6.0 #Number of nocturnal steps (real) NCycInYears = 0.0 if cycInYears > 6.0: NCycInYears = cycInYears - DCycInYears # Delta geographical longitude for the fictious movement diffLon = DCycInYears * dhlatAsc + NCycInYears * nhlatAsc #New geographical long. to cast the fictious chart (range 0-360) lon360Z = util.normalize(lon360 + diffLon) #Convert (0-360) --> E/W the longitude self.lonZ = lon360Z self.east = True if lon360Z > 180.0: self.lonZ = 360.0 - lon360Z self.east = False
def __init__(self, radix, y, m, d, t, cnt=0): #t is in GMT placelon = radix.place.lon placelat = radix.place.lat #negative on SH? ramc = radix.houses.ascmc2[houses.Houses.MC][houses.Houses.RA] declAsc = radix.houses.ascmc2[houses.Houses.ASC][houses.Houses.DECL] #radian!! oaAsc = util.normalize(ramc+90.0) val = math.tan(math.radians(declAsc))*math.tan(math.radians(placelat)) adlatAsc = 0.0 if math.fabs(val) <= 1.0: adlatAsc = math.degrees(math.asin(val)) dsalatAsc = 90.0+adlatAsc nsalatAsc = 90.0-adlatAsc dhlatAsc = dsalatAsc/3.0 #diurnal house nhlatAsc = nsalatAsc/3.0 #nocturnal house #placelon is negative in case of western long!! lon360 = placelon if placelon < 0.0: lon360 = 360.0+placelon jdbirth = astrology.swe_julday(y, m, d, t, astrology.SE_GREG_CAL) jd = jdbirth+cnt*365.2421904 #deltaYear diffYear = (jd-radix.time.jd)/365.2421904 #Profection cycle in Years cycInYears = diffYear-(int(diffYear/12.0))*12 #Number of diurnal steps (real) DCycInYears = cycInYears if cycInYears > 6.0: DCycInYears = 6.0 #Number of nocturnal steps (real) NCycInYears = 0.0 if cycInYears > 6.0: NCycInYears = cycInYears-DCycInYears # Delta geographical longitude for the fictious movement diffLon = DCycInYears*dhlatAsc+NCycInYears*nhlatAsc #New geographical long. to cast the fictious chart (range 0-360) lon360Z = util.normalize(lon360+diffLon) #Convert (0-360) --> E/W the longitude self.lonZ = lon360Z self.east = True if lon360Z > 180.0: self.lonZ = 360.0-lon360Z self.east = False
def __init__(self, radix, y, m, d, t, cnt=0): # t is in GMT jdbirth = astrology.swe_julday(y, m, d, t, astrology.SE_GREG_CAL) jd = jdbirth + cnt * 365.2421904 # Find the difference in Julian days between today and the birth day. Say it Djd diffjd = jd - radix.time.jd # Find how many degrees you must rotate the whole natal chart. rotdeg = diffjd / 12.17474 # Find the Profection cycle. profcyc = rotdeg / 360.0 # Determine the number of integer cycles. intcyc = int(profcyc) # Compute the number of degrees included in the integer cycles. degintcyc = intcyc * 360.0 # Compute the number of degrees (< 360), the true profectional movement self.offs = util.normalize(rotdeg - degintcyc)
def __init__(self, radix, y, m, d, t, cnt=0): #t is in GMT jdbirth = astrology.swe_julday(y, m, d, t, astrology.SE_GREG_CAL) jd = jdbirth + cnt * 365.2421904 #Find the difference in Julian days between today and the birth day. Say it Djd diffjd = jd - radix.time.jd #Find how many degrees you must rotate the whole natal chart. rotdeg = diffjd / 12.17474 #Find the Profection cycle. profcyc = rotdeg / 360.0 #Determine the number of integer cycles. intcyc = int(profcyc) #Compute the number of degrees included in the integer cycles. degintcyc = intcyc * 360.0 #Compute the number of degrees (< 360), the true profectional movement self.offs = util.normalize(rotdeg - degintcyc)
def __init__(self, rtime, rplace, pId, arc, lat, ascmc2, topo): direct = True if arc < 0.0: arc *= -1 direct = False if arc > 180.0: arc = 360.0 - arc direct = not direct if not direct and arc > 0.0: arc *= -1 flag = astrology.SEFLG_SWIEPH + astrology.SEFLG_SPEED if topo: flag += astrology.SEFLG_TOPOCTR #calc new time rate = arc / 15.0 ut = rate * SecMotion.ST2UTCONV newtime = rtime.time + ut year, month, day = rtime.year, rtime.month, rtime.day #check overflow if newtime >= chart.Time.HOURSPERDAY: newtime -= chart.Time.HOURSPERDAY year, month, day = util.incrDay(year, month, day) elif newtime < 0.0: newtime += chart.Time.HOURSPERDAY year, month, day = util.decrDay(year, month, day) calflag = astrology.SE_GREG_CAL if rtime.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL tjd_ut = astrology.swe_julday(year, month, day, newtime, calflag) #self.planet contains the new position of the planet(it proceeded on its way during the PD(arc)) self.planet = planets.Planet(tjd_ut, pId, flag, lat, ascmc2)
def __init__(self, ephepath): self.ephepath = ephepath self.jd = astrology.swe_julday(1950, 1, 1, 0.0, astrology.SE_GREG_CAL) self.data = [] self.fname = os.path.join(self.ephepath, 'fixstars.cat')
def compute(self): y = self.chart.time.year m = self.chart.time.month d = self.chart.time.day hour = self.chart.time.hour minute = self.chart.time.minute second = self.chart.time.second hr = 0.0 #GMT to LocalMean t = (self.chart.place.deglon+self.chart.place.minlon/60.0)*4 #long * 4min meantime = 0.0 if self.chart.place.east: meantime = self.chart.time.time+t/60.0 else: meantime = self.chart.time.time-t/60.0 #check over/underflow HOURSPERDAY = 24.0 if meantime >= HOURSPERDAY: meantime -= HOURSPERDAY y, m, d = util.incrDay(y, m, d) elif meantime < 0.0: meantime += HOURSPERDAY y, m, d = util.decrDay(y, m, d) if self.soltime: calflag = astrology.SE_GREG_CAL if self.chart.time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL yt = y if self.chart.time.bc: yt = -y jdmean = astrology.swe_julday(yt, m, d, meantime, calflag) #Get jdapp ret, te, serr = astrology.swe_time_equ(jdmean) jdapp = jdmean-te y, m, d, hr = astrology.swe_revjul(jdapp, calflag) hour,minute,second = util.decToDeg(hr) # print '%d:%02d:%02d' % (hour,minute,second) else: hour,minute,second = util.decToDeg(meantime) for i in range(self.age): if self.direct: y, m, d = util.incrDay(y, m, d) else: y, m, d = util.decrDay(y, m, d) if self.soltime: #Back to meantime on the last day yt = y if self.chart.time.bc: yt = -y calflag = astrology.SE_GREG_CAL if self.chart.time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL jdapp = astrology.swe_julday(yt, m, d, hr, calflag) ret, te, serr = astrology.swe_time_equ(jdapp) jdmean = jdapp+te y, m, d, hr = astrology.swe_revjul(jdmean, calflag) hour,minute,second = util.decToDeg(hr) # print '%d:%02d:%02d' % (hour,minute,second) return y, m, d, hour, minute, second
def onShowBtn(self, event): if (self.Validate() and self.sdate.Validate()): if util.checkDate(int(self.year.GetValue()), int(self.month.GetValue()), int(self.day.GetValue())): arc = 0.0 date = 2000.5 direct = self.positiverb.GetValue() if (self.arcrb.GetValue()): arc = float(self.da.GetValue()) jd, age = self.calcTime(arc, direct) y, m, d, h = astrology.swe_revjul(jd, 1) ho, mi, se = util.decToDeg(h) self.year.SetValue(str(y)) self.month.SetValue(str(m)) self.day.SetValue(str(d)) self.hour.SetValue(str(ho)) self.minute.SetValue(str(mi)) self.second.SetValue(str(se)) else: y = int(self.year.GetValue()) m = int(self.month.GetValue()) d = int(self.day.GetValue()) ho = int(self.hour.GetValue()) mi = int(self.minute.GetValue()) se = int(self.second.GetValue()) t = float(ho)+float(mi)/60.0+float(se)/3600.0 calflag = astrology.SE_GREG_CAL if self.chart.time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL jd = astrology.swe_julday(y, m, d, t, calflag) if self.chart.time.jd >= jd: dlgm = wx.MessageDialog(None, mtexts.txts['TimeSmallerThanBirthTime'], mtexts.txts['Error'], wx.OK|wx.ICON_EXCLAMATION) dlgm.ShowModal() dlgm.Destroy() return False arc = self.calcArc(jd, direct) self.da.SetValue(str(arc)) da = arc if not direct: da *= -1 pdinch = pdsinchart.PDsInChart(self.chart, da) #self.yz, mz, dz, tz ==> chart pdh, pdm, pds = util.decToDeg(pdinch.tz) cal = chart.Time.GREGORIAN if self.chart.time.cal == chart.Time.JULIAN: cal = chart.Time.JULIAN tim = chart.Time(pdinch.yz, pdinch.mz, pdinch.dz, pdh, pdm, pds, self.chart.time.bc, cal, chart.Time.GREENWICH, True, 0, 0, False, self.chart.place, False) if not self.terrestrial: if self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMMUNDANEPOS: pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat) pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) #modify planets ... if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.planets.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) else: pdchart.houses = houses.Houses(tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha) pdchart.planets.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) #modify lof if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.fortune.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) else: pdchart.fortune.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) elif self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMZODIACALPOS: pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True) pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True) #modify planets ... if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.planets.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) else: pdchart.houses = houses.Houses(tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha) pdchart.planets.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) #modify lof if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.fortune.calcMundaneProfPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) else: pdchart.fortune.calcRegioPDsInChartsPos(pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) else:#Full Astronomical Procedure pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat) pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) pdpls = pdchartpls.planets.planets if self.options.pdinchartsecmotion: pdpls = pdchart.planets.planets raequasc, declequasc, dist = astrology.swe_cotrans(pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0]) pdchart.planets.calcFullAstronomicalProc(da, self.chart.obl[0], pdpls, pdchart.place.lat, pdchart.houses.ascmc2, raequasc) #planets pdchart.fortune.calcFullAstronomicalProc(pdchartpls.fortune, da, self.chart.obl[0]) else: if self.options.pdinchartterrsecmotion: pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat) else: pdchart = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False)#, proftype, nolat) raequasc, declequasc, dist = astrology.swe_cotrans(pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0]) pdchart.planets.calcMundaneWithoutSM(da, self.chart.obl[0], pdchart.place.lat, pdchart.houses.ascmc2, raequasc) pdchart.fortune.recalcForMundaneChart(self.chart.fortune.fortune[fortune.Fortune.LON], self.chart.fortune.fortune[fortune.Fortune.LAT], self.chart.fortune.fortune[fortune.Fortune.RA], self.chart.fortune.fortune[fortune.Fortune.DECL], pdchart.houses.ascmc2, pdchart.raequasc, pdchart.obl[0], pdchart.place.lat) keytxt = mtexts.typeListDyn[self.options.pdkeyd] if not self.options.pdkeydyn: keytxt = mtexts.typeListStat[self.options.pdkeys] txtdir = mtexts.txts['D'] if not direct: txtdir = mtexts.txts['C'] self.parent.change(pdchart, y, m, d, ho, mi, se, mtexts.typeListDirs[self.options.primarydir], keytxt, txtdir, math.fabs(da)) else: dlgm = wx.MessageDialog(None, mtexts.txts['InvalidDate']+' ('+self.year.GetValue()+'.'+self.month.GetValue()+'.'+self.day.GetValue()+'.)', mtexts.txts['Error'], wx.OK|wx.ICON_EXCLAMATION) dlgm.ShowModal() dlgm.Destroy()
def __init__(self, year, month, day, hour, minute, second, bc, cal, zt, plus, zh, zm, daylightsaving, place, full = True): #zt is zonetime, zh is zonehour, zm is zoneminute, full means to calculate everything e.g. FixedStars, MidPoints, ... self.year = year self.month = month self.day = day self.origyear = year self.origmonth = month self.origday = day self.hour = hour self.minute = minute self.second = second self.bc = bc self.cal = cal self.zt = zt self.plus = plus self.zh = zh self.zm = zm self.daylightsaving = daylightsaving self.time = hour+minute/60.0+second/3600.0 self.dyear, self.dmonth, self.dday, self.dhour, self.dmin, self.dsec = year, month, day, hour, minute, second if self.daylightsaving: self.time -= 1.0 self.dhour -= 1 #check daylightsaving underflow if self.time < 0.0: self.time += Time.HOURSPERDAY self.year, self.month, self.day = util.decrDay(self.year, self.month, self.day) self.dhour += int(Time.HOURSPERDAY) self.dyear, self.dmonth, self.dday = self.year, self.month, self.day if zt == Time.ZONE:#ZONE ztime = zh+zm/60.0 if self.plus: self.time-=ztime else: self.time+=ztime elif zt == Time.LOCALMEAN:#LMT t = (place.deglon+place.minlon/60.0)*4.0 #long * 4min if place.east: self.time-=t/60.0 else: self.time+=t/60.0 if bc: self.year = 1-self.year #check over/underflow if self.time >= Time.HOURSPERDAY: self.time -= Time.HOURSPERDAY self.year, self.month, self.day = util.incrDay(self.year, self.month, self.day) elif self.time < 0.0: self.time += Time.HOURSPERDAY self.year, self.month, self.day = util.decrDay(self.year, self.month, self.day) calflag = astrology.SE_GREG_CAL if self.cal == Time.JULIAN: calflag = astrology.SE_JUL_CAL self.jd = astrology.swe_julday(self.year, self.month, self.day, self.time, calflag) if zt == Time.LOCALAPPARENT:#LAT ret, te, serr = astrology.swe_time_equ(self.jd) self.jd += te #LMT #Back to h,m,s(self.time) from julianday fromat self.year, self.month, self.day, self.time = astrology.swe_revjul(self.jd, calflag) #To GMT t = (place.deglon+place.minlon/60.0)*4.0 #long * 4min if place.east: self.time-=t/60.0 else: self.time+=t/60.0 #check over/underflow if self.time >= Time.HOURSPERDAY: self.time -= Time.HOURSPERDAY self.year, self.month, self.day = util.incrDay(self.year, self.month, self.day) elif self.time < 0.0: self.time += Time.HOURSPERDAY self.year, self.month, self.day = util.decrDay(self.year, self.month, self.day) #GMT in JD (julianday) self.jd = astrology.swe_julday(self.year, self.month, self.day, self.time, calflag) self.sidTime = astrology.swe_sidtime(self.jd) #GMT self.ph = None if full: self.calcPHs(place) self.profy = None self.profm = None self.profd = None self.profho = None self.profmi = None self.profse = None
def onShowBtn(self, event): if (self.Validate() and self.sdate.Validate()): if util.checkDate(int(self.year.GetValue()), int(self.month.GetValue()), int(self.day.GetValue())): arc = 0.0 date = 2000.5 direct = self.positiverb.GetValue() if (self.arcrb.GetValue()): arc = float(self.da.GetValue()) jd, age = self.calcTime(arc, direct) y, m, d, h = astrology.swe_revjul(jd, 1) ho, mi, se = util.decToDeg(h) self.year.SetValue(str(y)) self.month.SetValue(str(m)) self.day.SetValue(str(d)) self.hour.SetValue(str(ho)) self.minute.SetValue(str(mi)) self.second.SetValue(str(se)) else: y = int(self.year.GetValue()) m = int(self.month.GetValue()) d = int(self.day.GetValue()) ho = int(self.hour.GetValue()) mi = int(self.minute.GetValue()) se = int(self.second.GetValue()) t = float(ho) + float(mi) / 60.0 + float(se) / 3600.0 calflag = astrology.SE_GREG_CAL if self.chart.time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL jd = astrology.swe_julday(y, m, d, t, calflag) if self.chart.time.jd >= jd: dlgm = wx.MessageDialog( None, mtexts.txts['TimeSmallerThanBirthTime'], mtexts.txts['Error'], wx.OK | wx.ICON_EXCLAMATION) dlgm.ShowModal() dlgm.Destroy() return False arc = self.calcArc(jd, direct) self.da.SetValue(str(arc)) da = arc if not direct: da *= -1 pdinch = pdsinchart.PDsInChart( self.chart, da) #self.yz, mz, dz, tz ==> chart pdh, pdm, pds = util.decToDeg(pdinch.tz) cal = chart.Time.GREGORIAN if self.chart.time.cal == chart.Time.JULIAN: cal = chart.Time.JULIAN tim = chart.Time(pdinch.yz, pdinch.mz, pdinch.dz, pdh, pdm, pds, self.chart.time.bc, cal, chart.Time.GREENWICH, True, 0, 0, False, self.chart.place, False) if not self.terrestrial: if self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMMUNDANEPOS: pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) #, proftype, nolat) pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) #modify planets ... if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.planets.calcMundaneProfPos( pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) else: pdchart.houses = houses.Houses( tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha) pdchart.planets.calcRegioPDsInChartsPos( pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) #modify lof if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.fortune.calcMundaneProfPos( pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) else: pdchart.fortune.calcRegioPDsInChartsPos( pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) elif self.options.pdincharttyp == pdsinchartdlgopts.PDsInChartsDlgOpts.FROMZODIACALPOS: pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True) pdchartpls = chart.Chart( self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False, chart.Chart.YEAR, True) #modify planets ... if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.planets.calcMundaneProfPos( pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) else: pdchart.houses = houses.Houses( tim.jd, 0, pdchart.place.lat, pdchart.place.lon, 'R', pdchart.obl[0], self.options.ayanamsha, pdchart.ayanamsha) pdchart.planets.calcRegioPDsInChartsPos( pdchart.houses.ascmc2, pdchartpls.planets.planets, self.chart.place.lat, self.chart.obl[0]) #modify lof if self.options.primarydir == primdirs.PrimDirs.PLACIDIANSEMIARC or self.options.primarydir == primdirs.PrimDirs.PLACIDIANUNDERTHEPOLE: pdchart.fortune.calcMundaneProfPos( pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) else: pdchart.fortune.calcRegioPDsInChartsPos( pdchart.houses.ascmc2, pdchartpls.fortune, self.chart.place.lat, self.chart.obl[0]) else: #Full Astronomical Procedure pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) #, proftype, nolat) pdchartpls = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) pdpls = pdchartpls.planets.planets if self.options.pdinchartsecmotion: pdpls = pdchart.planets.planets raequasc, declequasc, dist = astrology.swe_cotrans( pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0]) pdchart.planets.calcFullAstronomicalProc( da, self.chart.obl[0], pdpls, pdchart.place.lat, pdchart.houses.ascmc2, raequasc) #planets pdchart.fortune.calcFullAstronomicalProc( pdchartpls.fortune, da, self.chart.obl[0]) else: if self.options.pdinchartterrsecmotion: pdchart = chart.Chart(self.chart.name, self.chart.male, tim, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) #, proftype, nolat) else: pdchart = chart.Chart(self.chart.name, self.chart.male, self.chart.time, self.chart.place, chart.Chart.PDINCHART, '', self.options, False) #, proftype, nolat) raequasc, declequasc, dist = astrology.swe_cotrans( pdchart.houses.ascmc[houses.Houses.EQUASC], 0.0, 1.0, -self.chart.obl[0]) pdchart.planets.calcMundaneWithoutSM( da, self.chart.obl[0], pdchart.place.lat, pdchart.houses.ascmc2, raequasc) pdchart.fortune.recalcForMundaneChart( self.chart.fortune.fortune[fortune.Fortune.LON], self.chart.fortune.fortune[fortune.Fortune.LAT], self.chart.fortune.fortune[fortune.Fortune.RA], self.chart.fortune.fortune[fortune.Fortune.DECL], pdchart.houses.ascmc2, pdchart.raequasc, pdchart.obl[0], pdchart.place.lat) keytxt = mtexts.typeListDyn[self.options.pdkeyd] if not self.options.pdkeydyn: keytxt = mtexts.typeListStat[self.options.pdkeys] txtdir = mtexts.txts['D'] if not direct: txtdir = mtexts.txts['C'] self.parent.change( pdchart, y, m, d, ho, mi, se, mtexts.typeListDirs[self.options.primarydir], keytxt, txtdir, math.fabs(da)) else: dlgm = wx.MessageDialog( None, mtexts.txts['InvalidDate'] + ' (' + self.year.GetValue() + '.' + self.month.GetValue() + '.' + self.day.GetValue() + '.)', mtexts.txts['Error'], wx.OK | wx.ICON_EXCLAMATION) dlgm.ShowModal() dlgm.Destroy()
def compute(self): y = self.chart.time.year m = self.chart.time.month d = self.chart.time.day hour = self.chart.time.hour minute = self.chart.time.minute second = self.chart.time.second hr = 0.0 #GMT to LocalMean t = (self.chart.place.deglon + self.chart.place.minlon / 60.0) * 4 #long * 4min meantime = 0.0 if self.chart.place.east: meantime = self.chart.time.time + t / 60.0 else: meantime = self.chart.time.time - t / 60.0 #check over/underflow HOURSPERDAY = 24.0 if meantime >= HOURSPERDAY: meantime -= HOURSPERDAY y, m, d = util.incrDay(y, m, d) elif meantime < 0.0: meantime += HOURSPERDAY y, m, d = util.decrDay(y, m, d) if self.soltime: calflag = astrology.SE_GREG_CAL if self.chart.time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL yt = y if self.chart.time.bc: yt = -y jdmean = astrology.swe_julday(yt, m, d, meantime, calflag) #Get jdapp ret, te, serr = astrology.swe_time_equ(jdmean) jdapp = jdmean - te y, m, d, hr = astrology.swe_revjul(jdapp, calflag) hour, minute, second = util.decToDeg(hr) # print '%d:%02d:%02d' % (hour,minute,second) else: hour, minute, second = util.decToDeg(meantime) for i in range(self.age): if self.direct: y, m, d = util.incrDay(y, m, d) else: y, m, d = util.decrDay(y, m, d) if self.soltime: #Back to meantime on the last day yt = y if self.chart.time.bc: yt = -y calflag = astrology.SE_GREG_CAL if self.chart.time.cal == chart.Time.JULIAN: calflag = astrology.SE_JUL_CAL jdapp = astrology.swe_julday(yt, m, d, hr, calflag) ret, te, serr = astrology.swe_time_equ(jdapp) jdmean = jdapp + te y, m, d, hr = astrology.swe_revjul(jdmean, calflag) hour, minute, second = util.decToDeg(hr) # print '%d:%02d:%02d' % (hour,minute,second) return y, m, d, hour, minute, second