Commit 6332a4d8 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer Committed by Julia Garriga Ferrer
Browse files

[core][dataset]apply_shift_along_dimension] Consecutively apply shift on all values of given dim

parent c3752212
......@@ -758,18 +758,19 @@ class Dataset():
shift = []
for value in range(self.dims.get(dimension[0]).size):
s = self.find_shift([dimension[0], value], steps, indices)
return numpy.array(shift)
def apply_shift_along_dimension(self, dimension, shift_approach="fft", indices=None,
callback=None, _dir=None):
def apply_shift_along_dimension(self, shift, dimension, shift_approach="fft", indices=None,
callback=None, _dir=None):
dataset = self
for value in range(self.dims.get(dimension[0]).size):
dataset = dataset.apply_shift([dimension[0], value], shift_approach, indices,
callback, _dir)
frames = numpy.arange(self.get_data(indices=indices,
dimension=[dimension[0], value]).shape[0])
dataset = dataset.apply_shift(numpy.outer(shift[value], frames), [dimension[0], value],
shift_approach, indices, callback, _dir)
return dataset
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