Skip to content

Commit f02ee97

Browse files
authored
bugfix in subset.subset_input_dict2box() (#1484)
+ subset: Fix a bug introduced in #1464, while subsetting a file in WGS84 coordinate using --lon option. + info: print out the SNWE info for geocoded files.
1 parent 065e1e2 commit f02ee97

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

src/mintpy/info.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,11 @@ def print_aux_info(fname):
174174
print('file type: '+atr['FILE_TYPE'])
175175
if 'Y_FIRST' in atr.keys():
176176
print('coordinates : GEO')
177+
n = float(atr['Y_FIRST'])
178+
w = float(atr['X_FIRST'])
179+
s = n + float(atr['Y_STEP']) * int(atr['LENGTH'])
180+
e = w + float(atr['X_STEP']) * int(atr['WIDTH'])
181+
print(f'SNWE: {s}, {n}, {w}, {e}.')
177182
else:
178183
print('coordinates : RADAR')
179184
if k in ['timeseries']:

src/mintpy/subset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ def subset_input_dict2box(subset_dict, meta_dict):
208208
raise TypeError('Both --lat/lon are required for WGS84-UTM coordinates conversion.')
209209
else:
210210
# lat/lon --> y/x conversion
211-
sub_x = coord.lalo2yx(None, subset_dict['subset_lon'])[0]
211+
sub_x = coord.lalo2yx(None, subset_dict['subset_lon'])[1]
212212
elif subset_dict['subset_x']:
213213
sub_x = subset_dict['subset_x']
214214
else:

0 commit comments

Comments
 (0)