|
15 | 15 |
|
16 | 16 | import scipy |
17 | 17 | from scipy.interpolate import griddata, interp1d |
18 | | -from skimage.transform import downscale_local_mean |
19 | 18 |
|
20 | 19 | from .._group import Group |
21 | 20 | from .. import collection as wt_collection |
@@ -894,60 +893,6 @@ def create_variable( |
894 | 893 | self.attrs["variable_names"] = np.append(self.attrs["variable_names"], name.encode()) |
895 | 894 | return variable |
896 | 895 |
|
897 | | - def downscale(self, tup, name=None, parent=None) -> "Data": |
898 | | - """Down sample the data array using local averaging. |
899 | | -
|
900 | | - See `skimage.transform.downscale_local_mean`__ for more info. |
901 | | -
|
902 | | - __ http://scikit-image.org/docs/0.12.x/api/ |
903 | | - skimage.transform.html#skimage.transform.downscale_local_mean |
904 | | -
|
905 | | - Parameters |
906 | | - ---------- |
907 | | - tup : tuple of ints |
908 | | - The collection of step sizes by which each axis is binned. |
909 | | - Each axis is sliced with step size determined by the tuple. |
910 | | - To keep an axis sampling unchanged, use 1 or None |
911 | | - name : string (optional) |
912 | | - The name of the string. Default is None. |
913 | | - parent : WrightTools Collection instance (optional) |
914 | | - Collection to place the downscaled data object. Default is |
915 | | - None (new parent). |
916 | | -
|
917 | | - Returns |
918 | | - ------- |
919 | | - WrightTools Data instance |
920 | | - New data object with the downscaled channels and axes |
921 | | -
|
922 | | - See Also |
923 | | - -------- |
924 | | - zoom |
925 | | - Zoom the data array using spline interpolation of the requested order. |
926 | | - """ |
927 | | - if name is None: |
928 | | - name = self.natural_name + "_downscaled" |
929 | | - if parent is None: |
930 | | - newdata = Data(name=name) |
931 | | - else: |
932 | | - parent.create_data(name=name) |
933 | | - |
934 | | - for channel in self.channels: |
935 | | - name = channel.natural_name |
936 | | - newdata.create_channel( |
937 | | - name=name, values=downscale_local_mean(channel[:], tup), units=channel.units |
938 | | - ) |
939 | | - args = [] |
940 | | - for i, axis in enumerate(self.axes): |
941 | | - if len(axis.variables) > 1: |
942 | | - raise NotImplementedError("downscale only works with simple axes currently") |
943 | | - variable = axis.variables[0] |
944 | | - name = variable.natural_name |
945 | | - args.append(name) |
946 | | - slices = [slice(None, None, step) for step in tup] |
947 | | - newdata.create_variable(name=name, values=variable[slices], units=variable.units) |
948 | | - newdata.transform(*args) |
949 | | - return newdata |
950 | | - |
951 | 896 | def get_nadir(self, channel=0) -> tuple: |
952 | 897 | """Get the coordinates, in units, of the minimum in a channel. |
953 | 898 |
|
@@ -1932,11 +1877,6 @@ def zoom(self, factor, order=1, verbose=True): |
1932 | 1877 | The order of the spline used to interpolate onto new points. |
1933 | 1878 | verbose : bool (optional) |
1934 | 1879 | Toggle talkback. Default is True. |
1935 | | -
|
1936 | | - See Also |
1937 | | - -------- |
1938 | | - downscale |
1939 | | - Down-sample the data array using local averaging. |
1940 | 1880 | """ |
1941 | 1881 | raise NotImplementedError |
1942 | 1882 | import scipy.ndimage |
|
0 commit comments