Giter Site home page Giter Site logo

mabelcalim / waipy Goto Github PK

View Code? Open in Web Editor NEW
78.0 78.0 48.0 103.73 MB

This guide includes a Continuous Wavelet Transform (CWT), significance tests from based on Torrence and Compo (1998) and Cross Wavelet Analysis (CWA) based on Maraun and Kurths(2004).

Home Page: https://wavelet-analysis.readthedocs.org/en/latest/index.html

License: BSD 3-Clause "New" or "Revised" License

Python 6.32% CSS 2.62% JavaScript 6.49% Jupyter Notebook 55.82% Makefile 0.45% HTML 28.30%

waipy's People

Contributors

m-weigand avatar mabelcalim avatar spid3rz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

waipy's Issues

Waipy

Hello everyone

I'm having trouble installing the waipy package and running examples can not configure them. what to do?



IndexError Traceback (most recent call last)
in ()
----> 1 result = waipy.cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, 0.72, 6, mother='Morlet',name='x')

/home/bruno/anaconda2/lib/python2.7/site-packages/waipy-0.0.9.0-py2.7.egg/waipy/cwt/wavetest.pyc in cwt(data, dt, pad, dj, s0, j1, lag1, param, mother, name)
86 # Wavelet transform
87 ondaleta, wave, period, scale, coi, f = lib_wavelet.wavelet(
---> 88 data, dt, param, dj, s0, j1, mother)
89 # wave = np.array(wave)
90 power = (np.abs(wave) ** 2)

/home/bruno/anaconda2/lib/python2.7/site-packages/waipy-0.0.9.0-py2.7.egg/waipy/cwt/lib_wavelet.pyc in wavelet(Y, dt, param, dj, s0, j1, mother)
170 # delete the first value of k_neg = last value of k_pos
171 k_neg = k_neg[1:-1]
--> 172 k = np.concatenate((k_pos, k_neg), axis=1) # vector of symmetric
173 # compute fft of the padded time series
174 f = np.fft.fft(x, n)

IndexError: axis 1 out of bounds [0, 1)

Table eror

Hi,
I installed waipy using the link below.
https://github.com/mabelcalim/waipy/
But whenever I import it, I have

File "/home/beloved/anaconda/lib/python3.6/site-packages/IPython/core/interactiveshell.py", line 2862, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 1, in
import waipy

File "/home/beloved/anaconda/lib/python3.6/site-packages/waipy/init.py", line 10, in
from .cwt.lib_wavelet import nextpow2

File "/home/beloved/anaconda/lib/python3.6/site-packages/waipy/cwt/lib_wavelet.py", line 48
"""CAUTION : default values"""
^
TabError: inconsistent use of tabs and spaces in indentation

I have traced my error but I have not been successful so far

Waipy import error

When I wrote import waipy, I get the following error:
Traceback (most recent call last):
File "C:\Users\acer\Anaconda3\lib\site-packages\IPython\core\interactiveshell.py", line 3296, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in

Error in sematic version number

__version__ = '0.0.1.51'

@mabelcalim Could you change this to from '0.0.1.51' to '0.1.51'? Pip (and perhaps the tool used to mirror waipy on PyPi?) are getting confused an think that the current version '0.0.1.51' is older than '0.0.9.0' as 9 > 1.

This is indirectly leads to this issue as pip install waipy installs 0.0.9.0 which throw an indentation error on import waipy.

TabError: inconsistent use of tabs and spaces in indentation

After I installed waipy by following what was written in the readme file, I tried to import it but I got this error :

`$ python
Python 3.6.5 |Anaconda custom (64-bit)| (default, Mar 29 2018, 18:21:58)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import waipy
Traceback (most recent call last):
File "", line 1, in
File "/home/hani/anaconda3/lib/python3.6/site-packages/waipy/init.py", line 10, in
from .cwt.lib_wavelet import nextpow2
File "/home/hani/anaconda3/lib/python3.6/site-packages/waipy/cwt/lib_wavelet.py", line 48
"""CAUTION : default values"""
^
TabError: inconsistent use of tabs and spaces in indentation
`

hhhhh

Did anyone face the same problem?

Error

Hi, I installed waipy from github, exactly the way you have described. (NO PIP)
So I execute
result = waipy.cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, alpha, 6, mother='Morlet')
and i get following error

IndexError Traceback (most recent call last)
in ()
----> 1 result = waipy.cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, alpha, 6, mother='Morlet')

/Users/nicolasf/anaconda/envs/python2/lib/python2.7/site-packages/waipy/cwt/wavetest.pyc in cwt(data, dt, pad, dj, s0, j1, lag1, param, mother)
73 # Wavelet transform
74 import lib_wavelet
---> 75 ondaleta,wave,period,scale,coi,f = lib_wavelet.wavelet(data,dt,mother,param)#,pad,dj,s0,j1,mother,param)
76 power = np.abs(wave*wave)
77 # Significance levels: (variance=1 for the normalized SST)

/Users/nicolasf/anaconda/envs/python2/lib/python2.7/site-packages/waipy/cwt/lib_wavelet.pyc in wavelet(Y, dt, mother, param)
130 k_neg = [e * (-1) for e in k_neg] # negative part
131 k_neg = k_neg[1:-1] # delete the first value of k_neg = last value of k_pos
--> 132 k = np.concatenate((k_pos,k_neg), axis =1) # vector of symmetric
133 # compute fft of the padded time series
134 f = np.fft.fft(x,n)

IndexError: axis 1 out of bounds [0, 1)

j1 parameter in wavelet()

As far as I can see the j1 parameter is

a) not used anywhere:

