active correction working
This commit is contained in:
11035
python_algorithms/CorrCurves/2021_07_14_SmargonError.csv
Normal file
11035
python_algorithms/CorrCurves/2021_07_14_SmargonError.csv
Normal file
File diff suppressed because it is too large
Load Diff
BIN
python_algorithms/CorrCurves/Active Correction.jpg
Normal file
BIN
python_algorithms/CorrCurves/Active Correction.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 161 KiB |
BIN
python_algorithms/CorrCurves/image.png
Normal file
BIN
python_algorithms/CorrCurves/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
43
python_algorithms/CorrCurves/showdata.py
Normal file
43
python_algorithms/CorrCurves/showdata.py
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/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('2021_07_14_SmargonError.csv')
|
||||
rawdf['time']=rawdf['Sekunden1']+rawdf['NaoSek1']*1e-9 #Joins s & ns columns to one float
|
||||
rawdf['X']=(rawdf['DMS1']-6006337873)*1e-9 #Set X Offset and scale
|
||||
rawdf['Y']=(rawdf['DMS2']+43285290)*1e-9 #Set Y Offset and scale
|
||||
rawdf['Z']=(rawdf['DMS3']+169185962)*1e-9 #Set Z Offset and scale
|
||||
|
||||
# Select Data Window and save to new DataFrame df:
|
||||
df = rawdf[615:2219]
|
||||
|
||||
# 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.OMEGA<om+window)]['X'].mean()#*1e-9
|
||||
Yavg = df[(df.OMEGA>om)&(df.OMEGA<om+window)]['Y'].mean()#*1e-9
|
||||
Zavg = df[(df.OMEGA>om)&(df.OMEGA<om+window)]['Z'].mean()#*1e-9
|
||||
lut = lut.append({'OMEGA':om+window/2,'X':Xavg, 'Y':Yavg, 'Z':Zavg}, ignore_index=True)
|
||||
|
||||
# Plot:
|
||||
df.plot(x='time', y=['X','Y','Z'])
|
||||
ax = df.plot(x='OMEGA', y=['X','Y','Z'])
|
||||
lut.plot(x='OMEGA', y=['X','Y','Z'], ax=ax)
|
||||
# Check edge overlap of omega range:
|
||||
lutbef=lut.copy(deep=True)
|
||||
lutbef['OMEGA']=lut['OMEGA']-360
|
||||
lutaft=lut.copy(deep=True)
|
||||
lutaft['OMEGA']=lut['OMEGA']+360
|
||||
lutbef.plot(x='OMEGA', y=['X','Y','Z'], ax=ax)
|
||||
lutaft.plot(x='OMEGA', y=['X','Y','Z'], ax=ax)
|
||||
|
||||
plt.show()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user