Giter Site home page Giter Site logo

finufft.jl's Introduction

FINUFFT.jl

Build Status Coverage Status

This is a Julia interface to FINUFFT, a lightweight and fast nonuniform FFT (nufft) library released by the Flatiron Institute.

Installation

Julia 1.0 and up: From the Pkg REPL mode (hit ] in REPL to enter), run

add FINUFFT
test FINUFFT

This should download, build and test FINUFFT v1.1.1, as long as you have gcc and curl installed. The FFTW library is downloaded locally by the build script, using Conda.jl

Developed and tested on Linux. Also works on Max OS X, but build script is hardwired to use GCC 9 (g++-9 and gcc-9).

New:

Might now work on Windows as well. Has been tested successfully on two Windows 10 setups with TDM-GCC 9.2.0 and Julia 1.4.1. (Important: make sure that openmp for gcc is installed.).

Usage

This module provides functions nufft1d1, nufft1d2, ..., nufft3d3, nufft1d1!, nufft1d2!, ..., nufft3d3!, and finufft_default_opts that call the interface defined in https://finufft.readthedocs.io/en/latest/usage.html

A reference of the provided functions is available at https://ludvigak.github.io/FINUFFT.jl/latest/

  • Function calls mimic the C/C++ interface, with the exception that you don't need to pass the dimensions of any arrays in the argument (they are inferred using size()).
  • The functions named nufftDdN return the output array.
  • The functions named nufftDdN! take the output array as an argument. This needs to be preallocated.
  • The last argument of the nufft routines is the options struct, which is optional. Default values are used if it is omitted.
  • finufft_default_opts() returns an options struct with default values.
  • The advanced interfaces finufft2d1many and finufft2d2many have not been implemented yet.

Example

using FINUFFT

# nonuniform data
nj = 100
x = pi*(1.0 .- 2.0*rand(nj))
c = rand(nj) + 1im*rand(nj)

# Parameters
ms = 20 # Output size
tol = 1e-10 # Tolerance

# Output as return value
fk = nufft1d1(x, c, 1, tol, ms)

# Preallocate output and pass as argument
out = Array{ComplexF64}(undef, ms)
nufft1d1!(x, c, 1, tol, out)

# Call using modified opts 
opts = finufft_default_opts()
opts.debug = 1
fk2 = nufft1d1(x, c, 1, tol, ms, opts)

More examples

See test/test_nufft.jl

TODO

  • Implement advanced interface

finufft.jl's People

Contributors

jkrimmer avatar juliatagbot avatar ludvigak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.