def GetTithiTimeRange(self, earth, fromTime, toTime): start = GCGregorianDate(date=self.date) start.shour = self.astrodata.sun.sunrise_deg / 360 + earth.tzone / 24.0 GCTithi.GetNextTithiStart(earth, start, toTime) GCTithi.GetPrevTithiStart(earth, start, fromTime) return True
def Gaurabda2Gregorian(va, vc, earth): vc.Set( GCTithi.CalcTithiDate(va.gyear, va.masa, va.paksa, va.tithi % 15, earth))
def writeGaurabdaNextTithiXml(xml, loc, vcStart, vaStart): gmasa = vaStart.masa gpaksa = 1 if vaStart.tithi >= 15 else 0 gtithi = vaStart.tithi % 15 xml.write("<xml>\n") xml.write("\t<request name=\"Tithi\" version=\"") xml.write(GCStrings.getString(130)) xml.write("\">\n") xml.write("\t\t<arg name=\"longitude\" val=\"") xml.write(str(loc.m_fLongitude)) xml.write("\" />\n") xml.write("\t\t<arg name=\"latitude\" val=\"") xml.write(str(loc.m_fLatitude)) xml.write("\" />\n") xml.write("\t\t<arg name=\"timezone\" val=\"") xml.write(str(loc.m_fTimezone)) xml.write("\" />\n") xml.write("\t\t<arg name=\"start date\" val=\"") xml.write(str(vcStart)) xml.write("\" />\n") xml.write("\t\t<arg name=\"masa\" val=\"") xml.write(str(gmasa)) xml.write("\" />\n") xml.write("\t\t<arg name=\"paksa\" val=\"") xml.write(str(gpaksa)) xml.write("\" />\n") xml.write("\t\t<arg name=\"tithi\" val=\"") xml.write(str(gtithi)) xml.write("\" />\n") xml.write("\t</request>\n") xml.write("\t<result name=\"Tithi\">\n") earth = loc.GetEarthData() vcs = GCGregorianDate() vce = GCGregorianDate() sun = SUNDATA() A = 0 day = GCDayData() today = GCGregorianDate(date=vcStart) today.PreviousDay() vcStart.SubtractDays(15) for A in range(0, 4): vcs.Set( GCTithi.CalcTithiEndEx(vcStart, 0, gmasa, gpaksa, gtithi, earth, vce)) if not vcs.IsBeforeThis(today): oTithi = gpaksa * 15 + gtithi oMasa = gmasa oPaksa = gpaksa oYear = 0 xml.write("\t<celebration\n") xml.write("\t\trtithi=\"") xml.write(GCStrings.GetTithiName(oTithi)) xml.write("\"\n") xml.write("\t\trmasa=\"") xml.write(GCStrings.GetMasaName(oMasa)) xml.write("\"\n") xml.write("\t\trpaksa=\"") xml.write("Gaura" if oPaksa else "Krsna") xml.write("\"\n") # test ci je ksaya today.Set(vcs) today.shour = 0.5 sun.SunCalc(today, earth) sunrise = (sun.sunrise_deg + loc.m_fTimezone * 15.0) / 360 if sunrise < vcs.shour: today.Set(vce) sun.SunCalc(today, earth) sunrise = (sun.sunrise_deg + loc.m_fTimezone * 15.0) / 360 if sunrise < vce.shour: # normal type vcs.NextDay() xml.write("\t\ttype=\"normal\"\n") else: # ksaya vcs.NextDay() day.DayCalc(vcs, earth) oTithi = day.nTithi oPaksa = day.nPaksa oMasa = day.MasaCalc(vcs, earth) oYear = day.nGaurabdaYear xml.write("\t\ttype=\"ksaya\"\n") else: # normal, alebo prvy den vriddhi today.Set(vce) sun.SunCalc(today, earth) if (sun.sunrise_deg + loc.m_fTimezone * 15.0) / 360 < vce.shour: # first day of vriddhi type xml.write("\t\ttype=\"vriddhi\"\n") else: # normal xml.write("\t\ttype=\"normal\"\n") xml.write("\t\tdate=\"") xml.write(str(vcs)) xml.write("\"\n") xml.write("\t\totithi=\"") xml.write(GCStrings.GetTithiName(oTithi)) xml.write("\"\n") xml.write("\t\tomasa=\"") xml.write(GCStrings.GetMasaName(oMasa)) xml.write("\"\n") xml.write("\t\topaksa=\"") xml.write("Gaura" if oPaksa else "Krsna") xml.write("\"\n") xml.write("\t/>\n") break else: vcStart.Set(vcs) vcs.NextDay() xml.write("\t</result>\n") xml.write("</xml>\n") return 1
def writeGaurabdaTithiXml(xml, loc, vaStart, vaEnd): gyearA = vaStart.gyear gyearB = vaEnd.gyear gmasa = vaStart.masa gpaksa = 1 if vaStart.tithi >= 15 else 0 gtithi = vaStart.tithi % 15 if gyearB < gyearA: gyearB = gyearA xml.write("<xml>\n") xml.write("\t<request name=\"Tithi\" version=\"") xml.write(GCStrings.getString(130)) xml.write("\">\n") xml.write("\t\t<arg name=\"longitude\" val=\"") xml.write(str(loc.m_fLongitude)) xml.write("\" />\n") xml.write("\t\t<arg name=\"latitude\" val=\"") xml.write(str(loc.m_fLatitude)) xml.write("\" />\n") xml.write("\t\t<arg name=\"timezone\" val=\"") xml.write(str(loc.m_fTimezone)) xml.write("\" />\n") if gyearA > 1500: xml.write("\t\t<arg name=\"year-start\" val=\"") xml.write(str(gyearA)) xml.write("\" />\n") xml.write("\t\t<arg name=\"year-end\" val=\"") xml.write(str(gyearB)) xml.write("\" />\n") else: xml.write("\t\t<arg name=\"gaurabdayear-start\" val=\"") xml.write(str(gyearA)) xml.write("\" />\n") xml.write("\t\t<arg name=\"gaurabdayear-end\" val=\"") xml.write(str(gyearB)) xml.write("\" />\n") xml.write("\t\t<arg name=\"masa\" val=\"") xml.write(str(gmasa)) xml.write("\" />\n") xml.write("\t\t<arg name=\"paksa\" val=\"") xml.write(str(gpaksa)) xml.write("\" />\n") xml.write("\t\t<arg name=\"tithi\" val=\"") xml.write(str(gtithi)) xml.write("\" />\n") xml.write("\t</request>\n") xml.write("\t<result name=\"Tithi\">\n") earth = loc.GetEarthData() vcs = GCGregorianDate() vce = GCGregorianDate() today = GCGregorianDate() sun = SUNDATA() day = GCDayData() A = B = 0 if gyearA > 1500: A = gyearA - 1487 B = gyearB - 1485 else: A = gyearA B = gyearB for A in range(A, B + 1): vcs.Set(GCTithi.CalcTithiEnd(A, gmasa, gpaksa, gtithi, earth, vce)) if gyearA > 1500: if (vcs.year < gyearA) or (vcs.year > gyearB): continue oTithi = gpaksa * 15 + gtithi oMasa = gmasa oPaksa = gpaksa oYear = 0 xml.write("\t<celebration\n") xml.write("\t\trtithi=\"") xml.write(GCStrings.GetTithiName(oTithi)) xml.write("\"\n") xml.write("\t\trmasa=\"") xml.write(GCStrings.GetMasaName(oMasa)) xml.write("\"\n") xml.write("\t\trpaksa=\"") xml.write('Gaura' if oPaksa else "Krsna") xml.write("\"\n") # test ci je ksaya today.Set(vcs) today.shour = 0.5 sun.SunCalc(today, earth) sunrise = (sun.sunrise_deg + loc.m_fTimezone * 15.0) / 360 if sunrise < vcs.shour: today.Set(vce) sun.SunCalc(today, earth) sunrise = (sun.sunrise_deg + loc.m_fTimezone * 15.0) / 360 if sunrise < vce.shour: # normal type vcs.NextDay() xml.write("\t\ttype=\"normal\"\n") else: # ksaya vcs.NextDay() day.DayCalc(vcs, earth) oTithi = day.nTithi oPaksa = day.nPaksa oMasa = day.MasaCalc(vcs, earth) oYear = day.nGaurabdaYear xml.write("\t\ttype=\"ksaya\"\n") else: # normal, alebo prvy den vriddhi today.Set(vce) sun.SunCalc(today, earth) if (sun.sunrise_deg + loc.m_fTimezone * 15.0) / 360 < vce.shour: # first day of vriddhi type xml.write("\t\ttype=\"vriddhi\"\n") else: # normal xml.write("\t\ttype=\"normal\"\n") xml.write("\t\tdate=\"") xml.write(str(vcs)) xml.write("\"\n") xml.write("\t\totithi=\"") xml.write(GCStrings.GetTithiName(oTithi)) xml.write("\"\n") xml.write("\t\tomasa=\"") xml.write(GCStrings.GetMasaName(oMasa)) xml.write("\"\n") xml.write("\t\topaksa=\"") xml.write('Gaura' if oPaksa else 'Krsna') xml.write("\"\n") xml.write("\t/>\n") xml.write("\t</result>\n") xml.write("</xml>\n") return 1
def writeXml(xml, loc, vc): date = GCGregorianDate() xml.write("<xml>\n") xml.write("\t<request name=\"Tithi\" version=\"") xml.write(GCStrings.getString(130)) xml.write("\">\n") xml.write("\t\t<arg name=\"longitude\" val=\"") xml.write(str(loc.m_fLongitude)) xml.write("\" />\n") xml.write("\t\t<arg name=\"latitude\" val=\"") xml.write(str(loc.m_fLatitude)) xml.write("\" />\n") xml.write("\t\t<arg name=\"timezone\" val=\"") xml.write(str(loc.m_fTimezone)) xml.write("\" />\n") xml.write("\t\t<arg name=\"startdate\" val=\"") xml.write(str(vc)) xml.write("\" />\n") xml.write("\t</request>\n") xml.write("\t<result name=\"Tithi\">\n") d1 = GCGregorianDate() d2 = GCGregorianDate() dn = GCGregorianDate() dt = GCTime() earth = loc.GetEarthData() day = GCDayData() day.DayCalc(vc, earth) d = GCGregorianDate(date=vc) d.tzone = loc.m_fTimezone d.shour = day.sun.sunrise_deg / 360.0 + loc.m_fTimezone / 24.0 GCTithi.GetPrevTithiStart(earth, d, d1) GCTithi.GetNextTithiStart(earth, d, d2) dt.SetDegTime(d1.shour * 360) # start tithi at t[0] xml.write("\t\t<tithi\n\t\t\tid=\"") xml.write(str(day.nTithi)) xml.write("\"\n") xml.write("\t\t\tname=\"") xml.write(GCStrings.GetTithiName(day.nTithi)) xml.write("\"\n") xml.write("\t\t\tstartdate=\"") xml.write(str(d1)) xml.write("\"\n") xml.write("\t\t\tstarttime=\"") xml.write(repr(dt)) xml.write("\"\n") dt.SetDegTime(d2.shour * 360) xml.write("\t\t\tenddate=\"") xml.write(str(d2)) xml.write("\"\n") xml.write("\t\t\tendtime=\"") xml.write(repr(dt)) xml.write("\"\n />") xml.write("\t</result>\n") xml.write("</xml>\n") return 1
def CalcTithiEndEx(vcStart, GYear, nMasa, nPaksa, nTithi, earth, endTithi): d = GCGregorianDate() dtemp = GCGregorianDate() day = GCDayData() tithi = 0 counter = 0 sunrise = 0.0 start = GCGregorianDate() end = GCGregorianDate() start.shour = -1.0 end.shour = -1.0 start.day = start.month = start.year = -1 end.day = end.month = end.year = -1 d.Set(vcStart) i = 0 while True: d.AddDays(13) day.DayCalc(d, earth) day.nMasa = day.MasaCalc(d, earth) gy = day.nGaurabdaYear i += 1 if ((day.nPaksa == nPaksa) and (day.nMasa == nMasa)) or i > 30: break if i > 30: d.year = d.month = d.day = -1 return d # we found masa and paksa # now we have to find tithi tithi = nTithi + nPaksa * 15 if day.nTithi == tithi: # loc1 # find tithi juncts in this day and according to that times, # look in previous or next day for end and start of this tithi nType = 1 else: if day.nTithi < tithi: # do increment of date until nTithi == tithi # but if nTithi > tithi # then do decrement of date counter = 0 while counter < 30: d.NextDay() day.DayCalc(d, earth) if day.nTithi == tithi: break if (day.nTithi < tithi) and (day.nPaksa != nPaksa): d.PreviousDay() break if day.nTithi > tithi: d.PreviousDay() break counter += 1 # somewhere is error if counter >= 30: d.year = d.month = d.day = 0 nType = 0 else: # do decrement of date until nTithi <= tithi counter = 0 while counter < 30: d.PreviousDay() day.DayCalc(d, earth) if day.nTithi == tithi: break if (day.nTithi > tithi) and (day.nPaksa != nPaksa): break if day.nTithi < tithi: break counter += 1 # somewhere is error if counter >= 30: d.year = d.month = d.day = 0 nType = 0 if day.nTithi == tithi: # do the same as in loc1 nType = 1 else: # nTithi != tithi and nTithi < tithi # but on next day is nTithi > tithi # that means we will find start and the end of tithi # in this very day or on next day before sunrise nType = 2 # now we know the type of day-accurancy # nType = 0 means, that we dont found a day # nType = 1 means, we find day, when tithi was present at sunrise # nType = 2 means, we found day, when tithi started after sunrise # but ended before next sunrise # sunrise = day.sun.sunrise_deg / 360 + earth.tzone / 24 if nType == 1: d1 = GCGregorianDate() d2 = GCGregorianDate() d.shour = sunrise GCTithi.GetPrevTithiStart(earth, d, d1) #d = d1 #d.shour += 0.02 GCTithi.GetNextTithiStart(earth, d, d2) endTithi.Set(d2) return d1 elif nType == 2: d1 = GCGregorianDate() d2 = GCGregorianDate() d.shour = sunrise GCTithi.GetNextTithiStart(earth, d, d1) d.Set(d1) d.shour += 0.1 d.NormalizeValues() GCTithi.GetNextTithiStart(earth, d, d2) endTithi.Set(d2) return d1 # if nType == 0, then this algoritmus has some failure if nType == 0: d.year = 0 d.month = 0 d.day = 0 d.shour = 0.0 endTithi.Set(d) else: d.Set(start) endTithi.Set(end) return d
GCTime.unittests() GCUT.info('enums') GCUT.val(FastType.FAST_NULL, 0, 'FastType') GCUT.val(MahadvadasiType.EV_VIJAYA, 0x110, 'MahadvadasiType') GCAyanamsha.unittests() GCPancangaDate.unittests() GCDisplaySettings.unittests() GCStrings.unittests() GCCountry.unittests() GCGregorianDate.unittests() GCTimeZone.unittests() GCEarthData.unittests() GCStringBuilder.unittests() GCMoonData.unittests() GCSunData.unittests() GCConjunction.unittests() GCNaksatra.unittests() GCSankranti.unittests() GCTithi.unittests() GCDayData.unittests() GCYoga.unittests() GCLocationList.unittests() GCEventList.unittests() GCCalendar.unittests() # retype to if True: ... in case you need unittests for specific engine if True: TMasaList.unittests() if True: TCalendar.unittests() if True: TAppDay.unittests() if True: TCoreEvents.unittests() TToday.unittests()
def CalculateEvents(self, loc, vcStart, vcEnd): sun = SUNDATA() ndst = 0 self.m_location.Set(loc) self.m_vcStart.Set(vcStart) self.m_vcEnd.Set(vcEnd) vcNext = GCGregorianDate() earth = loc.GetEarthData() vc = GCGregorianDate(date=vcStart) vcAdd = GCGregorianDate(date=vcStart) vcAdd.InitWeekDay() previousLongitude = -100 todayLongitude = 0 fromTimeLimit = 0 while vcAdd.IsBeforeThis(vcEnd): if (GCDisplaySettings.getValue(COREEVENTS_SUN)): ndst = GCTimeZone.determineDaylightChange( vcAdd, loc.m_nTimezoneId) sun.SunCalc(vcAdd, earth) vcAdd.shour = sun.arunodaya.GetDayTime() self.AddEvent(vcAdd, CCTYPE_S_ARUN, 0, ndst) vcAdd.shour = sunRise = sun.rise.GetDayTime() self.AddEvent(vcAdd, CCTYPE_S_RISE, 0, ndst) vcAdd.shour = sun.noon.GetDayTime() self.AddEvent(vcAdd, CCTYPE_S_NOON, 0, ndst) vcAdd.shour = sunSet = sun.set.GetDayTime() self.AddEvent(vcAdd, CCTYPE_S_SET, 0, ndst) else: ndst = GCTimeZone.determineDaylightChange( vcAdd, loc.m_nTimezoneId) sun.SunCalc(vcAdd, earth) sunRise = sun.rise.GetDayTime() sunSet = sun.set.GetDayTime() if (GCDisplaySettings.getValue(COREEVENTS_ASCENDENT)): todayLongitude = sun.longitude_deg vcAdd.shour = sunRise todaySunriseHour = sunRise if (previousLongitude < -10): prevSunrise = GCGregorianDate(date=vcAdd) prevSunrise.PreviousDay() sun.SunCalc(prevSunrise, earth) previousSunriseHour = sun.rise.GetDayTime() - 1 previousLongitude = sun.longitude_deg fromTimeLimit = 0 jd = vcAdd.GetJulianComplete() ayan = GCAyanamsha.GetAyanamsa(jd) r1 = GCMath.putIn360(previousLongitude - ayan) / 30 r2 = GCMath.putIn360(todayLongitude - ayan) / 30 while (r2 > r1 + 13): r2 -= 12.0 while (r2 < r1 + 11): r2 += 12.0 a = (r2 - r1) / (todaySunriseHour - previousSunriseHour) b = r2 - a * todaySunriseHour tr = ceil(r1) for tr in range(ceil(r1), ceil(r2)): tm = (tr - b) / a if (tm > fromTimeLimit): vcNext.Set(vcAdd) vcNext.shour = tm vcNext.NormalizeValues() self.AddEvent(vcNext, CCTYPE_ASCENDENT, tr, ndst) previousLongitude = todayLongitude previousSunriseHour = todaySunriseHour - 1 fromTimeLimit = previousSunriseHour if (GCDisplaySettings.getValue(COREEVENTS_RAHUKALAM)): r1, r2 = CalculateKala(sunRise, sunSet, vcAdd.dayOfWeek, KT_RAHU_KALAM) vcAdd.shour = r1 self.AddEvent(vcAdd, CCTYPE_KALA_START, KT_RAHU_KALAM, ndst) vcAdd.shour = r2 self.AddEvent(vcAdd, CCTYPE_KALA_END, KT_RAHU_KALAM, ndst) if (GCDisplaySettings.getValue(COREEVENTS_YAMAGHANTI)): r1, r2 = CalculateKala(sunRise, sunSet, vcAdd.dayOfWeek, KT_YAMA_GHANTI) vcAdd.shour = r1 self.AddEvent(vcAdd, CCTYPE_KALA_START, KT_YAMA_GHANTI, ndst) vcAdd.shour = r2 self.AddEvent(vcAdd, CCTYPE_KALA_END, KT_YAMA_GHANTI, ndst) if (GCDisplaySettings.getValue(COREEVENTS_GULIKALAM)): r1, r2 = CalculateKala(sunRise, sunSet, vcAdd.dayOfWeek, KT_GULI_KALAM) vcAdd.shour = r1 self.AddEvent(vcAdd, CCTYPE_KALA_START, KT_GULI_KALAM, ndst) vcAdd.shour = r2 self.AddEvent(vcAdd, CCTYPE_KALA_END, KT_GULI_KALAM, ndst) if (GCDisplaySettings.getValue(COREEVENTS_ABHIJIT_MUHURTA)): r1, r2 = CalculateKala(sunRise, sunSet, vcAdd.dayOfWeek, KT_ABHIJIT) if (r1 > 0 and r2 > 0): vcAdd.shour = r1 self.AddEvent(vcAdd, CCTYPE_KALA_START, KT_ABHIJIT, ndst) vcAdd.shour = r2 self.AddEvent(vcAdd, CCTYPE_KALA_END, KT_ABHIJIT, ndst) vcAdd.NextDay() if (GCDisplaySettings.getValue(COREEVENTS_TITHI)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): nData = GCTithi.GetNextTithiStart(earth, vcAdd, vcNext) if (vcNext.GetDayInteger() < vcEnd.GetDayInteger()): vcNext.InitWeekDay() ndst = GCTimeZone.determineDaylightChange( vcNext, loc.m_nTimezoneId) self.AddEvent(vcNext, CCTYPE_TITHI, nData, ndst) else: break vcAdd.Set(vcNext) vcAdd.shour += 0.2 if (vcAdd.shour >= 1.0): vcAdd.shour -= 1.0 vcAdd.NextDay() if (GCDisplaySettings.getValue(COREEVENTS_NAKSATRA)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): nData = GCNaksatra.GetNextNaksatra(earth, vcAdd, vcNext) if (vcNext.GetDayInteger() < vcEnd.GetDayInteger()): vcNext.InitWeekDay() ndst = GCTimeZone.determineDaylightChange( vcNext, loc.m_nTimezoneId) self.AddEvent(vcNext, CCTYPE_NAKS, nData, ndst) else: break vcAdd.Set(vcNext) vcAdd.shour += 0.2 if (vcAdd.shour >= 1.0): vcAdd.shour -= 1.0 vcAdd.NextDay() if (GCDisplaySettings.getValue(COREEVENTS_YOGA)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): nData = GCYoga.GetNextYogaStart(earth, vcAdd, vcNext) if (vcNext.GetDayInteger() < vcEnd.GetDayInteger()): vcNext.InitWeekDay() ndst = GCTimeZone.determineDaylightChange( vcNext, loc.m_nTimezoneId) self.AddEvent(vcNext, CCTYPE_YOGA, nData, ndst) else: break vcAdd.Set(vcNext) vcAdd.shour += 0.2 if (vcAdd.shour >= 1.0): vcAdd.shour -= 1.0 vcAdd.NextDay() if (GCDisplaySettings.getValue(COREEVENTS_SANKRANTI)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): date, nData = GCSankranti.GetNextSankranti(vcAdd) vcNext.Set(date) if (vcNext.GetDayInteger() < vcEnd.GetDayInteger()): vcNext.InitWeekDay() ndst = GCTimeZone.determineDaylightChange( vcNext, loc.m_nTimezoneId) self.AddEvent(vcNext, CCTYPE_SANK, nData, ndst) else: break vcAdd.Set(vcNext) vcAdd.NextDay() if (GCDisplaySettings.getValue(COREEVENTS_MOONRASI)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): nData = GetNextMoonRasi(earth, vcAdd, vcNext) if (vcNext.GetDayInteger() < vcEnd.GetDayInteger()): vcNext.InitWeekDay() ndst = GCTimeZone.determineDaylightChange( vcNext, loc.m_nTimezoneId) self.AddEvent(vcNext, CCTYPE_M_RASI, nData, ndst) else: break vcAdd.Set(vcNext) vcAdd.shour += 0.5 vcAdd.NormalizeValues() if (GCDisplaySettings.getValue(COREEVENTS_CONJUNCTION)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): dlong = GCConjunction.GetNextConjunctionEx( vcAdd, vcNext, True, earth) if (vcNext.GetDayInteger() < vcEnd.GetDayInteger()): vcNext.InitWeekDay() ndst = GCTimeZone.determineDaylightChange( vcNext, loc.m_nTimezoneId) self.AddEvent( vcNext, CCTYPE_CONJ, GCRasi.GetRasi( dlong, GCAyanamsha.GetAyanamsa( vcNext.GetJulianComplete())), ndst) else: break vcAdd.Set(vcNext) vcAdd.NextDay() if (GCDisplaySettings.getValue(COREEVENTS_MOON)): vcAdd.Set(vc) vcAdd.shour = 0.0 while vcAdd.IsBeforeThis(vcEnd): vcNext.Set(MOONDATA.GetNextRise(earth, vcAdd, True)) self.AddEvent(vcNext, CCTYPE_M_RISE, 0, ndst) vcNext.Set(MOONDATA.GetNextRise(earth, vcNext, False)) self.AddEvent(vcNext, CCTYPE_M_SET, 0, ndst) vcNext.shour += 0.05 vcNext.NormalizeValues() vcAdd.Set(vcNext) if self.b_sorted: self.Sort()