This is the code I have so far:
import numpy as np
#make amplitude and sample arrays
amplitude=[0,1,2,3, 5.5, 6,5,2,2, 4, 2,3,1,6.5,5,7,1,2,2,3,8,4,9,2,3,4,8,4,9,3]
#print(amplitude)
#split arrays up into a line for each sample
traceno=5 #number of traces in file
samplesno=6 #number of samples in each trace. This wont change.
amplitude_split=np.array(amplitude, dtype=np.int).reshape((traceno,samplesno))
print(amplitude_split)
#find max value of trace
max_amp=np.amax(amplitude_split,1)
print(max_amp)
#find index of max value
ind_max_amp=np.argmax(amplitude_split, axis=1, out=None)
#print(ind_max_amp)
#find 90% of max value of trace
amp_90=np.amax(amplitude_split,1)*0.9
print(amp_90)
I would like to find the value in each line of the array that is closest to the corresponding amp_90. I would also like to be able to obtain the index of this number. Please help!
n.b. I know this is easy to do by eye, but it is a test data set before I apply it to my real data!