Commit 23e8332f authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer Committed by Julia Garriga Ferrer
Browse files

[core][dataset] Add find and correct along dimension methods

parent d5dd3a11
...@@ -754,6 +754,25 @@ class Dataset(): ...@@ -754,6 +754,25 @@ class Dataset():
""" """
return shift_detection(self.get_data(indices, dimension), steps) return shift_detection(self.get_data(indices, dimension), steps)
def find_shift_along_dimension(self, dimension, steps=50, indices=None):
shift = []
for value in range(self.dims.get(dimension[0]).size):
s = self.find_shift([dimension[0], value], steps, indices)
print(s)
shift.append(s)
return numpy.array(shift)
def apply_shift_along_dimension(self, 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)
return dataset
def apply_shift(self, shift, dimension=None, shift_approach="fft", indices=None, def apply_shift(self, shift, dimension=None, shift_approach="fft", indices=None,
callback=None, _dir=None): callback=None, _dir=None):
""" """
......
Supports Markdown
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