diff --git a/pygmtsar/pygmtsar/Stack_align.py b/pygmtsar/pygmtsar/Stack_align.py index 24fe662d..336c78ec 100644 --- a/pygmtsar/pygmtsar/Stack_align.py +++ b/pygmtsar/pygmtsar/Stack_align.py @@ -279,7 +279,13 @@ def subswaths_offsets(self, debug=False): subswaths = ''.join(map(str, subswaths)) if len(subswaths) == 1: - return + prm = self.PRM() + maxx, yvalid, num_patch = prm.get('num_rng_bins', 'num_valid_az', 'num_patches') + maxy = yvalid * num_patch + offsets = {'bottom': 0, 'extent': [maxy, maxx]} + if debug: + print ('offsets', offsets) + return offsets # calculate the offsets to merge subswaths prms = [] diff --git a/pygmtsar/pygmtsar/Stack_topo.py b/pygmtsar/pygmtsar/Stack_topo.py index 9dd318aa..933299eb 100644 --- a/pygmtsar/pygmtsar/Stack_topo.py +++ b/pygmtsar/pygmtsar/Stack_topo.py @@ -194,17 +194,8 @@ def block_phase_dask(block_topo, y_chunk, x_chunk, prm1, prm2): # immediately prepare PRM # here is some delay on the function call but the actual processing is faster offsets = self.subswaths_offsets(debug=debug) - # reference scene first subswath - prm0 = self.PRM() - if offsets is not None: - # multiple subswaths - maxy, maxx = offsets['extent'] - minh = offsets['bottom'] - else: - # one subswath - maxy, maxx = prm0.get('num_valid_az', 'num_rng_bins') - minh = 0 - del prm0, offsets + maxy, maxx = offsets['extent'] + minh = offsets['bottom'] def prepare_prms(pair, *args): date1, date2 = pair diff --git a/pygmtsar/pygmtsar/Stack_trans.py b/pygmtsar/pygmtsar/Stack_trans.py index e7518151..011cc082 100644 --- a/pygmtsar/pygmtsar/Stack_trans.py +++ b/pygmtsar/pygmtsar/Stack_trans.py @@ -17,9 +17,7 @@ def define_trans_grid(self, coarsen): # select radar coordinates extent #rng_max, yvalid, num_patch = self.PRM().get('num_rng_bins', 'num_valid_az', 'num_patches') #azi_max = yvalid * num_patch - data = self.open_data(dates=[self.reference]) - rng_max = float(data.x[-1]) - azi_max = float(data.y[-1]) + azi_max, rng_max = self.subswaths_offsets()['extent'] #print ('azi_max', azi_max, 'rng_max', rng_max) # this grid covers the full interferogram area # common single pixel resolution