Example #1
0
def test_open_jpk_simple():
    jpkfile = datadir / "spot3-0192.jpk-force"
    jpkr = JPKReader(jpkfile)
    p_seg = jpkr.get_index_segment_path(0, 0)
    loc_list = [ff for ff in jpkr.files if ff.count(p_seg)]
    name, slot, dat = jpk_data.find_column_dat(loc_list, "height (piezo)")
    properties = jpkr._get_index_segment_properties(0, 0)
    with jpkr.arc.open(dat, "r") as fd:
        height = jpk_data.load_dat_raw(fd, name=name, properties=properties)
    assert height[0] == 50.425720226584403
Example #2
0
def test_get_single_custom_slot():
    jpkfile = datadir / "spot3-0192.jpk-force"
    jpkr = JPKReader(jpkfile)
    p_seg = jpkr.get_index_segment_path(0, 0)
    loc_list = [ff for ff in jpkr.files if ff.count(p_seg)]
    name, slot, dat = jpk_data.find_column_dat(loc_list, "height (piezo)")
    properties = jpkr._get_index_segment_properties(0, 0)
    with jpkr.arc.open(dat, "r") as fd:
        data, unit, _ = jpk_data.load_dat_unit(fd, name=name,
                                               properties=properties,
                                               slot="nominal")
    assert data[0] == 4.9574279773415606e-05
Example #3
0
def test_open_jpk_conversion():
    jpkfile = datadir / "spot3-0192.jpk-force"
    jpkr = JPKReader(jpkfile)
    p_seg = jpkr.get_index_segment_path(0, 0)
    loc_list = [ff for ff in jpkr.files if ff.count(p_seg)]
    properties = jpkr._get_index_segment_properties(0, 0)
    chan_data = {}
    for column in ["force", "height (piezo)", "height (measured)"]:
        name, slot, dat = jpk_data.find_column_dat(loc_list, column)
        with jpkr.arc.open(dat, "r") as fd:
            chan_data[name] = jpk_data.load_dat_unit(fd, name, properties,
                                                     slot)
    assert chan_data["vDeflection"][2] == "vDeflection (Force)"
    assert chan_data["vDeflection"][1] == "N"
    assert chan_data["vDeflection"][0][0] == -5.145579192349918e-10
    assert chan_data["height"][0][0] == 2.8783223430683289e-05
    assert chan_data["strainGaugeHeight"][0][0] == 2.2815672438768612e-05