Python non-uniform fast Fourier transform (PyNUFFT)
Project description
PyNUFFT: Python non-uniform fast Fourier transform
A minimal "getting start" tutorial is available at http://jyhmiinlin.github.io/pynufft/ .
Installation
$ pip install pynufft --user
How to use?
Using Numpy/Scipy
$ python
Python 3.6.11 (default, Aug 23 2020, 18:05:39)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pynufft import NUFFT
>>> import numpy
>>> A = NUFFT()
>>> om = numpy.random.randn(10,2)
>>> Nd = (64,64)
>>> Kd = (128,128)
>>> Jd = (6,6)
>>> A.plan(om, Nd, Kd, Jd)
0
>>> x=numpy.random.randn(*Nd)
>>> y = A.forward(x)
Using PyCUDA
>>> from pynufft import NUFFT, helper
>>> import numpy
>>> A2= NUFFT(helper.device_list()[0])
>>> A2.device
<reikna.cluda.cuda.Device object at 0x7f9ad99923b0>
>>> om = numpy.random.randn(10,2)
>>> Nd = (64,64)
>>> Kd = (128,128)
>>> Jd = (6,6)
>>> A2.plan(om, Nd, Kd, Jd)
0
>>> x=numpy.random.randn(*Nd)
>>> y = A2.forward(x)
Testing GPU acceleration
Python 3.6.11 (default, Aug 23 2020, 18:05:39)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pynufft import tests
>>> tests.test_init(0)
device name = <reikna.cluda.cuda.Device object at 0x7f41d4098688>
0.06576069355010987
0.006289639472961426
error gx2= 2.0638987e-07
error gy= 1.0912560261408778e-07
acceleration= 10.455399523742015
17.97926664352417 2.710083246231079
acceleration in solver= 6.634211944790991
Contact information
email: pynufft@gamil.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pynufft-2020.2.3rc1.tar.gz
(11.1 MB
view hashes)
Built Distribution
Close
Hashes for pynufft-2020.2.3rc1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a9f9318c9dbd5f783c22203aaf5453c2c06026cb6e280c5f0fc69cdb15641b8 |
|
MD5 | 6a4759b709558c9771f9355996d9d3c4 |
|
BLAKE2b-256 | 27bc2b867e452354fd53f4d837a83398955e1d12ec5363478e023940d273d6ee |