Conductivity Module

Conductivity class

class HavNegpy.Conductivity[source]

A class to analyze real part of complex conductivity

HavNegpy.Conductivity fit function

Conductivity.jonscher_function(x, fc, DC, n)[source]

Jonscher power law function to fit the conductivity data

Parameters
  • x (float) – log frequency

  • fc (float) – onset frequency

  • DC (float) – DC conductivity value

  • n (float) – power law exponent

Returns

y – estimated log conductivity based on supplied parameters.

Return type

array

Conductivity.rbm_function(x, fc, DC)[source]

Jonscher power law function to fit the conductivity data

Parameters
  • x (float) – log frequency

  • fc (float) – onset frequency

  • DC (float) – DC conductivity value

  • n (float) – power law exponent

Returns

y – estimated log conductivity based on supplied parameters.

Return type

array

HavNegpy.Conductivity dump methods

Conductivity.dump_parameters()[source]

dumps the initial fit parameters for fit function as a dictionary in a json file to load it during curve fitting

Return type

None

HavNegpy.Conductivity methods for fitting and saving the fit results

Conductivity.create_analysis_file()[source]

Creates a file to save the fit results based on the choice of fit function

Provides option to use an existing file and creates a new file if not found

Return type

None.

Conductivity.select_range(x, y)[source]

Selects the region of interest to fit data using mplcursors allows two clicks to select the lower and upper bound of the x-axis and returns the selected x and y vaues for fitting

Returns

  • x1 (array) – log frequency

  • y1 (array) – log real part of complex conductivity

Conductivity.fit(x, y)[source]

Fits the conductivity data with choice of fit function The fit parameters are declared as global variables to be saved via save_fit function

The initial fit parameters are taken from json file and the final fit parameters are dumped in the same json file to be used for next iteration.

Parameters
  • x (array) – log frequency.

  • y (array) – log conductivity.

Returns

fit_par – dictionary containing the fit parameters.

Return type

dictionary

Conductivity.save_fit(T)[source]

saves the fit parameters of fit function in a file, the file must be created via create_analysis_file function

Parameters

T (float) – Temperature,or can also be an integer that corresponds to a file number during analysis.

Return type

None.