Skip to content

Commit

Permalink
Merge pull request #614 from mrava87/fix-chirpradon3d
Browse files Browse the repository at this point in the history
Bug: fix pyfftw handling in chirpradon3d
  • Loading branch information
mrava87 authored Oct 4, 2024
2 parents ea8fff0 + eb204df commit 97bab0a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions pylops/signalprocessing/chirpradon3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
pyfftw_message = deps.pyfftw_import("the chirpradon3d module")

if pyfftw_message is None:
import pyfftw

from ._chirpradon3d import _chirp_radon_3d_fftw

logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.WARNING)
Expand Down Expand Up @@ -101,23 +99,23 @@ def __init__(

@reshaped
def _matvec(self, x: NDArray) -> NDArray:
if self.engine == "fftw" and pyfftw is not None:
if self.engine == "fftw" and pyfftw_message is None:
return _chirp_radon_3d_fftw(
x, self.dt, self.dy, self.dx, self.pmax, mode="f", **self.kwargs_fftw
)
return _chirp_radon_3d(x, self.dt, self.dy, self.dx, self.pmax, mode="f")

@reshaped
def _rmatvec(self, x: NDArray) -> NDArray:
if self.engine == "fftw" and pyfftw is not None:
if self.engine == "fftw" and pyfftw_message is None:
return _chirp_radon_3d_fftw(
x, self.dt, self.dy, self.dx, self.pmax, mode="a", **self.kwargs_fftw
)
return _chirp_radon_3d(x, self.dt, self.dy, self.dx, self.pmax, mode="a")

def inverse(self, x: NDArray) -> NDArray:
x = x.reshape(self.dimsd)
if self.engine == "fftw" and pyfftw is not None:
if self.engine == "fftw" and pyfftw_message is None:
y = _chirp_radon_3d_fftw(
x, self.dt, self.dy, self.dx, self.pmax, mode="i", **self.kwargs_fftw
)
Expand Down

0 comments on commit 97bab0a

Please sign in to comment.