Skip to content

Commit

Permalink
Add stacked data support to decimator()
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Jul 7, 2024
1 parent 9a7b817 commit 48f1003
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pygmtsar/pygmtsar/Stack_multilooking.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def decimator(da):
with dask.config.set(**{'array.slicing.split_large_chunks': True}):
#if func not in ['mean', 'min', 'max', 'count', 'sum']:
# raise ValueError(f"Unsupported function {func}. Should be 'mean','min','max','count', or 'sum'")
return getattr(da.coarsen(coarsen_args, boundary='trim'), func)()\
return getattr((da.unstack('stack') if 'stack' in da.dims else da).coarsen(coarsen_args, boundary='trim'), func)()\
.chunk({yname: self.chunksize, xname: self.chunksize})

# return callback function and set common chunk size
Expand Down

0 comments on commit 48f1003

Please sign in to comment.