Skip to content

Commit

Permalink
Fix for the recent commit
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Aug 11, 2023
1 parent 3268d94 commit 8edec12
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pygmtsar/pygmtsar/SBAS_geocode.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,11 @@ def ra2ll(self, grid, trans=None, chunksize=None):
trans = self.get_trans_dat()

@dask.delayed
def intf_block(lats_block, lons_block):
def intf_block(lats_block, lons_block, stackval=None):
from scipy.interpolate import RegularGridInterpolator

# use outer variables
block_grid = grid.sel({stackvar: stackval}) if stackval is not None else grid
trans_block = trans.sel(lat=lats_block, lon=lons_block)
# check if the data block exists
if not (trans_block.lat.size>0 and trans_block.lon.size>0):
Expand Down Expand Up @@ -309,13 +311,12 @@ def intf_block(lats_block, lons_block):

stack = []
for stackval in grid[stackvar].values if len(grid.dims) == 3 else [None]:
block_grid = grid.sel({stackvar: stackval}) if stackval is not None else grid
# per-block processing
blocks_total = []
for lats_block in lats_blocks:
blocks = []
for lons_block in lons_blocks:
block = dask.array.from_delayed(intf_block(lats_block, lons_block),
block = dask.array.from_delayed(intf_block(lats_block, lons_block, stackval),
shape=(lats_block.size, lons_block.size), dtype=np.float32)
blocks.append(block)
del block
Expand Down

0 comments on commit 8edec12

Please sign in to comment.