pyvisco.load

Collection of functions to load measurement data and prepare pandas dataframes for further processing.

Functions

Eplexor_master(data, modul)

Load master curve data from an EPLEXOR excel file.

Eplexor_raw(data, modul)

Load raw measurement data from an EPLEXOR Excel file.

check_units(units[, modul])

Check that the input file units conform with the conventions used in this modul.

conventions(modul)

Create dictionary with unit conventions for expected physical quantities.

file(path)

Read data from file.

get_sets(df_raw[, num])

Group raw data into measurement sets conducted at the same temperature.

get_units(units, modul, domain[, Eplexor])

Get the physical units based on the measurement data loading condition (tensile or shear) and domain (time or frequency).

prep_csv(data)

Load csv files into pandas dataframe and prepare data.

prep_excel(data)

Load Excel files into pandas dataframe and prepare data.

user_master(data, domain, RefT, modul)

Load master curve data from csv file.

user_raw(data, domain, modul)

Load raw measurement data from csv file.

user_shift(data_shift)

Load user provided shift factors from csv file.

pyvisco.load.conventions(modul)

Create dictionary with unit conventions for expected physical quantities.

Parameters:

modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

Returns:

conv – Contains the names of the physical quantities as key and the corresponding names of the units as item.

Return type:

dict of {str : str}

Notes

Tensile moduli are denoted as E and shear moduli are denoted as G. Only the tensile moduli are summarized in the table below. For shear modulus data, replace E with G, e.g. E_relax -> G_relax.

Physical quantity

Variable

Unit

Relaxation modulus:

E_relax

[Pa, kPa, MPa, GPa]

Storage modulus:

E_stor

[Pa, kPa, MPa, GPa]

Loss modulus:

E_loss

[Pa, kPa, MPa, GPa]

Complex modulus:

E_comp

[Pa, kPa, MPa, GPa]

Loss factor:

tan_del

-

Instantaneous modulus:

E_0

[Pa, kPa, MPa, GPa]

Equilibrium modulus:

E_inf

[Pa, kPa, MPa, GPa]

Angular frequency:

omega

rad/s

Frequency:

f

Hz

Time:

t

s

Temperature:

T

°C

Relaxation times:

tau_i

s

Relaxation moduli:

E_i

[Pa, kPa, MPa, GPa]

Norm. relaxation moduli:

alpha_i

-

Shift factor:

log_aT

-

pyvisco.load.file(path)

Read data from file.

Parameters:

path (str) – Filepath to the file that is being read.

Returns:

data – File content.

Return type:

bytes

Notes

This function is included to simplify the file upload within the interactive module where graphical dashboards are hosted on a webserver.

pyvisco.load.prep_csv(data)

Load csv files into pandas dataframe and prepare data.

The function removes NANs from the input data, and identifies the names of the pysical quantities and units from the file header. The file header must consit of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit.

Parameters:

data (bytes) – CSV file content to be loaded into a pandas.DataFrame.

Returns:

  • df (pandas.DataFrame) – Contains the csv file data.

  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

See also

load.file

Returns bytes object to be used as input parameter data.

pyvisco.load.prep_excel(data)

Load Excel files into pandas dataframe and prepare data.

The function removes NANs from the input data, and identifies the names of the pysical quantities and units from the file header. The file header must consit of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit.

Parameters:

data (bytes) – Excel file content to be loaded into a pandas.DataFrame.

Returns:

  • df (pandas.DataFrame) – Contains the Excel file data.

  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

See also

load.file

Returns bytes object to be used as input parameter data.

pyvisco.load.Eplexor_raw(data, modul)

Load raw measurement data from an EPLEXOR Excel file.

This function loads raw Dynamic Mechanical Thermal Analysis (DMTA) measurement files created by a Netzsch Gabo DMA EPLEXOR. Use the Excel Export! feature of the Eplexor software with the default template to create the Excel file. The column headers are renamed to follow the conventions used in this modul. The names of the physical quantities and units are checked against the conventions used in this module. the individual measurements at different temperatures are grouped into data sets based on the frequency range of the individual measurement sets.

