Skip to content

Commit 559b8d7

Browse files
authored
fix zero step size bug in unwrap_error_phase_closure (#1067)
+ replace the np.rint() call with np.ceil() to ensure non-zero step size, which could happen for long time-series with highly redundant networks.
1 parent 23b87d9 commit 559b8d7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/mintpy/unwrap_error_phase_closure.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def calc_num_triplet_with_nonzero_integer_ambiguity(ifgram_file, mask_file=None,
122122
# calculate number of nonzero closure phase
123123
ds_size = (C.shape[0] * 2 + C.shape[1]) * length * width * 4
124124
num_loop = int(np.ceil(ds_size * 2 / (max_memory * 1024**3)))
125-
step = int(np.rint(length / num_loop / 10) * 10)
125+
# ensure a min step size of 10
126+
step = int(np.ceil(length / num_loop / 10)) * 10
126127
num_loop = int(np.ceil(length / step))
127128
num_nonzero_closure = np.zeros((length, width), dtype=np.float32)
128129
msg = 'calculating the number of triplets with non-zero integer ambiguity of closure phase ...'

0 commit comments

Comments
 (0)