Skip to content
Snippets Groups Projects
Commit 6fd429d7 authored by tomrink's avatar tomrink
Browse files

minor

parent 0ba1dbda
No related branches found
No related tags found
No related merge requests found
......@@ -43,10 +43,12 @@ class Files:
return self.flist[k], self.ftimes[k, 0], k
def get_file(self, timestamp):
def get_file(self, timestamp, window=None):
if window is None:
window = self.span_seconds
diff = self.ftimes[:, 0] - timestamp
midx = np.argmin(np.abs(diff))
if np.abs(self.ftimes[midx, 0] - timestamp) < self.span_seconds:
if np.abs(self.ftimes[midx, 0] - timestamp) < window:
return self.flist[midx], self.ftimes[midx, 0], midx
else:
return None, None, None
......@@ -151,10 +153,12 @@ class AMVFiles:
return self.flist[k], self.ftimes[k, 0], k
def get_file(self, timestamp):
def get_file(self, timestamp, window=None):
if window is None:
window = self.span_seconds
diff = self.ftimes[:, 0] - timestamp
midx = np.argmin(np.abs(diff))
if np.abs(self.ftimes[midx, 0] - timestamp) < self.span_seconds:
if np.abs(self.ftimes[midx, 0] - timestamp) < window:
return self.flist[midx], self.ftimes[midx, 0], midx
else:
return None, None, None
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment