Antonio Valentino pushed to branch master at Debian GIS Project / mintpy
Commits: eea5cb59 by Antonio Valentino at 2024-05-10T13:24:54+00:00 Fix 0002-No-pyfftw.patch - - - - - 1 changed file: - debian/patches/0002-No-pyfftw.patch Changes: ===================================== debian/patches/0002-No-pyfftw.patch ===================================== @@ -4,11 +4,11 @@ Subject: No pyfftw Forwarded: https://github.com/insarlab/MintPy/pull/1191 --- - src/mintpy/simulation/fractal.py | 21 ++++++++++++++++----- - 1 file changed, 16 insertions(+), 5 deletions(-) + src/mintpy/simulation/fractal.py | 33 ++++++++++++++++++++++----------- + 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/mintpy/simulation/fractal.py b/src/mintpy/simulation/fractal.py -index 864f249..ccb3abf 100644 +index 864f249..4b206f4 100644 --- a/src/mintpy/simulation/fractal.py +++ b/src/mintpy/simulation/fractal.py @@ -19,16 +19,27 @@ import os @@ -44,3 +44,43 @@ index 864f249..ccb3abf 100644 def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3, +@@ -67,8 +78,8 @@ def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3, + + # simulate a uniform random signal + h = np.random.rand(length, width) +- H = pyfftw.interfaces.numpy_fft.fft2(h) +- H = pyfftw.interfaces.numpy_fft.fftshift(H) ++ H = fft2(h) ++ H = fftshift(H) + + # scale the spectrum with the power law + yy, xx = np.mgrid[0:length-1:length*1j, +@@ -120,7 +131,7 @@ def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3, + + # get the fractal spectrum and transform to spatial domain + Hfrac = np.divide(H, fraction) +- fsurf = pyfftw.interfaces.numpy_fft.ifft2(Hfrac) ++ fsurf = ifft2(Hfrac) + fsurf = np.abs(fsurf).astype(np.float32) + fsurf -= np.mean(fsurf) + +@@ -129,7 +140,7 @@ def fractal_surface_atmos(shape=(128, 128), resolution=60., p0=1., freq0=1e-3, + + # scale the spectrum to match the input power spectral density. + Hfrac *= np.sqrt(p0/p1) +- fsurf = pyfftw.interfaces.numpy_fft.ifft2(Hfrac) ++ fsurf = ifft2(Hfrac) + fsurf = np.abs(fsurf).astype(np.float32) + fsurf -= np.mean(fsurf) + return fsurf +@@ -162,8 +173,8 @@ def get_power_spectral_density(data, resolution=60., freq0=1e-3, display=False, + N = data.shape[0] + + # calculate the normalized power spectrum (spectral density) +- fdata2d = pyfftw.interfaces.numpy_fft.fft2(data) +- fdata2d = pyfftw.interfaces.numpy_fft.fftshift(fdata2d) ++ fdata2d = fft2(data) ++ fdata2d = fftshift(fdata2d) + psd2d = np.abs(np.multiply(fdata2d, np.conj(fdata2d))) / (N**2) + + # The frequency coordinate in cycle / m View it on GitLab: https://salsa.debian.org/debian-gis-team/mintpy/-/commit/eea5cb5991833aa1cd7bac73490dfd928b8f4395 -- View it on GitLab: https://salsa.debian.org/debian-gis-team/mintpy/-/commit/eea5cb5991833aa1cd7bac73490dfd928b8f4395 You're receiving this email because of your account on salsa.debian.org.
_______________________________________________ Pkg-grass-devel mailing list [email protected] https://alioth-lists.debian.net/cgi-bin/mailman/listinfo/pkg-grass-devel
