Modulus Module

Modulus class

class HavNegpy.Modulus[source]

A class to analyze imaginary part of complex electric modulus

HavNegpy.Modulus fit function

Modulus.modulus_function(x, b, mm, fm)[source]

Strechted exponential modulus function to fit the electrical modulus data

Parameters
  • x (float) – log frequency

  • b (float) – strechted exponent

  • mm (float) – Modulus maximum

  • fm (float) – frequency maximum

Returns

y – estimated log conductivity based on supplied parameters.

Return type

array

HavNegpy.Modulus dump methods

Modulus.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.Modulus methods for fitting and saving the fit results

Modulus.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.

Modulus.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

Modulus.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.

Return type

None.

Modulus.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.