Private
Public Access
1
0
This commit is contained in:
Sander Roosendaal
2019-04-02 22:34:06 +02:00
parent 75df39aaf2
commit 0a4d775a9e

View File

@@ -408,8 +408,13 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
# quick linear regression
# peakforce = slope*peakforceangle + intercept
try:
slope, intercept, r,p,stderr = linregress(rowdata['peakforceangle'],rowdata['peakforce'])
except KeyError:
slope = 0
intercept = 0
try:
covariancematrix = np.cov(rowdata['peakforceangle'],y=rowdata['peakforce'])
eig_vals, eig_vecs = np.linalg.eig(covariancematrix)
@@ -457,6 +462,31 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
a95b = Rinv[0,1]*y95 + rowdata['peakforceangle'].median()
F95b = Rinv[1,1]*y95 + rowdata['peakforce'].median()
except KeyError:
a25 = 0
F25 = 0
a25b = 0
F25b = 0
a75 = 0
F75 = 0
a75b = 0
F75b = 0
a05 = 0
F05 = 0
a05b = 0
F05b = 0
a95 = 0
F95 = 0
a95b = 0
F95b = 0
@@ -578,8 +608,6 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
]
hull2575 = ConvexHull(points2575)
angles2575 = []
forces2575 = []
@@ -711,6 +739,7 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
multilinedatax = []
multilinedatay = []
for i in range(len(rowdata)):
try:
x = [
rowdata['catch'].values[i],
rowdata['slip'].values[i]+rowdata['catch'].values[i],
@@ -726,6 +755,9 @@ def interactive_forcecurve(theworkouts,workstrokesonly=True,plottype='scatter'):
rowdata['peakforce'].values[i],
thresholdforce,
0]
except KeyError:
x = [0,0]
y = [0,0]
multilinedatax.append(x)
multilinedatay.append(y)