Contents:
Bunch Analyzer v0.6.0
BunchAnalyzer is a data analyzer for particle simulations. It gives access to efficient analytic tools written in python implementing libraries such as Numpy and Scipy Some of the tools contain the ability to redefine axes, however this is not fully supported yet, localMax and localMin return new axes, which are so far only supported by some primitive plotting functions
To use main functions: “import BunchAnalyzer.Bunches” or “from BunchAnalyzer import *” then use Bunches.<function>
There are known bugs on linux with segmentFFT, this is still alpha.
Converts generator array to array of python arrays
Converts generator array to array of numpy arrays
Returns an array of peaks for each segmented fft entry in the dataset
Returns difference between peak values between bunches by segment
Returns difference between peak values between segments by bunch
Returns the x highest values in each item in the dataset returns dictionary {value:xpos}
Makes new data set with only values wherein each adjacent value is greater than or equal to the value returns new data set and appropriate axes
Makes new data set with only values wherein each adjacent value is less than or equal to the value returns new data set and appropriate axes
Makes new data set with only values wherein each adjacent value is less than or equal to the value returns new data set and appropriate axes
Parses a bunch.dat file, returns a generator array. WARNING: Generators can only be read once, for repeated use convert to another format - See convertToNumpyArray and convertTo2DArray
Parses a bunch.dat file, returns a generator array. WARNING: Generators can only be read once, for repeated use convert to another format - See convertToNumpyArray and convertTo2DArray
Parses data using parseBunchDataByTurn and converts generators to Numpy/2D arrays
Plot all types of plots for all data: Normal, Log, FFT
Plots FFT Segments. booleans: absFFT = abs(FFT)? normalizeFFTAxis = 0-1.0? segPlots = fft for same segment (in dataset) on same plot?
Plot all items, use pyplot.show() to display
Plot fast fourier transform of all items, use pyplot.show() to display
Plot fast fourier transform of all items, use pyplot.show() to display
Plot all items on a log scale, use pyplot.show() to display
Plots the normal plot, FFT real and FFT imaginary
Cuts data array into segments, returns array of array of (axis,data) tuples for each segment for each dataset example return: two datasets segmented in 2 pieces: [ [(x,y),(x,y)], [(x,y),(x,y)] ] segmentEnds overrides segments
Breaks data into defined segments and applies seperate FFT to each
The single bunch module is used for analyzing files containing information about a single bunch of particles. The output files from bin/multibunch are often of the form bunchXXX.dat
Reads a bunch’s file and converts each of the columns to an array, creates an array of Column objects filename: path and name of file to be read headerLine: line to start reading files, contain unique names of column information separated by whitespace (start at 0) numpyArrays: convert python arrays to numpy
Plots the fft for eah column in a bunch file as a separate subplot
Plots and displays each column of a bunch file as a separate subplot
Plots each column for the bunch but does not show all the figures
Creates png plots for each /bunchXXX.dat file
This is a Dynamic Modal Decomposition Library made to extract modes from functions and datasets The primary functions for this are “decomposeFunction” for a lambda and “decompose” for a dataset Currently the implementation will decompose the modes and find the amplitude, damping coefficient, and frequency of each mode, however cannot yet determine the phase shift. This library is for use on modes of the form A * e^(-Bt) * sin(Ct + d)
Decomposes parsedData into tables of mode data for each dataset. Requires parsedData: [ [dataset],[dataset],[dataset] ]; delta_t: time between readings; modeIndices: indices for modes returns array of [amplitudes, frequencies, dampings] of each mode for each dataset.
Returns Amplitudes, Frequencies, and Damping coefficients for all modes in provided data
Makes height by width matrix from array of values returns numpy array with arrays as columns
Makes a matrix from values with height as close to h as possible If errors occur try removing one or two values so as to avoid a prime number of entries or an otherwise oddly divisible number
Makes most square matrix possible given vectors vectors = [ [...],[...],[...] ]
Takes parsed data, array of mode indices (i.e. [0,1] ), and the delta t between values returns modes, ritz values, and mode norms for each dataset. modeIndices can be either an array of numbers to be applied to all datasets, or an array of arrays wherein each item corresponds to a dataset (at the same index) in segmentedData.
IntegralDecomposition
Decomposes the data of y values with delta_t between them and yields successive weighted Bessel functions. data is an array of y_vals delta_x is a real number greater than 0 (and is the x difference between values in data) x is a sympy expression a is the order of the Bessel function n_max is the maximum number of products the generator will produce, -1 for infinite Returns: a generator which creates each successive term in f(x)
Decomposes a function f(x) (defined 0 to b) using the variable x f(x) ~ Sum(cn * J(u*x/b) from n=0 to oo See: http://en.wikipedia.org/wiki/Fourier%E2%80%93Bessel_series f,b,x are sympy expressions Returns: a generator which creates each successive term in f(x)
Decomposes a function f(x) (defined 0 to b inclusive) using variable x Generates numerical answers. Often only solution if integral is impossible to compute in literal form. f is a lambda function, generator, or sympy expression b is a real number greater than 0 delta_x is a real number greater than 0 x is a sympy variable a is the order of the desired Bessel Function, default=1 Returns: a generator which creates each successive term in f(x)
An iterative wrapper for lambdas and generators stop<start for infinite series (unless generator runs out of values)
Returns J_an defined up to b for a variable x
Returns up to n indices in order of ‘sharpness’
Can use generators, lambdas, and sympy expressions returns <f,g>_w between start and stop for f(x) and g(x) if g is a sympy expression, performs integral f(x)g(x)w(x) dx if g is a lambda or list performs integral f(x)g(x)w(x) for each value calculates with resolution of delta_x (default 1)6
Plots a function and its FFT
Plots two functions f(x) and g(x) side by side, generates data from start to stop in delta_x increments
A plotting storage object, meant to facilitate interaction with the matplotlib plotting library