Preprocessing

Methods for preprocessing impedance data from instrument files

impedance.preprocessing.cropFrequencies(frequencies, Z, freqmin=0, freqmax=None)[source]

Trim out all data points below the X-axis

Parameters
frequenciesnp.ndarray

Array of frequencies

Znp.ndarray of complex numbers

Array of complex impedances

freqminfloat

Minimum frequency, omit for no lower frequency limit

freqmaxfloat

Max frequency, omit for no upper frequency limit

Returns
frequencies_finalnp.ndarray

Array of frequencies after filtering

Z_finalnp.ndarray of complex numbers

Array of complex impedances after filtering

impedance.preprocessing.ignoreBelowX(frequencies, Z)[source]

Trim out all data points below the X-axis

Parameters
frequenciesnp.ndarray

Array of frequencies

Znp.ndarray of complex numbers

Array of complex impedances

Returns
frequenciesnp.ndarray

Array of frequencies after filtering

Znp.ndarray of complex numbers

Array of complex impedances after filtering

impedance.preprocessing.readAutolab(filename)[source]

function for reading comma-delimited files from Autolab

Parameters
filename: string

Filename of file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readBioLogic(filename)[source]

function for reading the .mpt file from Biologic EC-lab software

Parameters
filename: string

Filename of .mpt file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readCHInstruments(filename)[source]

function for reading the .txt file from CHInstruments

Parameters
filename: string

Filename of .txt file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readCSV(filename)[source]

function for reading plain csv files

Parameters
filename: string

Filename of .csv file to extract impedance data from where the file has three columns (frequency, Z_real, Z_imag)

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readFile(filename, instrument=None)[source]

A wrapper for reading in many common types of impedance files

Parameters
filename: string

Filename to extract impedance data from

instrument: string

Type of instrument file

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readGamry(filename)[source]

function for reading the .DTA file from Gamry

Parameters
filename: string

Filename of .DTA file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readParstat(filename)[source]

function for reading the .txt file from Parstat

Parameters
filename: string

Filename of .txt file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readPowerSuite(filename)[source]

function for reading the .txt file from PowerSuite

Parameters
filename: string

Filename of .txt file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readVersaStudio(filename)[source]

function for reading the .PAR file from VersaStudio

Parameters
filename: string

Filename of .PAR file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.readZPlot(filename)[source]

function for reading the .z file from Scribner’s ZPlot

Parameters
filename: string

Filename of .z file to extract impedance data from

Returns
frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

impedance.preprocessing.saveCSV(filename, frequencies, impedances, **kwargs)[source]

saves frequencies and impedances to a csv

Parameters
filename: string

Filename of .csv file to save impedance data to

frequenciesnp.ndarray

Array of frequencies

impedancenp.ndarray of complex numbers

Array of complex impedances

kwargs

Keyword arguments passed to np.savetxt