Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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])
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])
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])
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])
def get_dayCivilTwilightLength(day, longitude, latitude):
sun = Sun()
return sun.dayCivilTwilightLength(
day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude))
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])
def get_dayLength(day, longitude, latitude):
sun = Sun()
return sun.dayLength(
day.year, day.month, day.day, cf.s2f(longitude), cf.s2f(latitude))
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])