Private
Public Access
1
0

distance, time sort of working

This commit is contained in:
Sander Roosendaal
2020-11-09 22:42:55 +01:00
parent b63c0b0d4a
commit df39cebfe1
5 changed files with 142 additions and 10 deletions

View File

@@ -371,10 +371,10 @@ def getfastest(df,thevalue,mode='distance'):
tmax = tt.max()
if mode == 'distance':
if dd.max() > thevalue:
if dd.max() < thevalue:
return 0
else:
if tt.max() > thevalue:
if tt.max() < thevalue:
return 0
if tmax > 500000:
@@ -418,10 +418,16 @@ def getfastest(df,thevalue,mode='distance'):
restime = np.array(restime)
distance = np.array(distance)
#for i in range(len(restime)):
# if restime[i]<thevalue*60*1000:
# print(i,restime[i],distance[i],60*1000*thevalue)
d2 = 0
if mode == 'distance':
d2 = griddata(distance,restime,[thevalue],method='linear',rescale=True)
return d2[0]/1000.
else:
d2 = griddata(restime,distance,[thevalue],method='linear',rescale=True)
d2 = griddata(restime,distance,[thevalue*60*1000],method='linear',rescale=True)
return d2[0]
return d2[0]/1000.
return 0