Coder Social home page Coder Social logo

wangyun1995 / pyfortrancwt Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 153 KB

Python wrappers of the FortranCWT codes created with f2py

Home Page: https://github.com/WangYun1995/pyFortranCWT

Fortran 46.11% Python 0.01% Jupyter Notebook 53.89%
f2py fortran95 one-dimensional python3 continuous-wavelet-transform numpy

pyfortrancwt's Introduction

pyFortranCWT

Python wrappers of the FortranCWT codes created with f2py

If you use our codes or your research is related to our paper, please kindly cite the following paper, in which the fast CWT algorithms are reviewed and compared.

@article{Wang2023,
    author = {Wang, Yun and He, Ping},
    title = "{Comparisons between fast algorithms for the continuous wavelet transform and applications in cosmology: the 1D case}",
    journal = {RAS Techniques and Instruments},
    volume = {2},
    number = {1},
    pages = {307-323},
    year = {2023},
    month = {06},
    issn = {2752-8200},
    doi = {10.1093/rasti/rzad020},
    url = {https://doi.org/10.1093/rasti/rzad020},
    eprint = {https://academic.oup.com/rasti/advance-article-pdf/doi/10.1093/rasti/rzad020/50722942/rzad020.pdf},
}

Requirements

  • FFTW3
  • Python3
  • Numpy
  • GNU Fortran 95 compiler
  • MinGW (for Windows)

Usage

  • Linux:

$:git clone  https://github.com/WangYun1995/pyFortranCWT.git
$:cd pyFortranCWT/fftcwt
$:python -m numpy.f2py -c Parameters.f95 Tools.f95 FFTCWT.f95 -I/.../fftw3/include -L/.../fftw3/lib -lfftw3 --link-fftw3 --fcompiler=gnu95 --compiler=unix --opt='-O3' -m fftcwt
$:cd ..
$:cd v97cwt
$:python -m numpy.f2py -c Parameters.f95 Tools.f95 V97CWT.f95 --fcompiler=gnu95 --compiler=unix --opt='-O3' -m v97cwt
$:cd ..
$:cd m02cwt
$:python -m numpy.f2py -c Parameters.f95 Tools.f95 M02CWT.f95 --fcompiler=gnu95 --compiler=unix --opt='-O3' -m m02cwt
$:cd ..
$:cd a19cwt
$:python -m numpy.f2py -c Parameters.f95 Tools.f95 A19CWT.f95 --fcompiler=gnu95 --compiler=unix --opt='-O3' -m a19cwt

The above commands will yield ".so" files, which can be imported in Python. Then add export PYTHONPATH="${PYTHONPATH}:/.../.../pyFortranCWT/" to your ~/.bashrc and run the following commond

$:source ~/.bashrc
  • Windows:

> git clone  https://github.com/WangYun1995/pyFortranCWT.git
> cd pyFortranCWT\fftcwt
> python -m numpy.f2py -c Parameters.f95 Tools.f95 FFTCWT.f95 -I"\...\fftw3\include" -L"\...\fftw3\lib" -lfftw3 --link-fftw3 --fcompiler=gnu95 --compiler=mingw32 --opt='-O3' -m fftcwt
> cd ..
> cd v97cwt
> python -m numpy.f2py -c Parameters.f95 Tools.f95 V97CWT.f95 --fcompiler=gnu95 --compiler=mingw32 --opt='-O3' -m v97cwt
> cd ..
> cd m02cwt
> python -m numpy.f2py -c Parameters.f95 Tools.f95 M02CWT.f95 --fcompiler=gnu95 --compiler=mingw32 --opt='-O3' -m m02cwt
> cd ..
> cd a19cwt
> python -m numpy.f2py -c Parameters.f95 Tools.f95 A19CWT.f95 --fcompiler=gnu95 --compiler=mingw32 --opt='-O3' -m a19cwt

The above commands will yield ".pyd" files, which can be imported in Python. Then add ...\...\pyFortranCWT to the PYTHONPATH. (see How to add to the PYTHONPATH in Windows)

Examples

see pyFortran_examples.ipynb for examples.

pyfortrancwt's People

Contributors

wangyun1995 avatar

Stargazers

 avatar

Watchers

 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.