diff --git a/README.md b/README.md index de980114f2e09d141fb8a2f277fa18c71eef8a98..03362f7ae47bec62548b3cb067cf516a3ad225ac 100755 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +## Current build status +[](https://pypi.org/project/pyrost/) +[](https://robust-speckle-tracking.readthedocs.io/en/latest/?badge=latest) + # pyrost Python Robust Speckle Tracking (**pyrost**) is a library for wavefront metrology and sample imaging based on ptychographic speckle tracking algorithm. This @@ -15,7 +19,6 @@ The documentation can be found on [Read the Docs](https://robust-speckle-trackin - [h5py](https://www.h5py.org) 2.10.0 or later. - [NumPy](https://numpy.org) 1.19.0 or later. - [SciPy](https://scipy.org) 1.5.2 or later. -- [pyFFTW](https://github.com/pyFFTW/pyFFTW) 0.12.0 or later. ## Installation We recommend **not** building from source, but install the release from [pypi](https://test.pypi.org/project/rst/) diff --git a/docs/conf.py b/docs/conf.py index 3873f34cb76c8432bdadf488b52173f18b073ac9..6e4cee92c829c941ed938ac3043a10b5dd4a14d9 100755 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ copyright = '2020, Nikolay Ivanov' author = 'Nikolay Ivanov' # The full version, including alpha/beta/rc tags -release = '0.1.0' +release = '0.1.1' # -- General configuration --------------------------------------------------- diff --git a/docs/install.rst b/docs/install.rst old mode 100644 new mode 100755 index 3f4abe083748bd9e5bc6419ac1d3f5eaf15dd7db..9f52fccabec05516c9cb078b951b5db7ab9e80b5 --- a/docs/install.rst +++ b/docs/install.rst @@ -16,12 +16,10 @@ pyrost has the following **mandatory** runtime dependencies: CXI files. * `NumPy <https://numpy.org>`_ 1.19.0 or later. * `SciPy <https://scipy.org>`_ 1.5.2 or later. -* `pyFFTW <https://github.com/pyFFTW/pyFFTW>`_ 0.12.0 or later, which is used - for the Fourier Transform wavefront reconstruction (:func:`pyrost.bin.ct_integrate`). Packages -------- -pyrost packages are available through `pypi <https://test.pypi.org/project/rst/>`_ on +pyrost packages are available through `pypi <https://pypi.org/project/pyrost/>`_ on OS X as for now. pip diff --git a/docs/rtd_environment.yml b/docs/rtd_environment.yml old mode 100644 new mode 100755 index 7ac27455e001087ad9a9bc6566698bb580f18bcf..f7714abcca1aa7fb1cf7020249c51bf5d285bfbc --- a/docs/rtd_environment.yml +++ b/docs/rtd_environment.yml @@ -15,5 +15,4 @@ dependencies: - sphinx - sphinx_rtd_theme - mock - - pillow - - pyfftw \ No newline at end of file + - pillow \ No newline at end of file diff --git a/environment.yml b/environment.yml old mode 100644 new mode 100755 index 17be69909663ffcccc80a77f7a0497f31d4e0a7f..1dbb1ed917d2453507d66be6ae3fef694ce1da9d --- a/environment.yml +++ b/environment.yml @@ -10,5 +10,4 @@ dependencies: - llvm-openmp - h5py - numpy - - scipy - - pyfftw \ No newline at end of file + - scipy \ No newline at end of file diff --git a/pyrost/bin/st_utils.pyx b/pyrost/bin/st_utils.pyx index 564ea94906d671ca312bad60d778021e49012d8f..d141dccd0e86f327df6c50fdea5021aea38b3f35 100755 --- a/pyrost/bin/st_utils.pyx +++ b/pyrost/bin/st_utils.pyx @@ -5,7 +5,6 @@ from libc.math cimport sqrt, exp, pi, floor from cython.parallel import prange cimport openmp from posix.time cimport clock_gettime, timespec, CLOCK_REALTIME -from pyfftw import FFTW, empty_aligned ctypedef fused float_t: np.float64_t @@ -631,12 +630,9 @@ def ct_integrate(float_t[:, ::1] sx_arr, float_t[:, ::1] sy_arr): dtype = np.float64 if float_t is np.float64_t else np.float32 cdef: int a = sx_arr.shape[0], b = sx_arr.shape[1], i, j, ii, jj + float_t[:, ::1] s_asdi = np.empty((2 * a, 2 * b), dtype=dtype) + complex_t[:, ::1] sf_asdi = np.empty((2 * a, 2 * b), dtype=np.complex128) float_t xf, yf - np.ndarray[np.complex128_t, ndim=2] s_asdi = empty_aligned((2 * a, 2 * b), dtype='complex128') - np.ndarray[np.complex128_t, ndim=2] sf_asdi = empty_aligned((2 * a, 2 * b), dtype='complex128') - np.ndarray[np.complex128_t, ndim=2] w_asdi = empty_aligned((2 * a, 2 * b), dtype='complex128') - fft_obj = FFTW(s_asdi, sf_asdi, axes=(0, 1)) - ifft_obj = FFTW(sf_asdi, w_asdi, axes=(0, 1), direction='FFTW_BACKWARD') for i in range(a): for j in range(b): s_asdi[i, j] = -sx_arr[a - i - 1, b - j - 1] @@ -649,7 +645,7 @@ def ct_integrate(float_t[:, ::1] sx_arr, float_t[:, ::1] sy_arr): for i in range(a): for j in range(b): s_asdi[i + a, j + b] = sx_arr[i, j] - cdef np.ndarray[np.complex128_t, ndim=2] sfx_asdi = fft_obj().copy() + cdef np.ndarray[np.complex128_t, ndim=2] sfx_asdi = np.fft.fft2(s_asdi) for i in range(a): for j in range(b): s_asdi[i, j] = -sy_arr[a - i - 1, b - j - 1] @@ -662,12 +658,11 @@ def ct_integrate(float_t[:, ::1] sx_arr, float_t[:, ::1] sy_arr): for i in range(a): for j in range(b): s_asdi[i + a, j + b] = sy_arr[i, j] - cdef np.ndarray[np.complex128_t, ndim=2] sfy_asdi = fft_obj().copy() + cdef np.ndarray[np.complex128_t, ndim=2] sfy_asdi = np.fft.fft2(s_asdi) for i in range(2 * a): xf = <float_t>(i) / 2 / a - i // a for j in range(2 * b): yf = <float_t>(j) / 2 / b - j // b sf_asdi[i, j] = (xf * sfx_asdi[i, j] + yf * sfy_asdi[i, j]) / (2j * pi * (xf**2 + yf**2)) sf_asdi[0, 0] = 0 - ifft_obj() - return np.asarray(w_asdi.real[a:, b:], dtype=dtype) + return np.asarray(np.fft.ifft2(sf_asdi).real[a:, b:], dtype=dtype) diff --git a/requirements.txt b/requirements.txt old mode 100644 new mode 100755 index 0e426768e147f30cfbd4fa638d0fbc55c750a4ae..2a3e40622d4bf739300cb58d3f41c6f7bb657ac4 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,4 @@ Cython>=0.29.21 CythonGSL>=0.2.2 h5py>=2.10.0 numpy>=1.19.0 -scipy>=1.5.2 -pyfftw>=0.12.0 \ No newline at end of file +scipy>=1.5.2 \ No newline at end of file diff --git a/setup.py b/setup.py index 6ba748b6f54a5e3da6e7d9b9fbc4e905c47207f6..49a0cbe63f7f7b5a2b7c394498f9553cc3f37852 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ with open('README.md', 'r') as readme: long_description = readme.read() setup(name='pyrost', - version='0.1.0', + version='0.1.1', author='Nikolay Ivanov', author_email="nikolay.ivanov@desy.de", long_description=long_description,