toolbox package

toolbox.plotting module

toolbox.plotting.gaussian(x, x0, sig, amp)[source]

Formula for a Gaussian

toolbox.plotting.lorentz(x, x0, sig, amp)[source]

Formula for a Lorentzian

toolbox.plotting.plotFitHist(data, figname='fig.pdf', bins=161, rmin=2000, rmax=6000)[source]

Plot an histogramm and fit with Gaussian and Lorentzian functions

Parameters:
  • data (np.array) – Input data
  • figname (str) – Output filename of the file to save the figure
  • bins (int) – Number of equal-width bins in the given range
  • rmin (int) – max (most right-end bin edge) of the histogramm
  • rmax (int) – min (most left-end bin edge) of the histogramm
toolbox.plotting.plotHist(data, figname='fig.pdf', bins=161, rmin=2000, rmax=6000, logY=False)[source]

Plot an histogramm and save the output spectrum as a figure

Parameters:
  • data (np.array_like) – Input data
  • figname (str) – Output filename of the file to save the figure
  • bins (int) – Number of equal-width bins in the given range
  • rmin (int) – max (most right-end bin edge) of the histogramm
  • rmax (int) – min (most left-end bin edge) of the histogramm
  • logY (bool) – Allow to plot the histogram in a logarithmique scale
toolbox.plotting.plotHists(data, figname='fig.pdf', bins=161, rmin=2000, rmax=6000, logY=False, style='-')[source]

Plot multiple histograms and save the output spectrum as a figure

Parameters:
  • data (np.array_like) – Input data as multiple numpy arrays
  • figname (str) – Output filename of the file to save the figure
  • bins (int) – Number of equal-width bins in the given range
  • rmin (int) – max (most right-end bin edge) of the histogramm
  • rmax (int) – min (most left-end bin edge) of the histogramm
  • logY (bool) – Allow to plot the histogram in a logarithmique scale
  • style (str) – Plotting style, see matplotlib for more info
toolbox.plotting.saveHists(data, filebase='histo', bins=161, rmin=2000, rmax=6000, useChnEnding=False)[source]

Sort each data-set in data into histogram and save as text files

Parameters:
  • data (list of np.array_like) – Input data asa list of several numpy arrays
  • filebase (str) – Output filename base that will serve to form the output filename of each text file generated. Output file format is ASCII
  • bins (int) – Number of equal-width bins in the given range
  • rmin (int) – max (most right-end bin edge) of the histogramm
  • rmax (int) – min (most left-end bin edge) of the histogramm
  • useChnEnding (bool) – If Ture, channel ending type are inserted in the filename before the file extension. In False, an integer reprenseting the position in the input dataset is inserted instead

toolbox.utils module

toolbox.utils.disableChildOf(widget, exceptThis=None)[source]

Disable all the interactive widgets of a group/parent

Parameters:
  • widget (QtWidget name, e.g. self.widgetName) – parent/group widget name for which all members will be disabled
  • exceptThis (QtWidget name, e.g. self.widgetName) – name of the widget that remains enabled
toolbox.utils.enableChildOf(widget, exceptThis=None)[source]

Enable all the interactive widgets of a group/parent

Parameters:
  • widget (QtWidget name, e.g. self.widgetName) – parent/group widget name for which all members will be enabled
  • exceptThis (QtWidget name, e.g. self.widgetName) – name of the widget that remains disabled
toolbox.utils.pairwise(iterable)[source]

s -> (s0,s1), (s1,s2), (s2, s3), …

toolbox.utils.tripletwise(iterable)[source]

s -> (s0,s1,s2), (s1,s2,s3), (s2,s3,s4), …

toolbox.utils.unique_everseen(iterable, key=None)[source]

List unique elements, preserving order. Remember all elements ever seen.