bapsf_eigsolver.misctools

Collection of useful tools and definitions

class bapsf_eigsolver.misctools.BlockingMouseInput

Bases: object

Class that stops the program execution until mouse click(s)

callback = None
on_click(event)

Event handler to process mouse click

verbose = False
bapsf_eigsolver.misctools.Calc_radial_integral(rvec, f)

Take in a radius vector and radial profile and calculate its radial integral

bapsf_eigsolver.misctools.Cross_Correlate(x, y, L, covariance=False)

Compute the Cross Correlation between two series

class bapsf_eigsolver.misctools.DebugClass

Bases: object

Primitive debug object: print a debug message and a counter To use: call dbg() anywhere in the code, or with a message dbg(‘message’)

p(msg='')
bapsf_eigsolver.misctools.DrawRec(im, box)

Draw a rectangle on the image

bapsf_eigsolver.misctools.GetSeriesRunDirs(prefix, path)
bapsf_eigsolver.misctools.PasteImage(imlarge, imsmall, x, y)

Insert the small image into the large one at coordinates (x,y) (top left corner) Return the modified large image

class bapsf_eigsolver.misctools.Progress

Bases: object

A simple progress indicator: print a message and a percentage counter, same line. To use: create the object to start, then .update(msg=msg, percent=percentage), then .end(msg=msg) to output final time

end(msg='')
update(msg='', percent=0)
bapsf_eigsolver.misctools.Smooth_func(f, n)

Smooth a function by averaging a certain number of consecutive points

class bapsf_eigsolver.misctools.attrdict

Bases: dict

Dictionary with keys accessible as object attributes. Example: d[“key”] is equivalent to d.key, both for read and write operations.

bapsf_eigsolver.misctools.get_BOUT_FLUC_files()

Return a list of all of the BOUT_FLUC* files in the current directory

bapsf_eigsolver.misctools.plot1dir(v1, v2=None, p=0, msg='', axislabels='x')

1D plots of 1D arrays v1 (and v2 if specified)

bapsf_eigsolver.misctools.plot2dir(v1, v2=None, p=(0, 0), msg='', axislabels='xt')

1D plots of 2D arrays v1 (and v2 if specified)

bapsf_eigsolver.misctools.plot3dir(v1, v2=None, p=(0, 0, 0), msg='', axislabels='xyt')

1D plots of 3D arrays v1 (and v2 if specified)

bapsf_eigsolver.misctools.plot4dir(v1, v2=None, p=(0, 0, 0, 0), msg='', axislabels='xyzt')

1D plots of 4D arrays v1 (and v2 if specified) around the point (ix,iy,iz,it)

bapsf_eigsolver.misctools.ppcmatrix(M, digits=3)

Print a complex 2D matrix without line wrapping

bapsf_eigsolver.misctools.ppmatrix(M, digits=3, idiv=None, imod=None, trace=False)

Print a real 2D matrix without line wrapping