Esempio n. 1
0
def calSpeedFlow():
  calspeedflow = array(readData('../resources/calspeedflow.dat'))
  print calspeedflow
  lpc = LPCImpl(start_points_generator = lpcMeanShift(ms_h = 0.1), mult = 1)
  lpc.lpc(X = calspeedflow)
  curve = lpc.getCurve(unscale = True)
  fig = plt.figure()
  plt.scatter(calspeedflow[:,0], calspeedflow[:,1], alpha = 0.3)
  save_xd = curve[0]['save_xd']
  plt.plot(save_xd[:,0], save_xd[:,1])
Esempio n. 2
0
 def testResidualsRunner(self):
   x = map(lambda x: x + gauss(0,0.005 + 0.3*x*x), arange(-1,1,0.05))
   y = map(lambda x: x + gauss(0,0.005 + 0.3*x*x), arange(-1,1,0.05))
   z = map(lambda x: x + gauss(0,0.005 + 0.3*x*x), arange(-1,1,0.05))
   line = array(zip(x,y,z))
   lpc = LPCImpl(h = 0.2, convergence_at = 0.0001, it = 100, mult = 5)
   lpc_curve = lpc.lpc(X=line)
   residuals_calc = LPCResiduals(line, tube_radius = 0.15)
   residuals_runner = LPCResidualsRunner(lpc.getCurve(), residuals_calc)
   residuals_runner.setTauRange([0.05, 0.07])
   residuals = residuals_runner.calculateResiduals()
   pprint(residuals)