Skip to content

Commit 3e4c5b6

Browse files
author
Alexey Pechnikov
committed
Fix incompatibility for recent Xarray/Dask
1 parent 46a045e commit 3e4c5b6

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

pygmtsar/pygmtsar/Stack_phasediff.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,18 @@ def compute_interferogram(self, pairs, name, subswath=None, weight=None, topo=No
6565
#print (f'Interferogram pairs: {len(pairs)}')
6666
chunk, dates = self.get_pairs(chunk, dates=True)
6767
# load Sentinel-1 data
68-
data = self.open_data(dates, subswath=subswath, debug=debug)
68+
data_chunk = self.open_data(dates, subswath=subswath, debug=debug)
6969
if weight is not None:
70-
data = data.reindex_like(weight, fill_value=np.nan)
71-
intensity = np.square(np.abs(data))
70+
data_chunk = data_chunk.reindex_like(weight, fill_value=np.nan)
71+
intensity = np.square(np.abs(data_chunk))
7272
# Gaussian filtering 200m cut-off wavelength with optional range multilooking on Sentinel-1 amplitudes
7373
intensity_look = self.multilooking(intensity, wavelength=wavelength, coarsen=coarsen, debug=debug)
7474
del intensity
75+
phase_chunk = phase[phase.pair.isin(chunk.pair)] if phase is not None else None
7576
# calculate phase difference with topography correction
76-
phasediff = self.phasediff(chunk, data, topo=topo, phase=phase, method=method, joblib_backend=joblib_backend, debug=debug)
77-
del data
77+
phasediff = self.phasediff(chunk, data_chunk, topo=topo, phase=phase_chunk, method=method,
78+
joblib_backend=joblib_backend, debug=debug)
79+
del data_chunk, phase_chunk
7880
# Gaussian filtering 200m cut-off wavelength with optional range multilooking
7981
phasediff_look = self.multilooking(phasediff, weight=weight,
8082
wavelength=wavelength, coarsen=coarsen, debug=debug)

0 commit comments

Comments
 (0)