logParser

Classes

class logParser.NAMDLOG(logFile=None)

This class takes a NAMD output logfile as input.

getDataDistribution(keyword, binSize=50, begin=0, end=None)

This method can be used to compute the distribution of a data series without plotting it.

Parameters:
  • keyword – the column to be used to compute the distribution
  • binSize – the size of the bin. Determine the width of each rectangle of the histogram
  • begin – first frame to be used
  • end – last frame to be used + 1
Returns:

numpy 2D array containing the bin mean value (first column) and the corresponding density (second column).

getDataSeries(keywordsStr, begin=0, end=None)

This method is used to extract on or several columns from the full dataSet.

Parameters:
  • keywordStr – keywords string (example: “ELECT MISC TOTAL”) The full list can be obtained using etitle attribute
  • begin – first timestep used as start of data series
  • end – last timestep to be used + 1
Returns:

numpy 2D array containing the selected columns within given range

plotDataDistribution(keyword, binSize=50, begin=0, end=None, fit=False, model=None, p0=None)

This method takes one data series as argument, and computes the number occurences of each value within a range determined by the binSize parameter.

Parameters:
  • keyword – the column to be used to compute the distribution
  • binSize – the size of the bin. Determine the width of each rectangle of the histogram
  • begin – first frame to be used
  • end – last frame to be used + 1
  • fit – if set to True, use the given model in Scipy curve_fit method and plot it
  • model – model to be used for the fit
  • p0 – initial parameters for Scipy cure_fit
plotDataSeries(keywordsStr, xaxis='TS', begin=0, end=None, fit=False, fitIndex=0, model=None, p0=None)

This method can be used to quickly plot one or several data series.

Parameters:
  • keywordStr – keywords string (example: “ELECT MISC TOTAL”) The full list can be obtained using etitle attribute
  • xaxis – data series to be used on x-axis (default ‘TS’ for number of time steps)
  • begin – first frame to be used
  • end – last frame to be used + 1
  • fit – whether data should be fitted against a given model (using Scipy curve_fit)
  • fitIndex – if several keywords for data series are given, this allows to select which data series is to be fitted (default 0 for the first in the string)
  • model – model to be used for fitting, will be given to Scipy curve_fit
  • p0 – initial parameters for Scipy curve_fit