Data Handling Classes¶
Introduction¶
This section includes documentation on the various data handling classes that are included in Ferro. The base class for all data classis is SampleData, which defines some common measurement parameters such as device dimensions and temperature. Derivced from this are LeakageData and HysteresisData. LeakageData is a container for I-V leakage measurement data while HysteresisData deals with P-V test data such as dynamic hysteresis, PUND, and FORC measurements.
Non-Class Functions¶
HysteresisData class with functions for reading in and plotting hysteresis data.
TODO: move TF-1000 parsing into python, auto-read thickness & freq from metadata
@author: Jackson Anderson, Rochester Institute of Technology jda4923@rit.edu
-
ferro.data.hyst_plot(data, legend=None, plot_e=False)¶ Plots V vs P, V vs I, and time vs V given hysteresis measurement data.
Parameters: - data (list) – HysteresisData objects to plot.
- legend (list) – str labels corresponding to data.
- plot_e (bool) – If True plots E instead of P.
Returns: Return type: n/a
-
ferro.data.lcm_plot(data, legend=None)¶ Plots leakage current as a function of voltage for a list of LeakageData. If parameters have been fit to data, will plot modeled leakage as well.
Parameters: - data (list) – LeakageData objects to plot
- legend (list) – Str labels corresponding to data
Returns: Return type: n/a
-
ferro.data.list_read(files, leakagefiles=None, plot=False, plot_E=False, verbose=False, **kwargs)¶ Reads in several hysteresis measurements and creates objects for them.
Parameters: - files (list) – Paths to tsv data files of hysteresis measurements
- leakagefiles (list) – Paths to leakage data for files. If none, leakage compensation is not performed.
- plot (bool) – Triggers plotting of leakage data with fit.
- kwargs (args) – Arguements to pass to HysteresisData()
Returns: data_list – HysteresisData objects created from files.
Return type: list
-
ferro.data.ncv_plot(data, legend=None, plot_e=False)¶ Plots dP/dV (capacitance) of PV data.
Parameters: - data (list) – HysteresisData objects to plot.
- legend (list) – str labels corresponding to data.
- plot_e (bool) – If True plots E instead of P.
Returns: Return type: n/a
SampleData¶
-
class
ferro.data.SampleData(thickness=1.3e-06, area=0.0001, temperature=300, sample_name='')¶
HysteresisData¶
-
class
ferro.data.HysteresisData(freq=100.0, **kwargs)¶ -
bandstop_filter(y, freqs=[50, 70], plot=False)¶ Experimental
Removes high freq noise from measurement data. Filter edge set to 2 times measurement switching frequency. Includes some code from scipy.signal.iirfilter example code.
Parameters: - y (array_like) – The data to be filtered.
- freqs (list) – The two freqs defining the edge of the bandstop filter.
- plot (bool) – If True, plots filter response
Returns: y – The filtered input data (y). Returned in time domain.
Return type: complex ndarray
-
dvdt_plot()¶ Plots abs(dvdt) of a measurement. Can be used to investigate noise in capacitance extraction.
-
fft_plot(y)¶ Takes fft of data and plots in frequency domain.
Parameters: y (np array) – Data to be plotted Returns: Return type: n/a
-
forc_calc(plot=False, linear=True, filt_iter=None, filt_dim=[1, 1])¶ Finds minima/maxima in voltage data, cuts down data to only reversal curves, interpolates data onto a linear grid using griddata, and makes contour plot for FORC measurements.
Note that griddata uses the natgrid library. If you are on windows and don’t have a visual studio c++ compiler for setup.py, pre-built wheels found at http://www.lfd.uci.edu/~gohlke/pythonlibs/#natgrid. (pip install the wheel file directly).
You can also use linear interpolation instead.
Parameters: - plot (bool) – Turns plotting of results on if set to True
- linear (bool) – Switches to linear interpolation
- filt_iter (int) – Number of rolling average filter iterations to apply to the mixed partial derivative of p.
- filt_dim (len 2 sequence of ints) – Size of filter for E & Er axes.
Returns: - uniform_e (1d np array) – E values that correspond to prob
- uniform_er (1d np array) – Er values that correspond to prob
- prob (2d numpy array) – Prob distribution of grains for given E,Er
-
hyst_plot(plot_e=False)¶ Plots V vs P, V vs I, and time vs V given hysteresis measurement data.
Parameters: plot_e (bool) – If True plots E instead of P
-
leakage_compensation(leakage_data)¶ Removes leakage current contribution from hysteresis data using model fit to lcm data.
Parameters: leakage_data (LeakageData) – Object to use in compensation. Returns: comp_data – Deep copy of self with leakage current removed. Return type: HysteresisData
-
ncv_plot(plot_e=False)¶ Plots dP/dV (capacitance) of PV data.
Parameters: plot_e (bool) – If True plots E instead of P. Returns: Return type: n/a
-
read_RTHyst(rtfiledir)¶ Imports Radiant Technologies measurement data
Parameters: rtfiledir (str) – RT file (with path) to open and parse. Stores data as the associated HysteresisData object’s attributes Returns: Return type: n/a
-
read_k4200(filename)¶ Imports xls measurement data output by the double SweepSeg routine from a Keithley 4200-SCS.
Parameters: filename (str) – xls file (with path) to open and parse. Stores data as the associated HysteresisData object’s attributes
-
time_plot()¶ Plots forced voltage and measured current vs. time on same plot
-
tsv_read(filename, col_nums={'current': 3, 'polarization': 4, 'time': 0, 'voltage': 1}, verbose=False)¶ Imports TSV measurement data previously parsed by tfDataTSV_v4.pl. For use with TF-1000 hysteresis measurement data.
Parameters: filename (str) – tsv file (with path) to open and parse. Stores data as the associated HysteresisData object’s attributes Returns: Return type: n/a
-
LeakageData¶
-
class
ferro.data.LeakageData(**kwargs)¶ -
lcm_fit(func=<function leakage_func>, init_guess=array([ 2.e-10, 2.e-10, 8.e-07, -1.e-06, 1.e-06, 0.e+00, -1.e+00]), verbose=False)¶ Attempts to fit parameters to leakage current, stores in hd object
Parameters: - func (function) – Defines eqn to be used to fit data
- init_guess (np array of appropriate length to match func) – Provides initial values for curve_fit
- verbose (bool) – If True, print calculated fit parameters and std dev
Returns: Return type: n/a
-
lcm_plot(func=<function leakage_func>)¶ Plots measured leakage current with fit data.
-
lcm_read(filename)¶ Imports TSV measurement data previously parsed by tfDataTSV_v5.pl For use with TF-1000 leakage current measurement data
Parameters: filename (str) – tsv file (with path) to open and parse. Stores data as the associated HysteresisData object’s attributes Returns: Return type: n/a
-
read_RTlkg(rtfiledir)¶ Imports Radiant Technologies measurement data
Parameters: rtfiledir (str) – RT file (with path) to open and parse. Stores data as the associated LeakageData object’s attributes Returns: Return type: n/a
-