Skip to content

Commit

Permalink
Use subswath offsets to define transcoding area in radar coordinates
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyPechnikov committed Sep 21, 2024
1 parent 340b8f7 commit 7546eec
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
8 changes: 7 additions & 1 deletion pygmtsar/pygmtsar/Stack_align.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
Expand Down
13 changes: 2 additions & 11 deletions pygmtsar/pygmtsar/Stack_topo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions pygmtsar/pygmtsar/Stack_trans.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7546eec

Please sign in to comment.