Skip to content

Commit

Permalink
Use compute() for unstacking in deco=imator as lazy data processing c…
Browse files Browse the repository at this point in the history
…an be slow in some Dask versions
  • Loading branch information
AlexeyPechnikov committed Nov 30, 2024
1 parent d3dba48 commit 3f7825a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pygmtsar/pygmtsar/Stack_multilooking.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,10 @@ def decimator(da):
warnings.filterwarnings('ignore')
warnings.filterwarnings('ignore', module='dask')
warnings.filterwarnings('ignore', module='dask.core')
# iunstack data if needed
# unstack data if needed
if 'stack' in da.dims:
da = da.unstack('stack')
# .unstack() is too slow on lazy grids in some of Xarray/Dask versions
da = da.compute().unstack('stack')
# workaround for Google Colab when we cannot save grids with x,y coordinate names
# also supports geographic coordinates
yname = [varname for varname in ['y', 'lat', 'a'] if varname in da.dims][0]
Expand Down

0 comments on commit 3f7825a

Please sign in to comment.