py4sci

Previous topic

analyze

Next topic

plot

This Page

ivcurve

Note

Functions for analyzing current voltage data.

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

class ivcurve.IVCurve(i, v, a, ierr=None)[source]

A class to analyze IV curves.

Attr Description
i current
v voltage
p power
a area
j current density
r irradiance

See also

IVCurveSolar

Construct IV curve.

Parameters:
>>> v = np.linspace(0, 100, 10)
>>> i = np.tanh(v)
>>> a = 1024 * 256
>>> ivcurve = lm.ivcurve.IVCurve(i, v, a)
classmethod from_dataframe(frame)[source]

Construct IV curve from pandas DataFrame.

Parameters:frame (pandas.DataFrame) – dataframe object
>>> frame = lm.common.load_pkl('calculated.pkl.gz')
>>> ivcurve = lm.ivcurve.IVCurve(frame)
classmethod from_panel(panel)[source]

Construct IV curve from pandas Panel.

Parameters:panel (pandas.Panel) – panel object
>>> pkls = lm.find.pkls('.', stub='gathered*', r=True)
>>> panel = lm.analyze.create_panel(lm.common.load_pkls(pkls))
>>> ivcurve = lm.ivcurve.IVCurve.from_panel(panel)
classmethod load_pkl(pkl)[source]

Construct IV curve from pkl file.

Parameters:pkl (str) – name of file
>>> ivcurve = lm.ivcurve.IVCurve.load_pkl('gathered.pkl.gz')
classmethod load_pkls(pkls)[source]

Construct IV curve from a list of pkl files.

Parameters:pkls (list) – list of filenames.
>>> pkls = lm.find.pkls('.', stub='gathered*', r=True)
>>> ivcurve = lm.ivcurve.IVCurve.load_pkls(pkls)
to_dict()[source]

Get data as dict.

to_dataframe()[source]

Convert data into a pandas.DataFrame

save_csv(handle, **kwargs)[source]

Save data to a CSV file.

Parameters:handle (str) – filename
summary()[source]

Get summary of all calculated results as a dictionary.

to_series()[source]

Convert data into a pandas.Series

save_pkl(handle)[source]

Save results and data to a PKL file.

Parameters:handle (str) – filename
class ivcurve.IVCurveSolar(i, v, a, ierr=None, v_shift=1.5, **kwargs)[source]

A class to analyze IV curves for solar cells. Calculates the fill factor.

Attr Description
v_oc open circuit voltage
v_mp voltage at max power
i_sc short circuit current
i_mp current at max power
p_th theoretical power
p_mp max power
fill fill factor

Construct IV curve. See arguments for IVCurve.

Parameters:v_shift (float) – amount to shift voltage axis by
>>> v = np.linspace(0, 100, 10)
>>> i = np.tanh(v)
>>> a = 1024 * 256
>>> ivcurve = lm.ivcurve.IVCurveSolar(i, v, a)
summary()[source]

Get summary of all calculated results as a dictionary.

calculate(mode='interp1d', recycle=False, guess=None, **kwargs)[source]

Calculate fill factor. kwargs are passed to fitting functions.

Parameters:
  • mode (str) – fitting mode (tanh, power, interp1d, spline, erf)
  • recycle (bool) – recycle fit parameters when guessing
  • guess (float) – guess for v_oc (default=shift)
Mode Option
power order=8
tanh  
erf  
interp1d kind=’cubic’
spline k=5
>>> ivcurve = lm.ivcurve.IVCurve.load_pkl('gathered.pkl.gz')
>>> ivcurve.calculate(mode='interp1d', kind='linear')
>>> print ivcurve.fill