Guest User

Untitled

a guest
Oct 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 KB | None | 0 0
  1. * = potentially a hit on another surface than the pellets in the hopper
  2.  
  3. 44 2018-10-17 11:08:39
  4. 33 2018-10-17 11:24:40 *
  5. 41 2018-10-17 11:25:00
  6. 49 2018-10-17 12:01:03
  7. 42 2018-10-17 12:01:23
  8. 36 2018-10-17 13:41:49 *
  9. 340376 2018-10-17 13:43:09 ???
  10. 40 2018-10-17 13:43:29
  11. 33 2018-10-17 14:06:50 *
  12. 40 2018-10-17 14:07:10
  13. 32 2018-10-17 14:56:13 *
  14. 40 2018-10-17 14:56:33
  15. 30 2018-10-17 15:24:35 *
  16. 39 2018-10-17 15:24:55
  17. 32 2018-10-17 15:56:57 *
  18. 41 2018-10-17 15:57:17
  19. 35 2018-10-17 16:34:59 *
  20. 41 2018-10-17 16:35:39
  21. 33 2018-10-17 17:33:42 *
  22. 41 2018-10-17 17:34:02
  23. 49 2018-10-17 18:00:44
  24. 41 2018-10-17 18:04:44
  25. 49 2018-10-17 18:11:25
  26. 42 2018-10-17 18:12:25
  27. 52 2018-10-17 18:39:46
  28. 44 2018-10-17 18:40:06
  29. 36 2018-10-17 18:57:48 *
  30. 42 2018-10-17 18:58:08
  31. 69 2018-10-17 19:39:10
  32. 41 2018-10-17 19:39:30
  33. 68 2018-10-17 19:41:10
  34. 41 2018-10-17 19:41:30
  35. 48 2018-10-17 21:22:16
  36. 41 2018-10-17 21:27:56
  37. 48 2018-10-17 23:55:45
  38. 340385 2018-10-18 00:00:26 ???
  39. 45 2018-10-18 00:00:46
  40. 36 2018-10-18 00:31:48 *
  41. 44 2018-10-18 00:32:08
  42. 36 2018-10-18 01:02:49 *
  43. 44 2018-10-18 01:03:09
  44. 52 2018-10-18 06:28:29
  45. 44 2018-10-18 06:35:09
  46. 37 2018-10-18 07:48:54 *
  47. 44 2018-10-18 07:49:34
  48. 340395 2018-10-18 08:13:15 ???
  49. 46 2018-10-18 08:13:35
  50.  
  51. #function to calculate deviation between current and previously read value
  52. def deviation(x,y):
  53. diff = abs(float(x)-float(y))
  54. avg = (float(x)+float(y))/2
  55. return (diff/avg)
  56.  
  57. distance = int(round(duration*34000/2))
  58. if (distance != lastread):
  59. dev = deviation(lastread,distance)
  60. if (dev > allowableError):
  61. #save last entry, only if deviation is big enough.
  62. lastread = distance
  63. saveData(distance)
  64. print str(distance) + "tt" + str(datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S'))
Add Comment
Please, Sign In to add comment