Пример #1
0
 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
Пример #2
0
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)
Пример #3
0
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)
Пример #4
0
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)
Пример #5
0
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)
Пример #6
0
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)
Пример #7
0
def nextStation(ID, date):
    """ Returns the aproximate date of the next station. """
    jd = eph.nextStation(ID, date.jd)
    return Datetime.fromJD(jd, date.utcoffset)
Пример #8
0
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)