def test_open_jpk_calibration(): cf = datadir / "calibration_force-save-2015.02.04-11.25.21.294.jpk-force" try: load_jpk(cf) except jpk_meta.ReadJPKMetaKeyError: pass else: assert False, "no spring constant should raise error"
def test_open_jpk_map(): jpkfile = datadir / "map0d_extracted.jpk-force-map" dataset = load_jpk(jpkfile) data = dataset[0]["data"] force = data["force"] height = data["height (measured)"] # Verified with visual inspection of force curve in JPK software assert np.allclose(force[0], -4.7426862623854873e-10) assert np.allclose(height[0], 7.0554296897149161e-05)
def test_open_jpk_qi(): jpkfile = datadir / "2020.02.07-16.29.05.036.jpk-qi-data" dataset = load_jpk(jpkfile) data = dataset[0]["data"] force = data["force"] height = data["height (measured)"] # Verified with visual inspection of force curve in JPK software assert np.allclose(force[0], -1.269014596090597e-10) assert np.allclose(height[0], 4.716154783699957e-06)
def test_open_jpk_map2(): jpkfile = datadir / "2020.02.07-16.29.05.036.jpk-qi-data" dataset = load_jpk(jpkfile) assert len(dataset) == 4 assert dataset[0]["metadata"]["grid index x"] == 0 assert dataset[1]["metadata"]["grid index x"] == 1 assert dataset[1]["metadata"]["grid index y"] == 0 assert dataset[2]["metadata"]["grid index x"] == 2 assert dataset[3]["metadata"]["grid index x"] == 3 assert dataset[3]["metadata"]["instrument"] == "JPK01496-H-18-0132" assert dataset[3]["metadata"]["software version"] == "6.1.157"
def test_open_jpk_map2(): jpkfile = datadir / "map2x2_extracted.jpk-force-map" dataset = load_jpk(jpkfile) data = dataset[2]["data"] force = data["force"] height = data["height (measured)"] assert len(dataset) == 4 assert np.allclose(force[0], -5.8540192943834714e-10) assert np.allclose(height[0], 0.0001001727719556085) assert dataset[0]["metadata"]["grid index x"] == 0 assert dataset[1]["metadata"]["grid index x"] == 9 assert dataset[2]["metadata"]["grid index x"] == 9 assert dataset[3]["metadata"]["grid index x"] == 0