Advertisement
fuccpuff

analyze_logs.py

Nov 17th, 2024
9
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. analyze_logs.pyimport pandas as pd
  2. import matplotlib.pyplot as plt
  3.  
  4. # Загрузка логов
  5. df = pd.read_csv('telemetry_log.txt', names=['x', 'y', 'z', 'vx', 'vy', 'vz'])
  6.  
  7. # Построение траектории
  8. plt.figure()
  9. plt.plot(df['x'], df['y'], label='Trajectory')
  10. plt.xlabel('X (meters)')
  11. plt.ylabel('Y (meters)')
  12. plt.title('Flight Trajectory')
  13. plt.legend()
  14. plt.grid()
  15. plt.show()
  16.  
  17. # Анализ высоты
  18. plt.figure()
  19. plt.plot(df.index, df['z'], label='Altitude')
  20. plt.xlabel('Time Step')
  21. plt.ylabel('Altitude (meters)')
  22. plt.title('Altitude Over Time')
  23. plt.legend()
  24. plt.grid()
  25. plt.show()
  26.  
  27. # Анализ скорости
  28. plt.figure()
  29. plt.plot(df.index, df['vx'], label='Velocity X')
  30. plt.plot(df.index, df['vy'], label='Velocity Y')
  31. plt.plot(df.index, df['vz'], label='Velocity Z')
  32. plt.xlabel('Time Step')
  33. plt.ylabel('Velocity (m/s)')
  34. plt.title('Velocity Over Time')
  35. plt.legend()
  36. plt.grid()
  37. plt.show()
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement