Skip to content

Instantly share code, notes, and snippets.

@dansteingart
Created November 18, 2016 19:51
Show Gist options
  • Save dansteingart/e12bc379cabfc18df13f32c4369b4169 to your computer and use it in GitHub Desktop.
Save dansteingart/e12bc379cabfc18df13f32c4369b4169 to your computer and use it in GitHub Desktop.
get_close_time.py
##Author:
##Date Started:
##Notes:
from pithy import *
import libMotorPhoton as lmp
from datetime import datetime as dt
import time
photon = lmp.motorPhoton("MischievousMelon")
data = photon.getHistory("2016-11-09")
want = time.mktime((2016,11,9,12+4,20,0,0,0,0))
close = abs(data['time']-want).argmin()
print data.iloc[close]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment