Giter VIP home page Giter VIP logo

curvelops's Introduction

curvelops

Python wrapper for CurveLab's 2D and 3D curvelet transforms. It uses the PyLops design framework to provide the forward and inverse curvelet transforms as matrix-free linear operations. If you are still confused, check out some examples below or the PyLops website!

Installation

Installing curvelops requires the following components:

Both of these packages must be installed manually. See more information below. After these are installed, you may install curvelops with:

export FFTW=/path/to/fftw
export FDCT=/path/to/CurveLab
python3 -m pip install git+https://github.com/cako/curvelops@main

as long as you are using a pip>=10.0. To check, run python3 -m pip --version.

Getting Started

For a 2D transform, you can get started with:

import numpy as np
import curvelops as cl

x = np.random.normal(0., 1., (100, 50))
FDCT = cl.FDCT2D(dims=(100, 50))
c = FDCT * x.ravel()
xinv = FDCT.H * c
assert np.allclose(x, xinv.reshape(100, 50))

An excellent place to see how to use the library is the examples/ folder. Demo_Single_Curvelet for example contains a curvelops version of the CurveLab Matlab demo.

Demo Reconstruction

Tips and Tricks for Dependencies

FFTW

For FFTW 2.1.5, you must compile with position-independent code support. Do that with

./configure --with-pic --prefix=/home/user/opt/fftw-2.1.5 --with-gcc=/usr/bin/gcc

The --prefix and --with-gcc are optional and determine where it will install FFTW and where to find the GCC compiler, respectively. We recommend using the same compile for FFTW, CurveLab and curvelops.

CurveLab

In the file makefile.opt set FFTW_DIR, CC and CXX variables as required in the instructions. To keep things consistent, set FFTW_DIR=/home/user/opt/fftw-2.1.5 (or whatever directory was used in the --prefix option). For the others, use the same compiler which was used to compile FFTW.

curvelops

The FFTW variable is the same as FFTW_DIR as provided in the CurveLab installation. The FDCT variable points to the root of the CurveLab installation. It will be something like /path/to/CurveLab-2.1.3 for the latest version.

Useful links

Disclaimer

This package contains no CurveLab code apart from function calls. It is provided to simplify the use of CurveLab in a Python environment. Please ensure you own a CurveLab license as per required by the authors. See the CurveLab website for more information. All CurveLab rights are reserved to Emmanuel Candes, Laurent Demanet, David Donoho and Lexing Ying.

curvelops's People

Contributors

cako 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.