Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mtspec() : ability to return significant peaks list #9

Open
zefijsd opened this issue Jun 9, 2015 · 1 comment
Open

mtspec() : ability to return significant peaks list #9

zefijsd opened this issue Jun 9, 2015 · 1 comment

Comments

@zefijsd
Copy link

zefijsd commented Jun 9, 2015

When using mtspec function with verbose=True, we see the following in console log :

...
 Line components   0.16329378925331473        15.1595049      0.986415267    
 Line components   0.16922540125610605        8.93782330      0.966565251    
 Line components   0.17759944173063502        11.3823347      0.977664471    
 Line components   0.23237962316817862        7.35149050      0.954259753    
 Line components   0.24982554082344730        7.67269707      0.957247198    
 Line components   0.25401256106071179        9.99182796      0.972184360    
 Line components   0.26238660153524074        8.30199242      0.962310731    
 Line components   0.26308443824145150        20.6504021      0.992203355 
...

Where The first column is the freq, the second one the amplitude, and the third one the significance of the peak.
Is there a way to get this list returned from mtspec function call instead of logging it out ?

Actually, in order to get this, we have to do something like the following

import pandas as pd
from scipy.stats import percentileofscore as pcos
spec, freq, jack, stats, _ = mtspec(data, 1, 2, statistics=True, fcrit=0.9, rshape=0, verbose=True)
df = pd.DataFrame({'freq':freq, 'spec':spec, 'stats': stats, 'sig':[pcos(stats, x) for x in stats]})
df[df['sig'] > 90].sort('freq')
@krischer
Copy link
Owner

I guess one would have to modify the fortran code a bit for that to work. Feel free to give it a shot. It should not be too hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants