Browse Source

Bugs fixed.

I've experienced issue when I put in +2 timezone, the script calculates sun elevation for -2 timezone so i changed plus to minus in time.localtime function. Also added support for Daylight saving time.
tags/v.1.4
mihajlo2003petkovic 4 years ago
committed by GitHub
parent
commit
4f568b3141
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      sun.py

+ 2
- 2
sun.py View File

@@ -2,8 +2,8 @@
import ephem import ephem
import time import time
import sys import sys
timezone = change_tz
date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])+(timezone*60*60)))
timezone = change_tz + time.localtime().tm_isdst
date = time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(sys.argv[1])-(timezone*60*60)))


obs=ephem.Observer() obs=ephem.Observer()
obs.lat='change_latitude' obs.lat='change_latitude'


Loading…
Cancel
Save