Parameters:
  • data (bytes) – Excel file content loaded into pandas.DataFrame.

  • modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

Returns:

  • df_raw (pandas.DataFrame) – Contains the processed raw measurement data.

  • arr_RefT (pandas.Series) – Contains the temperature levels of the measurement sets.

  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

Raises:

KeyError – If the file header variable names or units do not follow the conventions used in this module.

See also

load.conventions

Summarizes conventions for variable names and units.

load.file

Returns bytes object to be used as parameter data.

load.check_units

Raises KeyError if units don’t comply with conventions.

pyvisco.load.user_raw(data, domain, modul)

Load raw measurement data from csv file.

This function loads raw data of viscoelastic material characterizations conducted at one or more temperature levels. Either tensile or shear modulus data from characterizations performed in either the frequency or time domain are accepted. The file header must consit of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit. The column headers are checked against the conventions used in this modul. Details on the variable names, units, and file header names are provided in the Notes section below.

Parameters:
  • data (bytes) – Excel file content.

  • domain ({'freq', 'time'}) – Defines wether frequency domain (freq) or time domain (time) input data are provided.

  • modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

Returns:

  • df_raw (pandas.DataFrame) – Contains the preprocessed raw measurement data.

  • arr_RefT (pandas.Series) – Contains the temperature levels of the measurement sets.

  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

Raises:

KeyError – If the file header variable names or units do not follow the conventions used in this module.

See also

load.conventions

Summarizes conventions for variable names and units.

load.file

Returns bytes object to be used as parameter data.

load.check_units

Raises KeyError if units don’t comply with conventions.

Notes

Dependent on the performed material characterization, either tensile or shear modulus values in either the time or frequency domain must be provided.

Tensile moduli are denoted as E and shear moduli are denoted as G. Frequency domain data are provided in Hertz: [f] = Hz Time domain data are provided in seconds: [t] = s Temperature levels are provided in Celsius: [T] = C Measurement set identifiers are provided by the column Set. In Set, all measurement points at the same temperature level are marked with the same number, e.g. 0, for the first measurement set. The first measurement Set (0) represents the coldest temperature followed by the second set (1) at the next higher temperature level and so forth.

Example input files can be found here: (TBD)

Various examples for file headers:

Domain

Row

Tensile Modulus

Shear Modulus

Frequency

1

f, E_stor, E_loss, T, Set

f, G_stor, G_loss, T, Set

Frequency

2

Hz, MPa, MPa, C, -

Hz, GPa, GPa, C, -

Time

1

t, E_relax, T, Set

t, G_relax, T, Set

Time

2

s, MPa, C, -

s, GPa, C, -

pyvisco.load.Eplexor_master(data, modul)

Load master curve data from an EPLEXOR excel file.

This function loads master curve data from an Excel file created with the EPLEXOR software. Use the Excel Export! feature of the Eplexor software with the default template to create the Excel file. The column headers are renamed to follow the conventions used in this modul. The names of the physical quantities and units are checked against the conventions used in this module.The modulus data, shift factors, and WLF shift function parameters are extracted from the Excel file.

Parameters:
  • data (bytes) – Excel file content.

  • modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

Raises:

KeyError – If the file header variable names or units do not follow the conventions used in this module.

Returns:

  • df_master (pandas.DataFrame) – Contains the master curve data.

  • df_aT (pandas.DataFrame) – Contains the shift factors.

  • df_WLF (pandas.DataFrame) – Contains the WLF shift function parameters.

  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

See also

load.conventions

Summarizes conventions for variable names and units.

load.file

Returns bytes object to be used as parameter data.

load.check_units

Raises KeyError if units don’t comply with conventions

pyvisco.load.user_master(data, domain, RefT, modul)

Load master curve data from csv file.

Either tensile or shear modulus data from materials characterizations performed in either the frequency or time domain are accepted. The file header must consit of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit. The column headers are checked against the conventions used in this modul. Details on the variable names, units, and file header names are provided in the Notes section below.

