-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrack Sensor Analysis.py
52 lines (40 loc) · 1.52 KB
/
Track Sensor Analysis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#Standard Header used on the projects
#first the major packages used for math and graphing
import numpy as np
import matplotlib.pyplot as plt
from cycler import cycler
import scipy.special as sp
import pandas as pd
#Extra Headers:fp
import os as os
import pywt as py
import statistics as st
import os as os
import random
from joblib import Parallel, delayed
from pywt._extensions._pywt import (DiscreteContinuousWavelet, ContinuousWavelet,
Wavelet, _check_dtype)
from pywt._functions import integrate_wavelet, scale2frequency
from time import time as ti
Header = np.array(['Date', 'Hour', 'Minute', 'Second', 'Sec Fraction', 'Sen0x', 'Sen0y', 'Sen0z', 'Sen1x', 'Sen1y', 'Sen1z', 'Sen2x', 'Sen2y', 'Sen2z', 'Sen3x', 'Sen3y', 'Sen3z', 'Sen4x', 'Sen4y', 'Sen4z', 'Sen5x', 'Sen5y', 'Sen5z'])
Directory = 'C:\\Users\\Dan\\Desktop\\Temp\\'
files = os.listdir(Directory)
start = 0
end = 16000000
size = 5000
Arange = 50
coord = 2
Saving = True
location = Directory
Titles = False
for Filename in files:
if Filename[-4:] == '.csv':
ODataSet = np.genfromtxt(open(Directory+'/'+Filename,'r'), delimiter=',',skip_header=1)
length = np.shape(ODataSet)[0]
results =[]
Results = []
for i in range(2):
coord = i+5
for j in range(np.shape(ODataSet)[0]-1):
results.append(np.sign(ODataSet[j+1,coord]*ODataSet[j,coord])*np.abs(np.abs(ODataSet[j+1,coord])-np.abs(ODataSet[j,coord])))
print(np.average(results), st.stdev(results))