def indexInfo(self, index): """ Returns information about a specific planetary time. """ entry = self.table[index] info = { # Default is diurnal 'mode': 'Day', 'ruler': self.dayRuler(), 'dayRuler': self.dayRuler(), 'nightRuler': self.nightRuler(), 'hourRuler': entry[2], 'hourNumber': index + 1, 'tableIndex': index, 'start': Datetime.fromJD(entry[0], self.date.utcoffset), 'end': Datetime.fromJD(entry[1], self.date.utcoffset) } if index >= 12: # Set information as nocturnal info.update({ 'mode': 'Night', 'ruler': info['nightRuler'], 'hourNumber': index + 1 - 12 }) return info
def nextLunarEclipse(date): """ Returns the Datetime of the maximum phase of the next global lunar eclipse. """ eclipse = swe.lunarEclipseGlobal(date.jd, backward=False) return Datetime.fromJD(eclipse['maximum'], date.utcoffset)
def prevLunarEclipse(date): """ Returns the Datetime of the maximum phase of the previous global lunar eclipse. """ eclipse = swe.lunarEclipseGlobal(date.jd, backward=True) return Datetime.fromJD(eclipse['maximum'], date.utcoffset)
def nextSunrise(date, pos): """ Returns the date of the next sunrise. """ jd = eph.nextSunrise(date.jd, pos.lat, pos.lon) return Datetime.fromJD(jd, date.utcoffset)
def prevSolarReturn(date, lon): """ Returns the previous date when sun is at longitude 'lon'. """ jd = eph.prevSolarReturn(date.jd, lon) return Datetime.fromJD(jd, date.utcoffset)
def nextSolarReturn(date, lon): """ Returns the next date when sun is at longitude 'lon'. """ jd = eph.nextSolarReturn(date.jd, lon) return Datetime.fromJD(jd, date.utcoffset)
def nextStation(ID, date): """ Returns the aproximate date of the next station. """ jd = eph.nextStation(ID, date.jd) return Datetime.fromJD(jd, date.utcoffset)
def lastSunset(date, pos): """ Returns the date of the last sunset. """ jd = eph.lastSunset(date.jd, pos.lat, pos.lon) return Datetime.fromJD(jd, date.utcoffset)