您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 
 

17 行
380 B

  1. #!/usr/bin/env python3
  2. import ephem
  3. import time
  4. import sys
  5. timezone = 1 + time.localtime().tm_isdst
  6. date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])-(timezone*60*60)))
  7. obs=ephem.Observer()
  8. obs.lat='53.06272'
  9. obs.long='8.86'
  10. obs.date = date
  11. sun = ephem.Sun(obs)
  12. sun.compute(obs)
  13. sun_angle = float(sun.alt) * 57.2957795 # Rad to deg
  14. print(int(sun_angle))