Giter Club home page Giter Club logo

pynaff's People

Contributors

b-riemann avatar nkarast avatar pziso avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pynaff's Issues

empty result

input is like

<class 'numpy.ndarray'> [102 106 95 92 59 89 92 107 113 109 49 88 96 53 57 107 112 109
104 44 48 42 107 59 100 40 116 113 108 114 119 91 41 51 105 106
107 95 108 81 112 45 72 46 105 110 106 110 117 102 94 59 69 91
112 106 116 100 93 112 51 107 56 104 83 44 94 52 109 87 54 112
58 96 108 111 114 112 114 105 59 45 43 103 54 57 87 112 106 106
47 90 108 45 40 106 112 90 119 80 100 56 108 107 104 57 59 103
44 106 48 107 56 52 112 107 58 50 109 100 92 112 44 96 59 49
40 91 113 109 80 111 107 47 98 102 40 44 101 40 47 103 113 58
100 48 93 108 111 114 54 102 98 105 102 43 114 98 95 59 42 53
53 112 111 52 40 107 108 115 53 99 105 100 81 114 96 104 42 109
112 102 41 104 41 103 89 114 100 106 92 92 51 43 114 96 51 100
102 46 57 51 59 42 101 110 94 111 106 112 115 99 50 108 49 46
46 66 55 114 104 88 46 49 103 102 110 111 118 46 46 106 101 55
100 88 107 47 50 106 88 45 108 105 109 100 47 92 54 104 100 45
49 108 59 107 48 51 91 93 100 93 58 57 113 111 112 102 101 57
43 93 53 109 47 80 40 56 102 100 105 106 114 107 53 98 97 113
105 115 113 111 44 97 40 40 92 98 111 112 46 116 95 103 115 110
106 119 103 100 103 106 117 103 114 40 80 46 42 109 92 102 40 111
108 115 99 53 107 97 105 93 50 46 87 100 95 95 92 91 106 42
102 95 109 111 55 97 56 56 49 56 54 47 41 84 107 100 106 104
95 55 46 57 112 116 111 111 105 47 107 103 43 48 51 44 89 88
102 91 109 54 43 98 96 109 104 114 106 95 85 54 109 98 110 40
102 100 104 113 43 44 109 104 111 106 108 54 56 58 49 98 50 58
78 40 104 100 101 112 106 31 92 100 102 116 111 98 99 43 93 108
48 109 111 47 46 52 105 45 106 45 54 46 96 103 104 104 107 113
49 42 107 113 111 109 46 53 58 41 104 105 44 118 115 113 108 105
96 94 118 96 47 103 52 109 91 110 106 105 108 41 115 113 103 59
42 51 110 112 110 113 103 41 97 89 107 46 40 48 110 105 91 107
40 106 45 43 50 104 45 39 42 98 108 113 89 40 49 48 41 108
104 118 117 114 71 99 57 55 108 116 108 111 52 50 42 48 111 109
108 101 55 106 104 110 103 112 103 101 96 104 114 106 111 107 105 40
42 44 42 89 40 108 104 109 109 99 80 93 107 117 107 113 115 85
102 58 108 113 100 112 111 118 111 109 47 55 42 46 59 106 105 97
54 48 93 107 114 104 97 107 108 117 114 108 111 112 113 105 114 111
111 101 109 100 95 98 106 59 104 92 108 99 51 92 106 115 95 94]

How to start to use PyNAFF?

Hi, Nikos!

This is the my first time to use NAFF as a tool to analyze TBT data, and at this moment I can't run the code with a small sample routine anywhere.

I simulate the TBT data using a decayed sinusoidal, which records one data each turn, so the obtained data is one-dimensional.

Below is the sample code. B.T.W., I copy the PyNAFF.py to my current directory and imported it as a module.

import numpy as np
import scipy as sp
import matplotlib.pylab as plt
import PyNAFF as pnf
#import PyNAFF.Cython.PyNAFF as cpnf

q = 2.1#tune
f0 = 1e6#revolution frequency
N = 2**11#total sample number

sample_rate=10e6
sample_time = N/sample_rate

tau = sample_time/5#decay const.

t = np.linspace(0, sample_time, N)
y = np.sin(2*np.pi*q*f0*t)*(np.exp(-t/tau))
#plt.plot(y,"b.")

turns=len(y)
result = pnf.naff(data=y, turns=turns, nterm=1, icol=1, icx=1, icy=0, saveFiles=False, doAll=False, neps=100000000., loglevel=20, logfile=None, debug=False, batch=True,
         icplx=1, iw=+1, nulin=0,  iprnaf=0, iftes=0, ifsav=0, ifcomp=0, ifres=0, ifstab=1,imodt=0, inputParamFile=None, solutionFile='track.sol',
         parametersOutLog='nafpar.par', outBuffFile='naf.out', tabFile='naf.tab')

The Exception says

Traceback (most recent call last):

  File "<ipython-input-3-47671462eba5>", line 4, in <module>
    parametersOutLog='nafpar.par', outBuffFile='naf.out', tabFile='naf.tab')

  File "E:\CSRm_BPM_data\BPM_signal_2011\naff_test\PyNAFF.py", line 1540, in naff
    raise ValueError("# PyNAFF.naff() : Number of turns [{}] exceeds the minimum required data length [{}]".format(turns, len(data+1)))

ValueError: # PyNAFF.naff() : Number of turns [2048] exceeds the minimum required data length [2048]

Regards!
Yongchun

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.