#!/usr/bin/env python # This Script creates a lookup table from the measured error CSV # Wayne Glettig, 16.7.2021 # Uses pandas, because pandas is fast, and needs less CPU & RAM usage than regular numpy import pandas as pd from pandas import read_csv import matplotlib.pyplot as plt # Read in CSV File into DataFrame rawdf: rawdf = read_csv('measure_omega_rot_OUTPUT.csv') rawdf['time']=rawdf['DMS_Secs']+rawdf['DMS_Nsecs']*1e-9 #Joins s & ns columns to one float rawdf['X']=(rawdf['DMS_X']+0.00) #Set X Offset and scale rawdf['Y']=(rawdf['DMS_Y']+0.0005) #Set Y Offset and scale rawdf['Z']=(rawdf['DMS_Z']-0.00) #Set Z Offset and scale # Select Data Window and save to new DataFrame df: #df = rawdf[615:2219] df = rawdf # Create LUT: Average values per omega window lut = pd.DataFrame(columns=['OMEGA', 'X', 'Y', 'Z']) window = 10 # degrees for om in range(0,360, window): Xavg = df[(df.OMEGA>om)&(df.OMEGAom)&(df.OMEGAom)&(df.OMEGA