Skip to content

Instantly share code, notes, and snippets.

@moorepants
Created September 11, 2012 19:45
Show Gist options
  • Save moorepants/3701506 to your computer and use it in GitHub Desktop.
Save moorepants/3701506 to your computer and use it in GitHub Desktop.
Generates a histogram showing the peak steer rates in my the UCD biycle id data.
from canonicalbicycleid.canonical_bicycle_id import select_runs
import bicycledataprocessor as bdp
import matplotlib.pyplot as plt
riders = ['Charlie', 'Jason', 'Luke']
maneuvers = ['Balance',
'Track Straight Line',
'Balance With Disturbance',
'Track Straight Line With Disturbance']
environments = ['Horse Treadmill', 'Pavillion Floor']
runNumbers = select_runs(riders, maneuvers, environments)
errors = []
maxSteerRates = []
dataset = bdp.DataSet()
for i, r in enumerate(runNumbers):
try:
trial = bdp.Run(r, dataset, filterFreq=15.)
maxSteerRates.append(trial.taskSignals['SteerRate'].max())
del trial
except bdp.bdpexceptions.TimeShiftError:
errors.append(r)
except IndexError:
errors.append(r)
plt.hist(maxSteerRates)
plt.xlabel('Max Steer Rate [rad/s]')
plt.savefig('peak_steer_rate_hist.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment