diff --git a/WrightTools/data/_data.py b/WrightTools/data/_data.py index 9a224f51b..1d1922b91 100644 --- a/WrightTools/data/_data.py +++ b/WrightTools/data/_data.py @@ -15,7 +15,6 @@ import scipy from scipy.interpolate import griddata, interp1d -from skimage.transform import downscale_local_mean from .._group import Group from .. import collection as wt_collection @@ -894,60 +893,6 @@ def create_variable( self.attrs["variable_names"] = np.append(self.attrs["variable_names"], name.encode()) return variable - def downscale(self, tup, name=None, parent=None) -> "Data": - """Down sample the data array using local averaging. - - See `skimage.transform.downscale_local_mean`__ for more info. - - __ http://scikit-image.org/docs/0.12.x/api/ - skimage.transform.html#skimage.transform.downscale_local_mean - - Parameters - ---------- - tup : tuple of ints - The collection of step sizes by which each axis is binned. - Each axis is sliced with step size determined by the tuple. - To keep an axis sampling unchanged, use 1 or None - name : string (optional) - The name of the string. Default is None. - parent : WrightTools Collection instance (optional) - Collection to place the downscaled data object. Default is - None (new parent). - - Returns - ------- - WrightTools Data instance - New data object with the downscaled channels and axes - - See Also - -------- - zoom - Zoom the data array using spline interpolation of the requested order. - """ - if name is None: - name = self.natural_name + "_downscaled" - if parent is None: - newdata = Data(name=name) - else: - parent.create_data(name=name) - - for channel in self.channels: - name = channel.natural_name - newdata.create_channel( - name=name, values=downscale_local_mean(channel[:], tup), units=channel.units - ) - args = [] - for i, axis in enumerate(self.axes): - if len(axis.variables) > 1: - raise NotImplementedError("downscale only works with simple axes currently") - variable = axis.variables[0] - name = variable.natural_name - args.append(name) - slices = [slice(None, None, step) for step in tup] - newdata.create_variable(name=name, values=variable[slices], units=variable.units) - newdata.transform(*args) - return newdata - def get_nadir(self, channel=0) -> tuple: """Get the coordinates, in units, of the minimum in a channel. @@ -1932,11 +1877,6 @@ def zoom(self, factor, order=1, verbose=True): The order of the spline used to interpolate onto new points. verbose : bool (optional) Toggle talkback. Default is True. - - See Also - -------- - downscale - Down-sample the data array using local averaging. """ raise NotImplementedError import scipy.ndimage diff --git a/docs/api/WrightTools.data.Data.rst b/docs/api/WrightTools.data.Data.rst index e6942be42..5805373e7 100644 --- a/docs/api/WrightTools.data.Data.rst +++ b/docs/api/WrightTools.data.Data.rst @@ -27,7 +27,6 @@ WrightTools.data.Data ~Data.create_dataset ~Data.create_group ~Data.create_variable - ~Data.downscale ~Data.flush ~Data.get ~Data.get_nadir diff --git a/setup.py b/setup.py index bfd16a895..ea05b580e 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,6 @@ def read(fname): setup_requires=["pytest-runner"], tests_require=["pytest", "pytest-cov", "sphinx", "sphinx-gallery==0.1.12", "sphinx-rtd-theme"], install_requires=[ - "scikit-image", "h5py", "imageio", "matplotlib>=3.0", diff --git a/tests/data/downscale.py b/tests/data/downscale.py deleted file mode 100644 index befeb12f3..000000000 --- a/tests/data/downscale.py +++ /dev/null @@ -1,24 +0,0 @@ -#! /usr/bin/env python3 -"""Test downscale.""" - - -# --- import -------------------------------------------------------------------------------------- - - -import WrightTools as wt -from WrightTools import datasets - - -# --- test ---------------------------------------------------------------------------------------- - - -def test_downscale(): - p = datasets.Solis.wm_ypos_fluorescence_with_filter - a = wt.data.from_Solis(p) - b = a.downscale((3, 10)) - assert b.shape == (854, 216) - assert b.axis_expressions == a.axis_expressions - - -if __name__ == "__main__": - test_downscale()