Skip to content

Commit

Permalink
Merge branch 'dev' into dask_parallelize
Browse files Browse the repository at this point in the history
  • Loading branch information
bbuzz31 committed Sep 6, 2023
2 parents d31a319 + 32018d5 commit 4840963
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions tools/ARIAtools/ARIAProduct.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,16 @@ def __mappingVersion__(self, fname, version):
+ basename.split('-')[7][2:4] + ':' \
+ basename.split('-')[7][4:] + '.0'

# assign latitude to assist with sorting
rdrmetadata_dict['centerLatitude'] = \
basename.split('-')[8].split('_')[1]
if rdrmetadata_dict['centerLatitude'][-1] == 'S':
rdrmetadata_dict['centerLatitude'] = -1 * \
int(rdrmetadata_dict['centerLatitude'][:-1])
else:
rdrmetadata_dict['centerLatitude'] = \
int(rdrmetadata_dict['centerLatitude'][:-1])

#hardcoded keys for a given sensor
if basename.split('-')[0] == 'S1':
rdrmetadata_dict['missionID'] = 'Sentinel-1'
Expand Down Expand Up @@ -750,10 +760,12 @@ def __run__(self):
else:
self.products += self.__readproduct__(self.files[0])

# Sort by pair and start time.
# Sort by pair, start time, and latitude
self.products = [i for i in self.products if i != []]
self.products = sorted(self.products, key=lambda k:
(k[0]['pair_name'], k[0]['azimuthZeroDopplerMidTime']))
self.products = sorted(self.products, key=lambda i:
(i[0]['pair_name'],
i[0]['azimuthZeroDopplerMidTime'],
i[0]['centerLatitude']))
self.products = list(self.products)

# Exit if products from different sensors were mixed
Expand Down

0 comments on commit 4840963

Please sign in to comment.