Skip to content

Commit 1d792d4

Browse files
author
Dilawar Singh
committed
Fixed interpolation bug.
1 parent cf069af commit 1d792d4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

methods.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ def getTrialNumber(path: str) -> int:
180180

181181
def interpolate_uniform(x0, y0, x1):
182182
# given x0, y0, return x1, y1.
183-
f = sci.interp1d(x0, y0, kind=1, fill_value='extrapolate')
183+
# Do not interpolate using more than zero order.
184+
f = sci.interp1d(x0, y0, kind=0, fill_value='extrapolate')
184185
return f(x1)
185186

186187

@@ -280,14 +281,17 @@ def normalizeAndBaseline(res):
280281
if x in res.columns:
281282
res[x] -= res[x].min()
282283
res[x] /= res[x].max()
284+
assert res[x].max() == 1.0
285+
print( f"[INFO ] Normalized {x}" )
286+
283287
# baseline = res[res['tcam'] < 300]
284288
return res
285289

286290
def plotSession(df):
287291
gridSize = (20, 2)
288292

289293
# plot upto 2500ms
290-
# df = df[df['tcam'] < 2500]
294+
df = df[df['tcam'] < 2500]
291295

292296
ax111 = plt.subplot2grid(gridSize, (0, 0), colspan=1, rowspan=8)
293297
ax111.grid(False)

0 commit comments

Comments
 (0)