gatech.date = '1984/5/30 4:00:00' # 0:00:00 local time (ignoring DST)
gatech.lat = str(33.775618)
gatech.lon = str(-84.396285)
sunrise = gatech.next_rising(ephem.Sun()) # local sunrise on 5/30/1984 in UTC
sunset = gatech.next_setting(ephem.Sun()) # local sunset on 5/30/1984 in UTC
gatech.date
的时间分量只需要是一个UTC值,该值不能接近任何可能的日出/日落时间。最保险的办法是选择当地的中午或午夜。它不一定是正午或午夜,只要它离日出/日落足够远,以避免混淆pyephem的下一个/上一个函数-即使DST试图制造混乱。你知道吗使用本地午夜:
如果您使用的是local noon,那么将使用
previous_rising
和next_setting
函数。你知道吗相关问题 更多 >
编程相关推荐