pyCGM_Single.pyCGM.writeKinetics¶
-
pyCGM_Single.pyCGM.
writeKinetics
(CoM_output, kinetics)¶ Uses numpy.save to write kinetics data as an .npy file.
- Parameters
- CoM_outputfile, str, or Path
Full path of the file to be saved to or a file object or a filename.
- kineticsarray_like
Array data to be saved.
Examples
>>> import tempfile >>> tmpdirName = tempfile.mkdtemp() >>> from numpy import load >>> import os >>> from shutil import rmtree >>> CoM_output = os.path.join(tmpdirName, 'CoM') >>> kinetics = [[246.57, 313.56, 1026.56], ... [246.59, 313.62, 1026.56], ... [246.61, 313.69, 1026.57]] >>> writeKinetics(CoM_output, kinetics) >>> load(CoM_output + '.npy') array([[ 246.57, 313.56, 1026.56], [ 246.59, 313.62, 1026.56], [ 246.61, 313.69, 1026.57]]) >>> rmtree(tmpdirName)