Impedance package

e_impedance.e_impedance

Impedance Analysis module.

class e_impedance.e_impedance.EIS(impedance, voltage: Optional[float] = None, suggested_circuit: Optional[str] = None, initial_value=None, max_rc_element: int = 50, cut_off: float = 0.85, fit_type: str = 'complex', val_low_freq: bool = True, cell_constant='n', max_iterations: int = 5, threshold_error: float = 0.009)

Bases: madap.echem.procedure.EChemProcedure

General EIS class for the analysis of the EIS data.

Parameters

EChemProcedure (cls) – Parent abstract class

analyze()

General function for performing the impedance analysis. This will fit the circuit and calculate the conductivity if is applicable.

property figure

Get the figure of the plot.

Returns

Figure object for e_impendance plot.

Return type

obj

perform_all_actions(save_dir: str, plots: list, optional_name: Optional[str] = None)

Wrapper function for executing all action

Parameters
  • save_dir (str) – Directory where the data should be saved.

  • plots (list) – List of plot types to be plotted.

plot(save_dir, plots, optional_name: Optional[str] = None)

Plot the results of the analysis.

Parameters
  • save_dir (str) – directory where to save the data

  • plots (list) – list of plot types to be plotted

  • optional_name (str, optional) – name of the file to be saved. Defaults to None.

save_data(save_dir: str, optional_name: Optional[str] = None)

Save the results of the analysis.

Parameters
  • save_dir (str) – Directory where the data should be saved.

  • optional_name (None) – Optional name for the data.

class e_impedance.e_impedance.EImpedance(frequency, real_impedance, imaginary_impedance, phase_shift=None)

Bases: object

Class for data definition that will be used during the Impedance analysis. The data includes the following: frequency, real impedance, imaginary impedance, and the phase shift. These attributes are all pandas.Series and will stay immutable except the phase shift.

frequency
imaginary_impedance
phase_shift
real_impedance
class e_impedance.e_impedance.Lissajous

Bases: madap.echem.procedure.EChemProcedure

Class for performing the Lissajous procedure.

analyze()

Abstract method for the analysis of the data.

perform_all_actions(save_dir: str, plots: list, optional_name: str)

Abstract method for the performing of all actions.

Parameters
  • save_dir (str) – The directory where the data is saved.

  • plots (list) – The plots that are saved.

  • optional_name (str) – The optional name of the data.

plot(save_dir: str, plots: list, optional_name: str)

Abstract method for the plotting of the data.

Parameters
  • save_dir (str) – The directory where the plots are saved.

  • plots (list) – The plots that are saved.

  • optional_name (str) – The optional name of the plot.

save_data(save_dir: str, optional_name: str)

Abstract method for the saving of the data.

Parameters
  • save_dir (str) – The directory where the data is saved.

  • optional_name (str) – The optional name of the data.

class e_impedance.e_impedance.Mottschotcky(impedance, suggested_circuit: Optional[str] = None, initial_value=None, max_rc_element: int = 20, cut_off: float = 0.85, fit_type: str = 'complex', val_low_freq=True)

Bases: e_impedance.e_impedance.EIS, madap.echem.procedure.EChemProcedure

Class for performing the Mottschotcky procedure.

Parameters
  • EIS (class) – General EIS class

  • EChemProcedure (class) – General abstract EChem Procedure class

analyze()

General function for performing the impedance analysis. This will fit the circuit and calculate the conductivity if is applicable.

perform_all_actions(save_dir: str, plots: list, optional_name: str)

Wrapper function for executing all action

Parameters
  • save_dir (str) – Directory where the data should be saved.

  • plots (list) – List of plot types to be plotted.

plot(save_dir: str, plots: list, optional_name: str)

Plot the results of the analysis.

Parameters
  • save_dir (str) – directory where to save the data

  • plots (list) – list of plot types to be plotted

  • optional_name (str, optional) – name of the file to be saved. Defaults to None.

save_data(save_dir: str, optional_name: str)

Save the results of the analysis.

Parameters
  • save_dir (str) – Directory where the data should be saved.

  • optional_name (None) – Optional name for the data.

e_impedance.e_impedance_plotting

Impedance Plotting module.

class e_impedance.e_impedance_plotting.ImpedancePlotting

Bases: madap.plotting.plotting.Plots

General Plotting class for Impedance method.

Parameters

Plots (class) – Parent class for plotting all methods.

