From 7c2869734cae7a3c8b8ad6a20bd76bdf07ddb097 Mon Sep 17 00:00:00 2001 From: Scott Staniewicz Date: Sun, 13 Oct 2024 13:06:02 -0400 Subject: [PATCH] remove deprecated `complex_` also see if `nlooks` is causing whirlwind to freeze --- src/dolphin/goldstein.py | 8 ++++---- tests/test_unwrap.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/dolphin/goldstein.py b/src/dolphin/goldstein.py index 521c4ec5..818b6ce4 100644 --- a/src/dolphin/goldstein.py +++ b/src/dolphin/goldstein.py @@ -3,7 +3,7 @@ def goldstein( - phase: NDArray[np.complex_] | NDArray[np.float_], alpha: float, psize: int = 32 + phase: NDArray[np.complex64] | NDArray[np.float_], alpha: float, psize: int = 32 ) -> np.ndarray: """Apply the Goldstein adaptive filter to the given data. @@ -28,7 +28,7 @@ def goldstein( """ - def apply_pspec(data: NDArray[np.complex_]) -> np.ndarray: + def apply_pspec(data: NDArray[np.complex64]) -> np.ndarray: # NaN is allowed value if alpha < 0: raise ValueError(f"alpha must be >= 0, got {alpha = }") @@ -54,7 +54,7 @@ def make_weight(nxp: int, nyp: int) -> np.ndarray: return weight def patch_goldstein_filter( - data: NDArray[np.complex_], weight: NDArray[np.float_], psize: int + data: NDArray[np.complex64], weight: NDArray[np.float_], psize: int ) -> np.ndarray: """Apply the filter to a single patch of data. @@ -78,7 +78,7 @@ def patch_goldstein_filter( data = np.fft.ifft2(data, s=(psize, psize)) return weight * data - def apply_goldstein_filter(data: NDArray[np.complex_]) -> np.ndarray: + def apply_goldstein_filter(data: NDArray[np.complex64]) -> np.ndarray: # Create an empty array for the output out = np.zeros(data.shape, dtype=np.complex64) empty_mask = np.isnan(data) | (np.angle(data) == 0) diff --git a/tests/test_unwrap.py b/tests/test_unwrap.py index 6e52ccf4..739046ba 100644 --- a/tests/test_unwrap.py +++ b/tests/test_unwrap.py @@ -374,7 +374,7 @@ def test_unwrap_whirlwind(self, tmp_path, raster_100_by_200, corr_raster): corr_filename=corr_raster, unw_filename=unw_filename, unwrap_options=unwrap_options, - nlooks=1, + nlooks=3, ) assert out_path.exists() assert conncomp_path.exists()