Skip to content

Commit

Permalink
Exit if suffix is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
yumorishita committed Nov 16, 2020
1 parent f3c7572 commit 02b7e68
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions bin/LiCSBAS11_check_unw.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""
v1.3.1 20200911 Yu Morishita, GSI
v1.3.2 20201116 Yu Morishita, GSI
========
Overview
Expand Down Expand Up @@ -44,6 +44,8 @@
"""
#%% Change log
'''
v1.3.2 20201116 Yu Morioshita, GSI
- Exit if suffix is not set
v1.3.1 20200911 Yu Morioshita, GSI
- Change default to -c 0.05 -u 0.3
v1.3 20200703 Yu Morioshita, GSI
Expand Down Expand Up @@ -83,7 +85,7 @@ def main(argv=None):
argv = sys.argv

start = time.time()
ver="1.3.1"; date=20200911; author="Y. Morishita"
ver="1.3.2"; date=20201116; author="Y. Morishita"
print("\n{} ver{} {} {}".format(os.path.basename(argv[0]), ver, date, author), flush=True)
print("{} {}".format(os.path.basename(argv[0]), ' '.join(argv[1:])), flush=True)

Expand Down Expand Up @@ -247,19 +249,28 @@ def main(argv=None):
print('# unw_cov_thre: {0}, coh_thre: {1}'.format(unw_cov_thre, coh_thre), file=fstats)
print('# ifg dates bperp dt unw_cov coh_av', file=fstats)

### Identify suffix of raster image (ras or bmp?)
### Identify suffix of raster image (png, ras or bmp?)
unwfile = os.path.join(ifgdir, ifgdates[0], ifgdates[0]+'.unw')
if os.path.exists(unwfile+'.ras'):
suffix = '.ras'
elif os.path.exists(unwfile+'.bmp'):
suffix = '.bmp'
elif os.path.exists(unwfile+'.png'):
suffix = '.png'
else:
print('\nERROR: No browse image available for {}!\n'
.format(unwfile), file=sys.stderr)
return 2

for i, ifgd in enumerate(ifgdates):
rasname = ifgdates[i]+'.unw'+suffix
rasorg = os.path.join(ifgdir, ifgdates[i], rasname)


if not os.path.exists(rasorg):
print('\nERROR: No browse image {} available!\n'
.format(rasorg), file=sys.stderr)
return 2

### Identify bad ifgs and link ras
if rate_cov[i] < unw_cov_thre or coh_avg_ifg[i] < coh_thre:
bad_ifgdates.append(ifgdates[i])
Expand Down

0 comments on commit 02b7e68

Please sign in to comment.