Skip to content

Commit

Permalink
Small bug fix for all nan ifg
Browse files Browse the repository at this point in the history
  • Loading branch information
yumorishita committed Apr 5, 2021
1 parent f7eb22f commit 2c7ef38
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 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.2 20201116 Yu Morishita, GSI
v1.3.3 20210402 Yu Morishita, GSI
========
Overview
Expand Down Expand Up @@ -44,6 +44,9 @@
"""
#%% Change log
'''
v1.3.3 20210402 Yu Morioshita, GSI
- Treat all nan as bad ifg
- Raise error if all ifgs are bad
v1.3.2 20201116 Yu Morioshita, GSI
- Exit if suffix is not set
v1.3.1 20200911 Yu Morioshita, GSI
Expand Down Expand Up @@ -85,7 +88,7 @@ def main(argv=None):
argv = sys.argv

start = time.time()
ver="1.3.2"; date=20201116; author="Y. Morishita"
ver="1.3.3"; date=20210402; 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 @@ -272,7 +275,8 @@ def main(argv=None):
return 2

### Identify bad ifgs and link ras
if rate_cov[i] < unw_cov_thre or coh_avg_ifg[i] < coh_thre:
if rate_cov[i] < unw_cov_thre or coh_avg_ifg[i] < coh_thre or \
np.isnan(rate_cov[i]) or np.isnan(coh_avg_ifg[i]):
bad_ifgdates.append(ifgdates[i])
ixs_bad_ifgdates.append(i)
rm_flag = '*'
Expand Down Expand Up @@ -302,6 +306,10 @@ def main(argv=None):
print('{}'.format(ifgd), file=f)
print('{} {:5.3f} {:5.3f}'.format(ifgd, rate_cov[ixs_bad_ifgdates[i]], coh_avg_ifg[ixs_bad_ifgdates[i]]), flush=True)

### Raise error if all ifgs are bad
if len(bad_ifgdates) == n_ifg:
raise ValueError('All ifgs are regarded as bad!\nChange the parameters or check the input ifgs.\n')


#%% Identify removed image and output file
good_ifgdates = list(set(ifgdates)-set(bad_ifgdates))
Expand Down

0 comments on commit 2c7ef38

Please sign in to comment.