Parameters:
  • data (bytes) – Excel file content.

  • domain ({'freq', 'time'}) – Defines wether frequency domain (freq) or time domain (time) input data are provided.

  • RefT (int or float) – Reference tempeature of the master curve in Celsius.

  • modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

Returns:

  • df_master (pandas.DataFrame) – Contains the master curve data.

  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

Raises:

KeyError – If the file header variable names or units do not follow the conventions used in this module.

See also

load.conventions

Summarizes conventions for variable names and units.

load.file

Returns bytes object to be used as parameter data.

load.check_units

Raises KeyError if units don’t comply with conventions.

Notes

Dependent on the performed materials characterization, either tensile or shear modulus values in either the time or frequency domain must be provided.

Tensile moduli are denoted as E and shear moduli are denoted as G. Frequency domain data are provided in Hertz: [f] = Hz Time domain data are provided in seconds: [t] = s

Example input files can be found here: (TBD)

Various examples for file headers:

Domain

Row

Tensile Modulus

Shear Modulus

Frequency

1

f, E_stor, E_loss

f, G_stor, G_loss

Frequency

2

Hz, MPa, MPa

Hz, GPa, GPa

Time

1

t, E_relax

t, G_relax

Time

2

s, MPa

s, GPa

pyvisco.load.user_shift(data_shift)

Load user provided shift factors from csv file.

Two columns need to be provided in the input file. One for the shift factors log_aT and one for the corresponding temperatures T. The file header must consit of two rows. The first row provides the name of the physical quantity and the second row provides the corresponding physical unit. The column headers are checked against the conventions used in this modul. Details on the variable names, units, and file header names are provided in the Notes section below.

Parameters:

data_shift (bytes) – CSV file content.

Returns:

df_aT – Contains the shift factors and corresponding temperatures.

Return type:

pandas.DataFrame

Raises:

KeyError – If the file header variable names or units do not follow the conventions used in this module.

See also

load.conventions

Summarizes conventions for variable names and units.

load.file

Returns bytes object to be used as parameter data.

load.check_units

Raises KeyError if units don’t comply with conventions.

Notes

Example file header:

Row

Header

1

T, log_aT

2

C, -

Example input files can be found here: (TBD)

pyvisco.load.get_sets(df_raw, num=0)

Group raw data into measurement sets conducted at the same temperature.

Parameters:
  • df_raw (pandas.DataFrame) – Raw measurement data.

  • num (int, optional) – Number of measurement points per temperature level. Default is 0, which means that the number of measurement points within a set is evaluated based on the provided frequency range of the measurement points. The first occurance of the maximum frequency is used to identify the number of measurement points per temperature level.

Returns:

df_raw – Contains additional column Set compared to input data frame.

Return type:

pandas.DataFrame

Notes

This function is intended to be used in combination with input files provided by the Eplexor software. Hence, it is limited to measurements in the frequency domain.

pyvisco.load.get_units(units, modul, domain, Eplexor=False)

Get the physical units based on the measurement data loading condition (tensile or shear) and domain (time or frequency).

Parameters:
  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

  • modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

  • domain ({'freq', 'time'}) – Defines wether frequency domain (freq) or time domain (time) input data are provided.

  • Eplexor (bool, default = false) – If input file is Excel file from Eplexor software -> True If input file is CSV file from user instrument -> False

Returns:

conv – Conventions for physical quantities as key and corresponding units as itmes for the provided measurement loading conditions and domain.

Return type:

dict of {str : str}

pyvisco.load.check_units(units, modul='E')

Check that the input file units conform with the conventions used in this modul.

The input units are compared against the conventions used for the measurement loading conditions and domain. For frequency domain data, the storage and loss modulus values must have the same unit.

Parameters:
  • units (dict of {str : str}) – Contains the names of the physical quantities as key and the corresponding names of the units as item.

  • modul ({'E', 'G'}) – Indicates wether tensile (E) or shear (G) modulus data are provided.

Raises:

KeyError – If the file header variable names or units do not follow the conventions used in this module.