#airlift01 #JDN oct 2024 import matplotlib.pyplot as plt import numpy as np vrs = "\n-----\nairlift v0.9\n--" #air pres to altitude # file holds altitide in meter datafile = 'src/data/shield1/LOG00082raw.TXT' # just 1,2,3,4 x = [] #values accx = [] accy = [] accz = [] gyrox = [] gyroy = [] gyroz = [] temp = [] baro = [] alt = [] n = 0 # nr elm sum = 0 # sum of y values def readData(): i=1 for line in open(datafile, 'r'): lines = [i for i in line.split()] accx.append(float(lines[0])) accy.append(float(lines[1])) accz.append(float(lines[2])) gyrox.append(float(lines[3])) gyroy.append(float(lines[4])) gyroz.append(float(lines[5])) temp.append(float(lines[6])) baro.append(float(lines[7])) alt.append(float(lines[8])) x.append(i) i = i+1 return i def countEl(): cnt = 0 for i in accx: cnt = cnt+1 return cnt def readFile(): readData() cnt = countEl() def printHeader(): print(vrs) print("\nRAW DUMP \n") print("dataset ",datafile) print("no of row of elements ",n) print("time(sec) ",n) def runit(): n = readFile() printHeader() fig,(ax0,ax1,ax2,ax3,ax4,ax5,ax6,ax7,ax8)=plt.subplots(9) ax0.plot(x,accx) ax1.plot(x,accy) ax2.plot(x,accz) ax3.plot(x,gyrox) ax4.plot(x,gyroy) ax5.plot(x,gyroz) ax6.plot(x,temp) ax7.plot(x,baro) ax8.plot(x,alt) plt.show() if __name__ == "__main__": runit()