bode(subplot_ax, frequency, real_impedance, imaginary_impedance, phase_shift, ax_sci_notation=None, scientific_limit=None, log_scale='x')

Defines the bode plot for raw data

Parameters
  • subplot_ax (ax) – Subplot axis

  • frequency (np.array) – Frequency array.

  • real_impedance (np.array) – Real impedance array.

  • imaginary_impedance (np.array) – Imaginary impedance array.

  • phase_shift (np.array) – Phase shift array.

  • ax_sci_notation (bool, optional) – If True, adds scientific notation to the axis. Defaults to None.

  • scientific_limit (int, optional) – If ax_sci_notation is True, defines the number of significant digits. Defaults to None.

  • log_scale (str, optional) – If ‘x’, plots the x axis in log scale. Defaults to ‘x’.

compose_eis_subplot(plots: list)

Compose the EIS subplot

Parameters

plots (list) – List of plots to be composed.

Returns

Figure and axis of the subplot.

Return type

fig, ax

nyquist(subplot_ax, frequency, real_impedance, imaginary_impedance, colorbar: bool = True, ax_sci_notation=None, scientific_limit=None, scientific_label_colorbar=False, legend_label=False, voltage: Optional[float] = None, color_map: str = 'viridis', norm_color=None)

Defines the nyquist plot for raw data

Parameters
  • subplot_ax (ax) – Subplot axis

  • frequency (np.array) – Frequency array.

  • real_impedance (np.array) – Real impedance array.

  • imaginary_impedance (np.array) – Imaginary impedance array.

  • colorbar (bool, optional) – If True, adds a colorbar. Defaults to True.

  • ax_sci_notation (bool, optional) – If True, adds scientific notation to the axis. Defaults to None.

  • scientific_limit (int, optional) – If ax_sci_notation is True, defines the number of significant digits. Defaults to None.

  • scientific_label_colorbar (bool, optional) – If True, adds scientific notation to the colorbar. Defaults to False.

  • legend_label (bool, optional) – If True, adds a legend. Defaults to False.

  • voltage (float, optional) – Voltage of the circuit. Defaults to None.

  • color_map (str, optional) – Color map. Defaults to “viridis”.

  • norm_color (bool, optional) – If True, normalizes the colorbar. Defaults to None.

nyquist_fit(subplot_ax, frequency, real_impedance, imaginary_impedance, fitted_impedance, chi, suggested_circuit, colorbar: bool = True, ax_sci_notation=None, scientific_limit: int = 3, scientific_label_colorbar=False, legend_label=False, voltage: Optional[float] = None, color_map: str = 'viridis', norm_color=None)

Defines the nyquist plot for fitted data

Parameters
  • subplot_ax (ax) – Subplot axis

  • frequency (np.array) – Frequency array.

  • real_impedance (np.array) – Real impedance array.

  • imaginary_impedance (np.array) – Imaginary impedance array.

  • fitted_impedance (np.array) – Fitted impedance array.

  • chi (float) – Chi value of the fit.

  • suggested_circuit (str) – The string definition of the suggested circuit.

  • colorbar (bool, optional) – If True, adds a colorbar. Defaults to True.

  • ax_sci_notation (bool, optional) – If True, adds scientific notation to the axis. Defaults to None.

  • scientific_limit (int, optional) – If ax_sci_notation is True, defines the number of significant digits. Defaults to None.

  • scientific_label_colorbar (bool, optional) – If True, adds scientific notation to the colorbar. Defaults to False.

  • legend_label (bool, optional) – If True, adds a legend. Defaults to False.

  • voltage (float, optional) – Voltage of the circuit. Defaults to None.

  • color_map (str, optional) – Color map. Defaults to “viridis”.

  • norm_color (bool, optional) – If True, normalizes the colorbar. Defaults to None.

residual(subplot_ax, frequency, res_real, res_imag, log_scale='x', ax_sci_notation=None, scientific_limit: int = 3)

Defines the residual plot for raw data

Parameters
  • subplot_ax (ax) – Subplot axis.

  • frequency (np.array) – Frequency array.

  • res_real (np.array) – Real residual array.

  • res_imag (np.array) – Imaginary residual array.

  • log_scale (str, optional) – If ‘x’, plots the x axis in log scale. Defaults to ‘x’.

  • ax_sci_notation (bool, optional) – If True, adds scientific notation to the axis. Defaults to None.

  • scientific_limit (int, optional) – If ax_sci_notation is True, defines the number of significant digits. Defaults to None.