File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -161,12 +161,13 @@ def downsample(
161161 shape_block = proc_block_shape if proc_block_shape else dataset .shape_block ,
162162 )
163163
164- shape_downsampled = tuple (
165- sc // ds for sc , ds in zip (old_dataset .shape_cropped , downsampling )
166- )
167- block_size_downsampled = tuple (
168- sb // ds for (sb , ds ) in zip (old_dataset .shape_block , downsampling )
169- )
164+ size_array = np .ones (old_dataset .shape_cropped [2 :])
165+ size = block_reduce (size_array , downsampling [2 :], method ).shape
166+ shape_downsampled = old_dataset .shape_cropped [:2 ] + size
167+
168+ size_array = np .ones (old_dataset .shape_block [2 :])
169+ size = block_reduce (size_array , downsampling [2 :], method ).shape
170+ block_size_downsampled = old_dataset .shape_block [:2 ] + size
170171
171172 new_dataset = EmptySplitDataset (
172173 root = output_dir or dataset .root .parent ,
You can’t perform that action at this time.
0 commit comments