Skip to content

Commit

Permalink
Fix chunks for connected components calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Sep 13, 2024
1 parent 4c084d3 commit adbd18d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pygmtsar/pygmtsar/Stack_unwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ def find_mode(array):
return values[max_count_index] if counts.size > 0 else np.nan

# Apply the function along the 'pair' dimension
maincomps = xr.apply_ufunc(find_mode, conncomp, input_core_dims=[['y', 'x']],
maincomps = xr.apply_ufunc(find_mode, conncomp.chunk(dict(y=-1, x=-1)), input_core_dims=[['y', 'x']],
vectorize=True, dask='parallelized', output_dtypes=[int])
return data.where(conncomp==maincomps)

Expand Down

0 comments on commit adbd18d

Please sign in to comment.