Skip to content

Commit

Permalink
Merge pull request #2174 from mraspaud/fix-3d-enhancement
Browse files Browse the repository at this point in the history
Fix 3d effect enhancement
  • Loading branch information
mraspaud authored Aug 15, 2022
2 parents dbe2838 + be9b6ce commit 768524f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions satpy/enhancements/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,13 +534,12 @@ def three_d_effect(img, **kwargs):
[-w, 1, w],
[-w, 0, w]])
mode = kwargs.get('convolve_mode', 'same')

return _three_d_effect(img.data, kernel=kernel, mode=mode)


@exclude_alpha
@on_separate_bands
@using_map_blocks
@on_dask_array
def _three_d_effect(band_data, kernel=None, mode=None, index=None):
del index

Expand Down
7 changes: 4 additions & 3 deletions satpy/tests/enhancement_tests/test_enhancements.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ def setup_method(self):
crefl_data /= 5.605
crefl_data[0, 0] = np.nan # one bad value for testing
crefl_data[0, 1] = 0.
self.ch1 = xr.DataArray(data, dims=('y', 'x'), attrs={'test': 'test'})
self.ch2 = xr.DataArray(crefl_data, dims=('y', 'x'), attrs={'test': 'test'})
self.ch1 = xr.DataArray(da.from_array(data, chunks=2), dims=('y', 'x'), attrs={'test': 'test'})
self.ch2 = xr.DataArray(da.from_array(crefl_data, chunks=2), dims=('y', 'x'), attrs={'test': 'test'})
rgb_data = np.stack([data, data, data])
self.rgb = xr.DataArray(rgb_data, dims=('bands', 'y', 'x'),
self.rgb = xr.DataArray(da.from_array(rgb_data, chunks=(3, 2, 2)),
dims=('bands', 'y', 'x'),
coords={'bands': ['R', 'G', 'B']})

@pytest.mark.parametrize(
Expand Down

0 comments on commit 768524f

Please sign in to comment.