Skip to content
/ mtspec Public
forked from krischer/mtspec

Python Bindings for multitaper "mtspec" f90 Library by German A. Prieto

Notifications You must be signed in to change notification settings

mbyt/mtspec

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtspec - Python Bindings for multitaper "mtspec" f90 Library by German A. Prieto

We are currently in the process of moving the project to GitHub. It was originally hosted at https://svn.geophysik.uni-muenchen.de/trac/mtspecpy/wiki.

About mtspec

mtspec is a Python (ctypes) wrapper for the Multitaper Spectrum Estimation Library mwlib.a by Germán A. Prieto.

Prieto, G. A., R. L. Parker, F. L. Vernon. (2009),
A Fortran 90 library for multitaper spectrum analysis,
Computers and Geosciences, 35, pp. 1701-1710.
doi:10.1016/ j.cageo.2008.06.007

It currently wraps version 3.1 of the library. This is mainly due to later versions using FFTW which would introduce additional dependency.

The following methods are currently wrapped:

  • mtspec: Wrapper method for the mtspec subroutine.
  • sine_psd: Wrapper method for the sine_psd subroutine.
  • wigner_ville_spectrum: Wrapper method of the modified wv_spec (wv_spec_to_array) subroutine.
  • mt_coherence: Construct the coherence spectrum from the yk’s and the weights of the usual multitaper spectrum estimation.
  • dpss: Wrapper method for the dpss subroutine in the library.

Documentation and Tutorial

The documentation can be found here, together with a short tutorial.

Installation

  • Currently runs on Linux (32 and 64bit), Mac (32 and 64bit) and Windows (only 32bit).
  • Dependencies: numpy, distribute, gfortran (not necessary for win32)

After cloning the repository, run either of the following two commands to install it via easy_install or pip, respectively:

python setup.py install
    or
pip install .

Running the tests

Running the tests is a simple case of

python -m mtspec.tests

Notes

In case you get the error message "Internal Error: printf is broken" you can use the following workaround:

export LC_ALL=C
python script.py

This is a known gfortran bug, see the bottom of http://projects.scipy.org/scipy/ticket/696 for an explanation.

About

Python Bindings for multitaper "mtspec" f90 Library by German A. Prieto

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Fortran 84.0%
  • Python 7.1%
  • JavaScript 5.3%
  • Racket 2.3%
  • MATLAB 1.3%