py4sci

Previous topic

grid

Next topic

ivcurve

This Page

analyze

Note

Functions for analyzing Langmuir output.

  1. Combine each part of a simulation with combine()
  2. Calculate the current with calculate()
  3. Extract the result with equilibrate()
  4. Average over runs with create_panel()

Module author: Adam Gagorik <adam.gagorik@gmail.com>

analyze.create_panel(frames, index=None)[source]

Turn a list of pandas.DataFrame into a pandas.Panel.

Parameters:
>>> data1 = lm.common.load_pkl('run.0/calculated.pkl.gz')
>>> data2 = lm.common.load_pkl('run.1/calculated.pkl.gz')
>>> panel = create_panel([data1, data2], index=[0, 1])
analyze.combine(objs)[source]

Combine a set of panda’s DataFrames into a single DataFrame. The idea is that each DataFrame holds data from a part of some series of data. The index of each part should be the simulation:time.

Parameters:objs (list) – list of pandas.DataFrame
>>> data1 = lm.datfile.load('part.0/out.dat.gz')
>>> data2 = lm.datfile.load('part.1/out.dat.gz')
>>> combined = lm.analyze.combine([data1, data2])
analyze.calculate(obj)[source]

Compute all flux statistics. Calculates current using, for example, the number of carriers exiting a drain.

Parameters:obj (pandas.DataFrame) – data
>>> data = lm.common.load_pkl('combined.pkl.gz')
>>> data = lm.analyze.calculate(data)
analyze.equilibrate(obj, last, equil=None)[source]

Get the difference between two steps.

Parameters:
>>> data = lm.common.load_pkl('combined.pkl.gz')
>>> data = lm.analyze.equilibrate(data, last=-1, equil=-1000)
class analyze.Stats(array, prefix='')[source]

Compute various statistics of an array like object.

Attr Description
max max
min min
rng range
avg average
std standard deviation
>>> s = Stats([1, 2, 3, 4, 5])
Parameters:array (list) – array like object
to_dict()[source]

Get summary of stats.