Load the module

If you added the folder in which jpkfile.py is to you site-packages, you should be able to import the module.


In [1]:
import jpkfile

Create a JPKFile object


In [2]:
jpk = jpkfile.JPKFile("../examples/force-save-2016.06.15-13.17.08.jpk-force")

Structure of JPKFile objects

  • Data is separated in segments in jpk archives. Thus, it is separated in JPKFile objects as well. The member JPKFile.segments is a list of JPKSegment objects.

In [3]:
jpk.segments


Out[3]:
{0: <jpkfile.JPKSegment instance at 0x7f1f3ff0ad88>,
 1: <jpkfile.JPKSegment instance at 0x7f1f3aa8ac68>,
 2: <jpkfile.JPKSegment instance at 0x7f1f3ff1ad88>,
 3: <jpkfile.JPKSegment instance at 0x7f1f3ff1ab00>}
  • To get some basic information on the jpk archive behin the JPKFile object, you can use the JPKFile.get_info function. Note that 'segments' is currently the only working keyword here ...

In [7]:
print(jpk.get_info('segments'))


======================================================================
SEGMENT	TYPE	NUM POINTS	DURATION
-------	----	----------	--------
0	extend	60000		10.0
1	pause	30000		5.0
2	retract	60000		10.0
3	pause	2		5.0
======================================================================