from sklearn.cluster import KMeans import functionclass as fc import numpy as np import matplotlib.pyplot as plt import csv file = 'Data/Datawalk.out' filetime = 'Data/DataTimewalk.out' t0 = 9.765625000e-12 c = 299792458 signaldata = fc.readfile(file) timedata = fc.readfile(filetime) yti = fc.alldifferentpoint(signaldata) yi = yti[0] print(yi, len(yi)) ymax = np.max(yti[1]) print(yti[1]) print(ymax, type(yti[1][0])) print(len(yti[1])) fc.addsaveamplituate(yti[1]) disy = [] for x in range(len(yi)): disy.append((timedata[x][yi[x]] - t0) * c) print(disy) print(disy, type(disy))
# ulabel = u.labels_ # print('ulabel:',u.labels_) # # gh=[] # for x in range(len(ulabel)-2): # if ulabel[x]-ulabel[x+1]!=0 and ulabel[x+1]==ulabel[x+2]: # gh.append(x) # print(gh) file = 'Data/Datastandsit5s.out' filetime = 'Data/DataTimestandsit5s.out' file1 = 'Data/Datarun.out' filetime1 = 'Data/DataTimerun.out' t0 = 9.765625000e-12 c = 299792458 signaldata = fc.readfile(file) timedata = fc.readfile(filetime) signaldata1 = fc.readfile(file1) timedata1 = fc.readfile(filetime1) # yi = fc.alldifferentpoint(signaldata)[1] # print(yi, " before") fc.drawpicture(yi, "data b4 'noise removing'") # testd = fc.remove_nosie(yi) TODO remove noise testd = yi print(testd, " after") #is DISY relative spatial loc change? disy = [] #hmmmm looks fishey