I am trying to find two interpolated x-values of a function found where a threshold is crossed.
I have tried switching the x and y values as proposed in previous answers to similar questions; however, this only returns one of the two x-values I am looking for due to the values having the same x-coordinate when inverted.
The red point on each graph shows the point I've already located with the following code:
interp = interp1d(data[1], data.times)
val = interp(great.middle.iloc[1])
Where data is a pandas data frame that contains all the events (so here we are looking at event 1) and a single time column and great is another pandas data frame where the middle value is the greatest value in the event column divided by 2. Here val is equal to 42.28045192307682 which is the interpolated time at which the middle value is reached (for the second time).
I have tried narrowing the the values for the interpolation function, but the interpolation of a y- value always results in Nan x-values.
The data that I am using is kind of large but here is an output for a voltage and time: https://drive.google.com/open?id=16xPB5HU_ZJ4qmIdD8icKrDKAAXAO2lH7 https://drive.google.com/open?id=1Yc-_ole-dFAnpTNJhEjKNYU6hQfCSiar