def standard_from_sundial(tee, location):
"""Return standard time of temporal moment, tee, at location, location.
Return BOGUS if temporal hour is undefined that day."""
date = fixed_from_moment(tee)
hour = 24 * mod(tee, 1)
if (6 <= hour <= 18):
h = daytime_temporal_hour(date, location)
elif (hour < 6):
h = nighttime_temporal_hour(date - 1, location)
else:
h = nighttime_temporal_hour(date, location)
# return
if (h == BOGUS):
return BOGUS
elif (6 <= hour <= 18):
return sunrise(date, location) + ((hour - 6) * h)
elif (hour < 6):
return sunset(date - 1, location) + ((hour + 6) * h)
else:
return sunset(date, location) + ((hour - 18) * h)
# see lines 3075-3079 in calendrica-3.0.cl
评论列表
文章目录