6. Importing Kinetics Toolkit#
Now that we have learned how to use Python, Numpy, and Matplotlib to perform simple biomechanical analyses, we can go further with more complex analyses using the kineticstoolkit Python package. This package provides functions and classes to express and manipulate time series data (resampling, segmenting using events, synchronizing different instruments, filtering data), performing geometrical operations, visualizing kinematic data interactively, tracking markers and rigid bodies, etc.
Note
Please note that before continuing in this part, you must have a basic to moderate understanding of Python, NumPy, and Matplotlib, and you must have a working Python environment with the kineticstoolkit module installed. If this is not the case, please get started here.
You can import the kineticstoolkit module using two methods:
Standard:
import kineticstoolkit as ktkLab mode:
import kineticstoolkit.lab as ktk
Note
The first import can take several seconds; subsequent imports are much faster.
Lab mode is a convenience tool that sets some defaults for a more enjoyable data processing session in IPython-based environments such as Spyder. It makes cosmetic changes to the representations (repr) of dictionaries, arrays, and warnings, and improves Matplotlib default colours and sizes for interactive biomechanics work. See ktk.change_defaults for more information. All tutorials in this book use this mode.
import kineticstoolkit.lab as ktk
is equivalent to:
import kineticstoolkit as ktk
ktk.change_defaults()