Local time using UTC, coordinates (PyEphem doesn't work)
I have a list of coordinates and UTC time, but unfortunately pyephem's localtime function doesn't work - local computer time is displayed. I want to filter out stations that are at night (not between 8:00 and 16:00). Is there an easy way to do this?
for sit,lat,lon in zip(nsites,lats,longs):
user=[]
user = ephem.Observer()
user.lat = lat
user.lon = lon
user.date=bstart
if ephem.localtime(user.date).time()>=datetime.time(8) and ephem.localtime(user.date).time()<=datetime.time(16):
user.date=cend
if ephem.localtime(user.date).time()>=datetime.time(8) and ephem.localtime(user.date).time()<=datetime.time(16):
mask.append(True)
else:
mask.append(False)
else:
mask.append(False)
+3
source to share