|
|
@@ -279,7 +279,7 @@ class Filter(object): |
|
|
|
if args is None: |
|
|
|
args = [] |
|
|
|
extractor = NumpyClient(self.src.url).stream_extract_numpy |
|
|
|
inserter = NumpyClient(self.dest.url).stream_insert_context |
|
|
|
inserter = NumpyClient(self.dest.url).stream_insert_numpy_context |
|
|
|
|
|
|
|
# Format output data. |
|
|
|
formatter = lambda row: " ".join([repr(x) for x in row]) + "\n" |
|
|
@@ -293,13 +293,7 @@ class Filter(object): |
|
|
|
print "Processing", self.interval_string(interval) |
|
|
|
with inserter(self.dest.path, |
|
|
|
interval.start, interval.end) as insert_ctx: |
|
|
|
def insert_function(array): |
|
|
|
s = cStringIO.StringIO() |
|
|
|
if len(np.shape(array)) != 2: |
|
|
|
raise Exception("array must be 2-dimensional") |
|
|
|
np.savetxt(s, array) |
|
|
|
insert_ctx.insert(s.getvalue()) |
|
|
|
|
|
|
|
insert_function = insert_ctx.insert |
|
|
|
old_array = np.array([]) |
|
|
|
for new_array in extractor(self.src.path, |
|
|
|
interval.start, interval.end, |
|
|
|