Commit 58067745 authored by Jonathan Hanks's avatar Jonathan Hanks
Browse files

Minor changes to iterate to support sub-second (16Hz) online data streams.

parent c5209fcf
......@@ -185,24 +185,19 @@ def get_connection():
def iterate(channels, start_end=None, stride=None):
args = []
kwargs = {}
if start_end:
args += list(start_end)
# FIXME: nds2 0.16 has the following:
# args += [nds2.connection.FAST_STRIDE]
# args += [channels]
with closing(get_connection()) as conn:
if stride:
pass
elif conn.get_protocol() == 1:
stride = -1
else:
stride = 1
args += [stride]
args += [channels]
logger.debug("iterate{}".format(tuple(args)))
for bufs in conn.iterate(*args):
yield bufs
kwargs['gps_start'] = start_end[0]
kwargs['gps_stop'] = start_end[1]
if stride:
pass
else:
stride = nds2.connection.FAST_STRIDE
kwargs['stride'] = stride
kwargs['channels'] = channels
logger.debug("iterate{}".format(kwargs))
for bufs in nds2.iterate(**kwargs):
yield bufs
def fetch(channels, start_end):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment