Skip to content

Instantly share code, notes, and snippets.

@jbwhit
Created March 3, 2014 12:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbwhit/9323761 to your computer and use it in GitHub Desktop.
Save jbwhit/9323761 to your computer and use it in GitHub Desktop.
Combine exposures together if they have a close "enough" time stamp.
name_time = []
for guts in expos:
infile, expo = guts
name_time.append((infile, dateutil.parser.parse(expo["flux_header"]["DATE"])))
stationary_list = list(name_time)
newlist = []
for infile, timestamp in stationary_list:
temp = []
for index, guts in enumerate(name_time):
secondpass, secondtimestamp = guts
timedelt = np.abs(timestamp - secondtimestamp)
if timedelt.total_seconds() < 35:
temp.append(secondpass)
newlist.append(temp)
brandnewlist = []
for element in newlist:
if element not in brandnewlist:
brandnewlist.append(element)
brandnewlist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment