コード例 #1
0
ファイル: tools.py プロジェクト: lightflicker/flatlib
def isDiurnal(jd, lat, lon):
    """ Returns true if the sun is above the horizon
    of a given date and location. 
    
    """
    sun = swe.sweObject(const.SUN, jd)
    mc = swe.sweHousesLon(jd, lat, lon, const.HOUSES_DEFAULT)[1][1]
    ra, decl = utils.eqCoords(sun['lon'], sun['lat'])
    mcRA, _ = utils.eqCoords(mc, 0.0)
    return utils.isAboveHorizon(ra, decl, mcRA, lat)
コード例 #2
0
 def G(self, ID, lat, lon):
     """ Creates a generic entry for an object. """
     
     # Equatorial coordinates
     eqM = utils.eqCoords(lon, lat)
     eqZ = eqM
     if lat != 0:
         eqZ = utils.eqCoords(lon, 0)
     
     return {
         'id': ID,
         'lat': lat,
         'lon': lon,
         'ra': eqM[0],
         'decl': eqM[1],
         'raZ': eqZ[0],
         'declZ': eqZ[1],
     }