Commit c6070964 authored by payno's avatar payno

[gradients] fix, _gradients was lock to contain only one dimension

parent 5c95b3d5
......@@ -98,7 +98,7 @@ class IntensityMapping(_MappingBase):
self._resetIntensityMap()
self._resetDim()
for x in range(self.data.shape[-1]):
self.updateProgress(int(x / self.data.shape[2] * 100.0))
self.updateProgress(int(x / self.data.shape[-2] * 100.0))
for y in range(self.data.shape[-2]):
# TODO: do this operation using a grid or something close
# but would have to find a way to write at the same position...
......@@ -185,6 +185,7 @@ class GradientRemoval(_MappingBase):
def apply_gradient_correction(self, data, mapping):
assert isinstance(mapping, IntensityMapping)
_gradients = {}
for axis, dim in mapping.dims.items():
unique_values = numpy.array(self._experiment.dims.get(axis).unique_values)
......@@ -193,7 +194,6 @@ class GradientRemoval(_MappingBase):
corr2, corr1 = numpy.meshgrid(
numpy.linspace(-_delta, _delta, data.shape[2]),
numpy.linspace(0, 0, data.shape[1]))
_gradients = {}
_mean = dim.mean + corr2
_variance = dim.variance + corr2
......
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