Skip to content

Commit

Permalink
remove deprecated complex_
Browse files Browse the repository at this point in the history
also see if `nlooks` is causing whirlwind to freeze
  • Loading branch information
scottstanie committed Oct 13, 2024
1 parent 919da2d commit 7c28697
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/dolphin/goldstein.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 = }")
Expand All @@ -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.
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_unwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 7c28697

Please sign in to comment.