From 48bb6495994f91c06cce9f61d8e246095c8e0772 Mon Sep 17 00:00:00 2001 From: Zhang Yunjun Date: Wed, 9 Aug 2023 11:51:12 +0800 Subject: [PATCH] fix zero step size in unwrap_error_phase_closure + replace np.rint() with np.ceil() to ensure non-zero step size, which could happen for long time-series with highly redundant networks. --- src/mintpy/unwrap_error_phase_closure.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mintpy/unwrap_error_phase_closure.py b/src/mintpy/unwrap_error_phase_closure.py index 91d9953c7..a2a918acc 100644 --- a/src/mintpy/unwrap_error_phase_closure.py +++ b/src/mintpy/unwrap_error_phase_closure.py @@ -122,7 +122,8 @@ def calc_num_triplet_with_nonzero_integer_ambiguity(ifgram_file, mask_file=None, # calculate number of nonzero closure phase ds_size = (C.shape[0] * 2 + C.shape[1]) * length * width * 4 num_loop = int(np.ceil(ds_size * 2 / (max_memory * 1024**3))) - step = int(np.rint(length / num_loop / 10) * 10) + # ensure a min step size of 10 + step = int(np.ceil(length / num_loop / 10)) * 10 num_loop = int(np.ceil(length / step)) num_nonzero_closure = np.zeros((length, width), dtype=np.float32) msg = 'calculating the number of triplets with non-zero integer ambiguity of closure phase ...'