Skip to content

Commit

Permalink
Crop data using 'weight' extent in compute_interferogram()
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexey Pechnikov committed Jun 7, 2024
1 parent 84327ce commit 1a11437
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pygmtsar/pygmtsar/Stack_phasediff.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ def compute_interferogram(self, pairs, name, resolution=None, weight=None, phase
decimator = self.decimator(resolution=resolution, grid=coarsen, debug=debug)
else:
decimator = None

if weight is not None:
bounds = self.get_bounds(weight)

# Applying iterative processing to prevent Dask scheduler deadlocks.
counter = 0
Expand All @@ -59,6 +62,8 @@ def compute_interferogram(self, pairs, name, resolution=None, weight=None, phase
chunk, dates = self.get_pairs(chunk, dates=True)
# load Sentinel-1 data
data = self.open_data(dates, debug=debug)
if weight is not None:
data = data.sel(y=slice(bounds[1], bounds[3]), x=slice(bounds[0], bounds[2]))
intensity = np.square(np.abs(data))
# Gaussian filtering 200m cut-off wavelength with optional range multilooking on Sentinel-1 amplitudes
amp_look = self.multilooking(intensity, wavelength=wavelength, coarsen=coarsen, debug=debug)
Expand Down

0 comments on commit 1a11437

Please sign in to comment.