test.py 789 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. from fetcher import Fetcher
  2. from filter import Filter
  3. import matplotlib.pyplot as plt
  4. def show():
  5. data = []
  6. deal = []
  7. x = list(range(len(data)))
  8. plt.plot(x, data, label='raw', color='green', linestyle='-')
  9. plt.plot(x, deal, label='max', color='red', linestyle='-')
  10. plt.title('image')
  11. plt.xlabel('x')
  12. plt.ylabel('T')
  13. plt.legend()
  14. plt.show()
  15. def main():
  16. fetch = Fetcher()
  17. data = fetch.fetch_one("233301011005310", "2023-12-1 00:00:00", "2023-12-20 00:00:00")
  18. temp = [itr[5] for itr in data]
  19. smooth = Filter(temp, rand=0.2)
  20. smooth.max(step=20, hold=(34, 39))
  21. smooth.avg()
  22. smooth.show()
  23. def test():
  24. for i in range(20):
  25. print(i)
  26. if i == 5:
  27. i = 10
  28. if __name__ == '__main__':
  29. test()