waipy/lib/waipy$ grep -R j1 *
cwt/wavetest.app/Contents/Resources/wavetest.py:j1 = 7/dj # this says do 7 powers-of-two with dj sub-octaves each
cwt/wavetest.app/Contents/Resources/wavetest.py:ondaleta,wave,period,scale,coi = lib_wavelet.wavelet(sst,dt,mother,param)#,pad,dj,s0,j1,mother,param)
cwt/lib_wavelet.py:def wavelet(Y, dt, param, dj, s0, j1, mother):
cwt/wavetest.py:def wavelet(Y, dt, param, dj, s0, j1, mother):
cwt/wavetest.py:def cwt(data, dt, pad, dj, s0, j1, lag1, param, mother, name):
cwt/wavetest.py: j1 = 7/dj # this says do 7 powers-of-two with dj sub-octaves each
cwt/wavetest.py: data, dt, param, dj, s0, j1, mother)
cwt/wavetest.py: 'nw': nw, 'mean_wavelet': mean_wavelet, 'dj': dj, 'j1': j1,
cwt/wavetest_2.7.py:def cwt(data, dt, pad, dj, s0, j1, lag1, param, mother, name):
cwt/wavetest_2.7.py: j1 = 7/dj # this says do 7 powers-of-two with dj sub-octaves each
cwt/wavetest_2.7.py: data, dt, param, dj, s0, j1, mother)
cwt/wavetest_2.7.py: 'nw': nw, 'mean_wavelet': mean_wavelet, 'dj': dj, 'j1': j1,

b) does not have any corresponding equation in Torrence & Compo

Can we thus remove the parameter? If this is the case I will prepare a merge request.

Power is plotted in log2

The Wavelet power plotted using the contourf function is converted to log2 before plotting. Why do we do this?

cross wavelet

could you please provide the ipynb file for cross wavelet(XWT)

one bug in waipy.cwt

i used the code example in notebook :Example 1 Sine and Waipy ,some bug attacked.
while the wavelet analysis in matlab code, there is not a name parameter?

The autoreload extension is already loaded. To reload it, use:

%reload_ext autoreload

IndexError Traceback (most recent call last)
in ()
9
10 data_norm = waipy.normalize(x)
---> 11 result = waipy.cwt(data_norm, 1, 1, 0.125, 2, 4/0.125, 0.72, 6, mother='Morlet',name='x')
12 waipy.wavelet_plot('Sine', z, data_norm, 0.03125, result)
13

C:\Anaconda2\lib\site-packages\waipy-0.0.9.0-py2.7.egg\waipy\cwt\wavetest.pyc in cwt(data, dt, pad, dj, s0, j1, lag1, param, mother, name)
86 # Wavelet transform
87 ondaleta, wave, period, scale, coi, f = lib_wavelet.wavelet(
---> 88 data, dt, param, dj, s0, j1, mother)
89 # wave = np.array(wave)
90 power = (np.abs(wave) ** 2)

C:\Anaconda2\lib\site-packages\waipy-0.0.9.0-py2.7.egg\waipy\cwt\lib_wavelet.pyc in wavelet(Y, dt, param, dj, s0, j1, mother)
170 # delete the first value of k_neg = last value of k_pos
171 k_neg = k_neg[1:-1]
--> 172 k = np.concatenate((k_pos, k_neg), axis=1) # vector of symmetric
173 # compute fft of the padded time series
174 f = np.fft.fft(x, n)

IndexError: axis 1 out of bounds [0, 1)

Provisional Fix for Windows Users!

In case you're having trouble installing waipy from the original repository, check out my fork. It fixes the issue of line endings and allows you to clone all the relevant files and run:

git clone https://github.com/akanz1/waipy
cd waipy
python setup.py install

https://github.com/akanz1/waipy

I hope this helps!

waipy Git Clone error

Cloning waipy through the CLI or with GitHub Desktop (tested on two separate Windows 10 machines) results in the following error: "fatal: cannot create directory at 'Waipy Examples /IpythonNotebook ': No such file or directory"

The same error is produced by issuing:
git checkout -f HEAD

Question

Hi,

Can this be used for NetCDF spatial data instead of point series?
If yes, please, how is the code to be modified?

Thank you.

Customize

Hi Again!
Please I want to know if it is possible to customize the axes of the plots?
Also, to plot a specific graph and not the whole graphs.
I have tried waipy.wavelet_plot? to see if there are options to customize the plots, but I found none.

Thank you.

wavetest_2.7.py and wavetest.py

As far as I can see the file wavetest_2.7 is not used anywhere in code code. I suggest to remove it to reduce redundant code.

how to change the cmap in waipy ?

Hey, its a great package . But i am unable to change cmap from viridis to jet or other. I have gone through main package script, i have made changes there but still unable to do that. please help.
thanks and regards
Akshay

wavelet coherence issue

There is some problem with the calculation of the wavelet coherence in the function cross_wavelet. When applying plot_cohere in "Example 2 random signals" as follows:

import waipy
import numpy as np

x = np.linspace(0,100,100)
y1 = np.random.rand(100)  # Generation of the Random Signal 1
y2 = np.random.rand(100)  # Generation of the Random Signal 2
#print x
data_norm = waipy.normalize(y1)
data_norm1 = waipy.normalize(y2)

result = waipy.cwt(data_norm, 1, 1, 0.25, 2, 4/0.25, 0.72, 6, mother='Morlet',name='x')
result1 = waipy.cwt(data_norm1, 1, 1, 0.25, 2, 4/0.25, 0.72, 6, mother='Morlet',name='y')

cross_power, coherence, phase_angle = waipy.cross_wavelet(result['wave'], result1['wave'])
waipy.plot_cohere('Coherence two random signals', coherence, x, result, result1)


the following plot is obtained:
coherence x vs y

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.