raw_data

Module for reading and compensating data from raw test files produced by the biaxial testing machine

raw_data.read(name, min_num_columns=9, num_rows=0)[source]

Read the raw experiment data file into a numpy array and include additional information from the header.

Parameters:
  • name (str) – The path to the file to be read

  • min_num_columns (int) – The minimum number of floating numbers that a line should be converted to in order to be considered a data line

  • num_rows (int) – How many rows to read. If 0, read all

Returns:

A np.array with test data and an information dictionary containing the test date (key=’date’)

Return type:

tuple( np.array, dict )

If the file would have been formatted nicely, np.loadtxt() would be faster. The comments at the top makes this a bit more difficult. The function detects when the data starts by checking that the line converts into sufficient number of floating point numbers. Thereafter, all lines are assumed to be data lines.

raw_data.compensate(data, cols, od, tstr_sign=0)[source]

Compensate data wrt. scaling, stiffness and cross-talk

Parameters:
  • data – The data matrix to be compensated (as returned from read())

  • cols

    Dictionary giving the column number in data. Required keys are (with expected unit in parenthesis)

    • forc: Axial force [kN]

    • torq: Torque [Nm]

    Optional keys are

    • astr: Axial strain [-]

    • tstr: Angular strain [rad] (Rotational strain measured by the extensometer, which is the rotation over the gauge length calibrated for a 10 mm bar)

    • disp: Test bar elongation [mm]

    • rota: Test bar rotation [rad]

    • acnt: Axial cycle counter [cycle] (half cycles are counted as 0.5)

    • tcnt: Torsional cycle counter [cycle]

  • od – The outer diameter of the test bar [mm]

  • tstr_sign – The sign with which to scale the torsional strain in relation to the torque. -1 if extensometer text upside down, -1 otherwise). If 0 (default), try to automatically detect by correlation with the torque.

Returns:

The compensated data array, an information string about the compensations and the tstr_sign used

Return type:

tuple( np.array, str, int)