How to use the sun.Sun function in sun

To help you get started, we’ve selected a few sun examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github figure002 / nextwall / src / std.py View on Github external
def get_twilight(day, longitude, latitude):
    sun = Sun()
    ss = sun.civilTwilight(day.year, day.month, day.day, longitude, latitude)
    a,b = utc_childs_to_local(ss)
    a = [int(x) for x in a.split(':')]
    b = [int(x) for x in b.split(':')]
    return datetime.time(a[0],a[1]), datetime.time(b[0],b[1])
github figure002 / nextwall / src / std.py View on Github external
def get_sunset(day, longitude, latitude):
    sun = Sun()
    ss = sun.sunRiseSet(day.year, day.month, day.day, longitude, latitude)
    ss = utc_childs_to_local(ss)
    t = [int(x) for x in ss[1].split(':')]
    return datetime.time(t[0], t[1])
github atareao / my-weather-indicator / src / weatherservice.py View on Github external
def get_sunset(day, longitude, latitude, rawOffset):
    sun = Sun()
    ss = sun.sunRiseSetLocal(
        day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude), rawOffset)
    return '%s' % (ss[1])
github atareao / my-weather-indicator / src / weatherservice.py View on Github external
def get_dusk(day, longitude, latitude, rawOffset):
    sun = Sun()
    ss = sun.civilTwilightLocal(
        day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude), rawOffset)
    return '%s' % (ss[1])
github atareao / my-weather-indicator / src / weatherservice.py View on Github external
def get_dayCivilTwilightLength(day, longitude, latitude):
    sun = Sun()
    return sun.dayCivilTwilightLength(
        day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude))
github atareao / my-weather-indicator / src / weatherservice.py View on Github external
def get_dawn(day, longitude, latitude, rawOffset):
    sun = Sun()
    ss = sun.civilTwilightLocal(
        day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude), rawOffset)
    return '%s' % (ss[0])
github atareao / my-weather-indicator / src / weatherservice.py View on Github external
def get_dayLength(day, longitude, latitude):
    sun = Sun()
    return sun.dayLength(
        day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude))
github atareao / my-weather-indicator / src / weatherservice.py View on Github external
def get_sunrise(day, longitude, latitude, rawOffset):
    sun = Sun()
    ss = sun.sunRiseSetLocal(
        day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude), rawOffset)
    return '%s' % (ss[0])